A multi-vendor e-commerce platform: Next.js frontend and NestJS backend (TypeORM + PostgreSQL)
- Features
- Tech Stack
- Getting Started
- Project Structure
- API Documentation
- Testing
- Deployment
- Contributing
- License
A multi-vendor e-commerce platform: a Next.js frontend and a NestJS backend (TypeORM + PostgreSQL)
This repository contains two top-level apps:
client/β a Next.js (App Router) React frontend using TypeScript and Tailwind.server/β a NestJS backend API built with TypeScript, TypeORM, and PostgreSQL.
They can be run independently or together for local development. Below are quick, copy-ready steps to get both running.
- Frontend: Next.js, React, TypeScript, Tailwind CSS
- Backend: NestJS, TypeScript, TypeORM, PostgreSQL, Redis (optional)
- Dev tools: PNPM, Docker, Jest, ESLint, Prettier
- Node.js v18+
- PNPM
- PostgreSQL
- Redis (optional, used by the server)
- Docker & Docker Compose (optional)
- Open a terminal and change to the
server/directory:
cd server
pnpm install- Create environment file and configure DB credentials (copy from example if present):
cp .env.example .env
# then edit .env to set database, redis, and other secrets- Start the server in development mode (default port 3000):
pnpm run start:devThe API should be reachable at http://localhost:3000. The server console will also print the Swagger/OpenAPI URL when available.
- Open a new terminal and change to the
client/directory:
cd client
pnpm install- Configure the client to talk to the API. Create
.env.localinclient/and set the API base URL (example):
# in client/.env.local
NEXT_PUBLIC_API_URL=http://localhost:3000- Start the Next.js dev server. To avoid port conflicts with the backend, run the frontend on port 3001:
PORT=3001 pnpm run devThe web app will be available at http://localhost:3001.
Start the server (port 3000) then the client (port 3001). If you prefer Docker, consult any docker-compose.yml in the repo (top-level or inside server/) to start required services (Postgres, Redis) and the apps.
-
client/ β Next.js frontend (App Router, TypeScript, Tailwind)
- app/ β Next.js app folder
- components/ β React components and UI primitives
- public/ β static assets
- package.json β frontend scripts & deps
-
server/ β NestJS backend
- src/ β Nest application source
- src/modules β feature modules
- package.json β backend scripts & deps
- README.md β server-specific instructions (if present)
server/.envβ database, redis, JWT secrets, third-party API keys. Copy fromserver/.env.examplewhen present.client/.env.localβ frontend-specific variables (e.g. NEXT_PUBLIC_API_URL).
Ports used by default:
- Server API: 3000
- Client (Next.js): 3001 (recommended when running alongside server)
- Backend tests (in
server/) typically run with:
cd server
pnpm test- Frontend tests (in
client/) run with:
cd client
pnpm testRun linters and formatters with pnpm lint / pnpm format inside each project if scripts are defined.
- NestJS: https://docs.nestjs.com/
- Next.js: https://nextjs.org/docs
- TypeORM: https://typeorm.io/
- PostgreSQL: https://www.postgresql.org/docs/
If you'd like, I can also:
- Add example
docker-compose.ymlto orchestrate Postgres + Redis + both apps locally. - Add a root-level
Makefileor task scripts to start both projects with a single command. - Commit this README update for you.