Centralized government property, tenant, rental, sale / installment, and payment tracking for Chiro City Administration.
- Frontend: React (Vite), existing UI kit (unchanged theme)
- Backend: NestJS 10, Prisma 6, PostgreSQL
- Auth: JWT + role/permission guards (
ADMIN,HOUSING_OFFICER)
- Node.js 20+
- PostgreSQL 14+ (local instance)
- npm
Create a database and set the URL (see backend/.env.example):
DATABASE_URL="postgresql://USER:PASSWORD@localhost:5432/chrms?schema=public"cd backend
cp .env.example .env
# Edit .env — set DATABASE_URL, JWT_SECRET, CORS_ORIGIN (comma-separated if UI uses several ports, e.g. http://localhost:8080,http://localhost:8081). If omitted, 8080 and 8081 are allowed by default.
npm install
npx prisma migrate deploy
npx prisma db seed
npm run start:devAPI default: http://localhost:3000
| Password | Role | |
|---|---|---|
| admin@chiro.gov.et | password123 | ADMIN |
| housing@chiro.gov.et | password123 | HOUSING_OFFICER |
POST /auth/loginGET|POST /properties,GET|PUT /properties/:idGET|POST /tenants,GET /tenants/:idGET|POST /rentals,GET /rentals/:idGET|POST /rental-paymentsGET|POST /sales,GET /sales/:idGET|POST /sale-paymentsGET /dashboard/summary,GET /dashboard/trendsGET /reports/summaryGET /users/meGET /notificationsGET /audit/logs(ADMIN only)
cd frontend
cp .env.example .env
# VITE_API_URL=http://localhost:3000
npm install
npm run devApp default: http://localhost:8080 (see vite.config.ts).
Sign in with a seeded user, then use Dashboard, Properties, Tenants, Rentals, Sales, and Payments.
- Sale:
total_paid = SUM(sale_payments.amount),remaining = total_price - total_paid, completion %; whenremaining === 0, sale status →completed. - Rental overdue: current month past
due_dayand payments in that month <monthly_rent. - New rental: property must be
available; status set torented. - New sale: property must be
availableand have no active rental; status set tosold.
- 10 properties, 5 tenants, 3 active rentals (with sample payments), 2 sales (with installment payments).
Chiro City Housing/
├── backend/ # NestJS + Prisma
├── frontend/ # React SPA
└── README.md
| Location | Command | Purpose |
|---|---|---|
| backend | npm run start:dev |
Dev API |
| backend | npm run build |
Compile |
| backend | npx prisma migrate deploy |
Apply migrations |
| backend | npx prisma db seed |
Load seed data |
| frontend | npm run dev |
Dev UI |
| frontend | npm run build |
Production build |