A simple full-stack Lead Management application built with:
- Frontend: Next.js (App Router), Tailwind CSS, shadcn/ui
- Backend: Node.js, Express
- Database: PostgreSQL with Prisma ORM
-
Create new leads
-
View all leads
-
Status tracking:
- New
- Engaged
- Proposal Sent
- Closed-Won
- Closed-Lost
-
Clean, responsive UI
-
REST API backend
- backend → Express API
- frontend → Next.js UI
cd backend
npm installCreate a .env file:
DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE"Example:
DATABASE_URL="postgresql://postgres:123456@localhost:5432/lead_manager"npx prisma migrate dev
npx prisma generate(Optional seed)
npx prisma db seednpm run devBackend runs at:
cd frontend
npm installCreate .env.local:
NEXT_PUBLIC_API_URL=http://localhost:3000npm run devFrontend runs at:
GET /leads
POST /leads
Request body:
{
"name": "John Doe",
"email": "john@example.com",
"status": "New"
}- New
- Engaged
- Proposal Sent
- Closed-Won
- Closed-Lost
Lead model fields:
- id (string, auto-generated)
- name (string)
- email (unique string)
- status (string enum)
- createdAt (timestamp)
- Next.js (App Router)
- Tailwind CSS
- shadcn/ui
- Node.js + Express
- Prisma ORM
- PostgreSQL
cd backend
npm install
npm run devcd frontend
npm install
npm run dev- Ensure PostgreSQL is running locally
- Backend must be running before frontend API calls work
- Environment variables must be properly configured
- Prisma migrations must be applied before using the database
You can test the API using Postman:
- POST /leads
- GET /leads