Skip to main content

Prerequisites

  • Node.js 20+
  • pnpm
  • PostgreSQL

Installation

# Clone and install
git clone https://github.com/dilshad-khalil/urban-managment.git
cd urban-managment
pnpm install

Database Setup

-- Create databases
psql -U postgres
CREATE DATABASE urban_management;
CREATE DATABASE urban_management_mobile;

Environment Configuration

Primary Backend (apps/primary-backend/.env)

DATABASE_URL=postgresql://user:pass@localhost:5432/urban_management
JWT_SECRET=your-secret-key
PORT=3001
NODE_ENV=development
CORS_ORIGIN=http://localhost:3000

Mobile Backend (apps/mobile-backend/.env)

DATABASE_URL=postgresql://user:pass@localhost:5432/urban_management_mobile
JWT_SECRET=your-mobile-secret-key
PORT=3002
NODE_ENV=development

Run Migrations

cd apps/primary-backend && pnpm run db:migrate
cd apps/mobile-backend && pnpm run db:migrate

Start Development

# All services
pnpm run dev

# Individual services
cd apps/primary-backend && pnpm run start:dev
cd apps/mobile-backend && pnpm run start:dev

API Endpoints

  • Primary Backend: http://localhost:3001/api/v1
  • Mobile Backend: http://localhost:3002/api/v1

Testing

# Test authentication
curl -X POST http://localhost:3001/api/v1/auth/signin \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","password":"password123"}'