E-commerce backend API built with NestJS, Prisma, and PostgreSQL with Clerk authentication.
- Node.js 18+
- PostgreSQL database
- Clerk account (for authentication)
- Install dependencies:
npm install- Configure environment variables:
cp .env.example .envEdit .env with your configuration:
DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=public"
PORT=3000
JWTSECRETKEY="your-jwt-secret-key"
EMAILUSER="your-email@gmail.com"
EMAILPASS="your-gmail-app-password"
NODE_ENV="development"
# Clerk Configuration
CLERK_SECRET_KEY="your-clerk-secret-key"
CLERK_PUBLISHABLE_KEY="your-clerk-publishable-key"
# Frontend URL for CORS
FRONTEND_URL="http://localhost:3001"- Run database migrations:
npx prisma migrate dev- Generate Prisma Client:
npx prisma generate- Start the development server:
npm run start:devThe API will be available at http://localhost:3000
- API Documentation:
http://localhost:3000/api(Swagger UI) - Integration Guide: API_INTEGRATION_GUIDE.md
- Quick Reference: QUICK_REFERENCE.md
- Changelog: CHANGELOG_INTEGRATION.md
This API uses Clerk for authentication. All protected endpoints require a valid Clerk JWT token in the Authorization header:
Authorizat