Getting Started with AgriMarket
Installation Guide
Prerequisites:
- Node.js and npm (or yarn): Ensure you have the latest versions installed.
- A code editor: Choose a preferred code editor like Visual Studio Code, Sublime Text, or Atom.
- Git: For version control and collaboration.
Steps:
-
Clone the Repository:
git clone https://github.com/NexLogik/agrimarket
-
Install Dependencies: Navigate to the project directory and run the following command:
npm install
Or, if you prefer pnpm:
pnpm install
-
Setting Up Your Database for AgriMarket:
Understanding the Database Setup
A database is essential for storing and managing the critical information for your AgriMarket application, such as user accounts, product listings, orders, and more.
Recommended Database Provider: Neon
We recommend using Neon for your database. It's a serverless database that's easy to set up and offers a reliable and scalable solution.
Steps to Set Up Your Database:
-
Create a Neon Account:
- Sign up for a free Neon account.
- Create a new PostgreSQL database.
- Obtain your database connection URL.
-
Set Up Environment Variables:
- Create a
.env
file in your project's root directory. - Add the following environment variable, replacing
<your_database_connection_url>
with the actual URL you got from Neon:
DATABASE_URL=<your_database_connection_url>
- Create a
-
Push the Schema to the Database:
- Run the following command in your terminal:
npx prisma db push
- This will push the Prisma schema defined in your
schema.prisma
file to your Neon database.
Remember:
- Security: Ensure the security of your database connection URL.
- Error Handling: Implement robust error handling in your application to gracefully handle unexpected errors.
- Performance Optimization: Optimize database queries and consider using caching mechanisms to improve performance.
By following these steps, you'll have a robust database set up to power your AgriMarket application.
-
-
Start the Development Server: To run the development server, use the following command:
npm run dev
Or, if you prefer pnpm:
pnpm dev
Accessing the Application:
Once the development server starts, you can access AgriMarket in your web browser at http://localhost:3000
.