A full-stack e-commerce application built with Next.js, Express, PostgreSQL, and Prisma.
- Frontend: Next.js 14 (App Router), TypeScript, Tailwind CSS, shadcn/ui, Zustand
- Backend: Node.js, Express, TypeScript, Prisma ORM
- Database: PostgreSQL
- Cache/Queue: Redis
- Real-time: Socket.io
- Auth: JWT (access + refresh tokens)
- File Storage: Cloudinary
- Payments: Razorpay/Stripe
instamart/
├── apps/
│ ├── web/ # Customer frontend (Next.js)
│ └── admin/ # Admin panel (Next.js)
├── packages/
│ ├── api/ # Express backend
│ └── types/ # Shared TypeScript types
- Node.js 18+ and npm/yarn/pnpm
- Docker and Docker Compose
- PostgreSQL (via Docker)
- Redis (via Docker)
- Clone and install dependencies:
npm install- Start Docker services (PostgreSQL + Redis):
docker-compose up -d- Set up environment variables:
Create .env files in:
packages/api/.envapps/web/.env.localapps/admin/.env.local
See .env.example files in each directory.
- Set up database:
npm run db:generate
npm run db:migrate
npm run db:seed- Start development servers:
npm run devThis will start:
- API: http://localhost:4000
- Web: http://localhost:3000
- Admin: http://localhost:3001
npm run dev- Start all apps in development modenpm run build- Build all apps for productionnpm run lint- Lint all appsnpm run db:generate- Generate Prisma clientnpm run db:migrate- Run database migrationsnpm run db:seed- Seed database with sample datanpm run db:studio- Open Prisma Studio
After seeding, you can login with:
Admin:
- Email: admin@instamart.com
- Password: Admin@123
Customer:
- Email: customer@example.com
- Password: Customer@123
- User registration & authentication
- Product browsing & search
- Shopping cart
- Order placement & tracking
- Profile management
- Address management
- Order history
- Dashboard with analytics
- Product management (CRUD)
- Category management
- Order management
- User management
- Inventory tracking
API endpoints are available at: http://localhost:4000/api/v1
See API_DOCS.md for detailed endpoint documentation.
MIT