Appearance
Developer Overview
MTL Rent is a pnpm monorepo with the following structure:
mtl-rent/
├── packages/
│ └── database/ # @mtl-rent/database — Drizzle ORM + PostgreSQL
├── services/
│ ├── api/ # @mtl-rent/api — Fastify 5 REST API (port 3001)
│ ├── web/ # @mtl-rent/web — Next.js 16 frontend (port 3000)
│ ├── admin/ # @mtl-rent/admin — Fastify API + React SPA admin (port 3002)
│ └── scraper/ # @mtl-rent/scraper — Kijiji scraper + BullMQ pipeline
└── docs/ # @mtl-rent/docs — VitePress (port 5174)Services
| Service | Package | Port | Tech |
|---|---|---|---|
| Database | @mtl-rent/database | — | Drizzle ORM, PostgreSQL |
| API | @mtl-rent/api | 3001 | Fastify 5, JWT, Swagger |
| Web | @mtl-rent/web | 3000 | Next.js 16, React 19, TailwindCSS 4, shadcn/ui, next-intl (FR/EN) |
| Admin | @mtl-rent/admin | 3002 | Fastify 5 JSON API + React SPA (Vite, Tailwind 3, shadcn) |
| Scraper | @mtl-rent/scraper | — | BullMQ, Playwright, Node.js |
| Docs | @mtl-rent/docs | 5174 | VitePress |
Infrastructure
- PostgreSQL — Homebrew,
mtl_rentdatabase - Redis — Docker Compose (
docker compose up -d), used by BullMQ job queue - Cloudflare tunnel — exposes all services to public URLs
Key Patterns
- Shared database package — schema and connection logic shared between API, admin, and scraper
- Drizzle ORM — TypeScript-first, schema in code, migration-based
- Fastify routes — one file per resource in
services/api/src/routes/ - JWT auth — httpOnly cookies,
requireAuth/requireLandlordmiddleware - Central API client —
services/web/lib/api.tswith typed methods - TanStack Query — all data fetching on the frontend
- Feature-grouped components —
components/listings/,components/map/, etc. - Bilingual (FR/EN) — next-intl with
[locale]route prefix,messages/en.json+messages/fr.json - pm2 — all services run via pm2, not
pnpm devdirectly
Cloudflare Tunnel
The dev script starts a Cloudflare tunnel exposing all services:
| Public URL | Local Service |
|---|---|
| https://mtl-rent.fesenko.net | localhost:3000 (Web) |
| https://mtl-rent-api.fesenko.net | localhost:3001 (API) |
| https://mtl-rent-admin.fesenko.net | localhost:3002 (Admin) |
| https://mtl-rent-docs.fesenko.net | localhost:5174 (Docs) |
Tunnel config: ~/.cloudflared/config-mtl-rent.yml