MVP Base Documentation
A production-ready Next.js + NestJS monorepo with Docker, Clerk, and TypeORM.
π Getting Started
Clone the repository and install dependencies:
git clone https://github.com/juntals01/mvpbase
cd mvpbase
npm install
npm run docker:up
npm run devThis runs both the frontend (Next.js) and backend (NestJS) in parallel.
π Project Structure
mvpbase/
βββ apps/
β βββ web/ # Next.js frontend
β βββ api/ # NestJS backend
βββ docker-compose.yml
βββ .env
βββ package.jsonβοΈ Environment Variables
Configure your local `.env` in the project root:
# App
API_PORT=4000
WEB_PORT=3000
NEXT_PUBLIC_API_URL=http://localhost:4000
# Clerk
CLERK_PUBLISHABLE_KEY=pk_test_xxx
CLERK_SECRET_KEY=sk_test_xxx
# Database
POSTGRES_USER=mvpbase_user
POSTGRES_PASSWORD=mvpbase_pass
POSTGRES_DB=mvpbase_db
POSTGRES_PORT=5433
# Redis
REDIS_PORT=6379π§± Common Commands
# Run both web + api
npm run dev
# Run only API
npm run dev -w apps/api
# Run only Web
npm run dev -w apps/web
# Start Docker services (Postgres, Redis, MinIO)
npm run docker:up
# Stop Docker
npm run docker:downπ Authentication (Clerk)
MVP Base uses Clerk for authentication on both the frontend and backend.
# Web
npm install -w apps/web @clerk/nextjs
# API
npm install -w apps/api @clerk/clerk-sdk-node @clerk/expressClerk handles login, sign-up, and JWT verification for the API.
ποΈ Database & Migrations
# Generate a migration
npm run -w apps/api migration:generate src/database/migrations/AddUserTable
# Run migrations
npm run -w apps/api migration:run
# Reset DB
npm run -w apps/api db:resetπ‘ Development Tips
- Restart Docker with
npm run docker:restartif DB changes. - Environment variables in root `.env` apply to both apps.
- Frontend runs on
http://localhost:3000. - API runs on
http://localhost:4000.