This guide will help you set up and run the MESO (Mess Management System) application locally for development.
- Node.js: v18+ (Download)
- PostgreSQL: v13+ (Download) or use Docker
- npm/pnpm: Latest version
- Git: For version control
The fastest way to get started is using Docker Compose, which sets up PostgreSQL and the backend automatically.
cd meso/server
cp .env.example .envEdit .env with your Google OAuth credentials:
GOOGLE_CLIENT_ID=your_google_client_id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your_google_client_secret
Get these from Google Cloud Console.
docker-compose up -dThis will:
- Start PostgreSQL database
- Run Prisma migrations
- Start the NestJS backend on
http://localhost:3000
Check logs:
docker-compose logs -f backendcd ../client
cp .env.example .env.local
npm install
npm run devFrontend will start on http://localhost:5173
Visit http://localhost:5173 and you should see the app!
cd meso/server
npm installcp .env.example .envUpdate .env:
DATABASE_URL=postgresql://postgres:password@localhost:5432/meso_dev
JWT_SECRET=your_super_secret_jwt_key_min_32_characters_long
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
Create database locally:
createdb meso_devOr if PostgreSQL is not installed, install it:
- macOS:
brew install postgresql@16 - Ubuntu:
sudo apt-get install postgresql - Windows: Download from postgresql.org
npm run prisma:migrateThis creates all tables from the schema.
Generate Prisma client:
npm run prisma:generatenpm run start:devBackend will start on http://localhost:3000
Check health:
curl http://localhost:3000/healthView Swagger docs:
http://localhost:3000/api/docs
cd meso/client
npm installcp .env.example .env.localUpdate .env.local:
VITE_API_URL=http://localhost:3000
VITE_GOOGLE_CLIENT_ID=your_google_client_id
npm run devFrontend will start on http://localhost:5173
npm run build
npm run preview # Preview production buildmeso/
├── server/ # NestJS Backend
│ ├── src/
│ │ ├── main.ts # Application entry point
│ │ ├── app.module.ts # Root module
│ │ ├── common/ # Shared utilities, filters, interceptors
│ │ └── modules/ # Feature modules (Auth, Mess, Meals, etc.)
│ ├── prisma/
│ │ └── schema.prisma # Database schema
│ ├── docker-compose.yml # Development stack
│ ├── Dockerfile # Production image
│ └── package.json # Dependencies
│
├── client/ # React Frontend
│ ├── src/
│ │ ├── App.tsx # Root component
│ │ ├── main.tsx # Entry point
│ │ ├── pages/ # Page components
│ │ ├── components/ # Reusable components
│ │ ├── hooks/ # Custom hooks
│ │ ├── stores/ # Zustand stores (to be created)
│ │ ├── services/ # API services
│ │ ├── types/ # TypeScript interfaces
│ │ └── utils/ # Utility functions
│ ├── vite.config.ts # Vite configuration
│ └── package.json # Dependencies
│
└── README.md # Project overview
GET /auth/google- Login with GoogleGET /auth/google/callback- Google OAuth callbackPOST /auth/logout- Logout userGET /auth/me- Get current user
POST /mess- Create a new messGET /mess/:id- Get mess detailsPUT /mess/:id- Update messGET /mess/:id/members- Get all members
POST /members- Add member to messDELETE /members/:id- Remove memberPUT /members/:id/role- Change member role
POST /meals- Add meal recordGET /meals?monthId=:id&cursor=:cursor- Get meals (paginated)PUT /meals/:id- Update mealDELETE /meals/:id- Delete meal
POST /costs- Add costGET /costs?monthId=:id- Get costsDELETE /costs/:id- Delete cost
POST /deposits- Record depositGET /deposits?monthId=:id- Get deposits
GET /settlement/:monthId- Get settlement for month
GET /reports/settlement/:monthId/pdf- Download settlement as PDF
- Make changes to TypeScript files in
src/ - Dev server auto-reloads with
npm run start:dev - Check types:
npx tsc --noEmit - Lint:
npm run lint
When you update prisma/schema.prisma:
# Create migration
npm run prisma:migrate
# Or push directly (dev only)
npm run prisma:push
# View data with UI
npm run prisma:studio- Changes in
src/auto-reload in browser - Check types:
npm run type-check - Lint:
npm run lint
Use the Swagger UI at http://localhost:3000/api/docs to test endpoints.
Or use curl:
curl -X GET http://localhost:3000/healthError: connect ECONNREFUSED 127.0.0.1:5432
Solution:
- Ensure PostgreSQL is running
- Check DATABASE_URL in .env
- Try:
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=password postgres:16
Error: listen EADDRINUSE :::3000
Solution:
# Kill process on port 3000
lsof -ti:3000 | xargs kill -9Error: @prisma/client not found
Solution:
npm install
npm run prisma:generate- Verify Client ID and Secret in .env
- Check Google Cloud Console for correct redirect URI
- Should match:
http://localhost:3000/api/v1/auth/google/callback
npm run test
npm run test:watch
npm run test:covnpm run test:e2e- Push code to GitHub
- Connect to Vercel
- Set environment variables in Vercel dashboard
- Deploy:
vercel deploy
Frontend can be deployed separately:
cd client
vercel deployOr push to GitHub and connect to Vercel for automatic deploys.
-
Backend Development
- Add comprehensive DTOs to all modules
- Add request validation
- Implement missing services
- Add error handling for edge cases
- Write unit tests
-
Frontend Development
- Create Zustand stores
- Create React Query hooks
- Build pages and components
- Add form validation
- Implement PDF export
-
Integration
- Connect frontend to API
- Test full user workflows
- Performance optimization
- Security review
- Backend Issues: Check
server/README.md - Frontend Issues: Check
client/README.md - Architecture: Check root
README.md - Progress: Check
PROGRESS.md
For issues and questions:
- Check the relevant README
- Review PROGRESS.md for current implementation status
- Check code comments for implementation details