Skip to content

Nitin2332/consumer-platform-backend

 
 

Repository files navigation

Farmer-to-Consumer Discovery Platform Backend

A free discovery platform for consumers and farmers.

About

Farmer-to-Consumer Discovery Platform is a free discovery and connection platform where farmers can list their available products such as crops, vegetables, and fruits. Consumers can find nearby farmers based on location and product availability, and connect directly with sellers via phone calls or WhatsApp.

Our vision is to connect farmers directly with consumers to provide fresh, local produce without middlemen, thereby increasing farmers’ profits and ensuring fair prices.

Tech Stack

Node.js JWT PostgreSQL Prisma OpenAPI Swagger

Run Locally

💡 Quick Start: See SETUP_GUIDE.md for a comprehensive setup guide with troubleshooting tips!

Clone the project

  git clone https://github.com/your_username/consumer-platform-backend.git

Go to the project directory

  cd consumer-platform-backend

Install dependencies

  npm install

Environment Variables

Create a .env file in the root directory by copying the example file:

  cp .env.example .env

Then update the values in .env file:

  • DATABASE_URL - PostgreSQL connection string
  • JWT_SECRET - Secret key for JWT token generation
  • PORT - Server port (default: 3000)
  • NODE_ENV - Environment mode (development/production)

Database Setup

Option 1: Using Docker (Recommended for local development)

Start PostgreSQL using Docker Compose:

  docker-compose up -d

Option 2: Using your own PostgreSQL instance

Make sure PostgreSQL is installed and running, then update DATABASE_URL in your .env file accordingly.

Prisma Setup

Migrate all migrations to database

  npx prisma migrate dev

Generate Prisma client

  npx prisma generate

Execution

To start the development server, run:

  npm run dev

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%