Running Locally
Ports, commands and the settings each app needs to run on a development machine.
Ports
| App | Folder | Command | Port |
|---|---|---|---|
| API | service/ | npm run dev | 4000 |
| Tenant web app | app/ | npm run dev | 5173 |
| Dashboard and lawyer portal | client-app/ | npm run dev | 5174 |
| Admin panel | admin/ | npm run dev | 5175 |
| Mobile app | mobile-app/ | npm run ios or npm run android | Expo dev client |
| This documentation | docs/ | npm run dev | 3000 |
The API only accepts browser requests from the origins listed in its ALLOWED_ORIGINS setting, so a web app started on a different port than the one above is blocked by CORS.
API
cd service
npm install --legacy-peer-deps
npm run dev--legacy-peer-deps is needed because of a peer dependency clash between the Cloudinary packages. The service reads its configuration from service/.env: the MongoDB connection string, JWT secrets, mail server, and the Pandascrow, Paystack, Cloudinary and Google credentials. Ask a maintainer for a development copy.
Check which database you are pointed at
Starting the service connects to the database named in its environment file. Confirm that it is a development database before you start it, and before you run any script under service/scripts. Test data written to a shared database is hard to remove.
When the service runs outside production it serves its own raw route list at /api/docs (Swagger UI) and /api/docs/openapi.json. This site's API reference is built from the same source and adds descriptions and responses.
Web apps
Each web app reads the API address from its own environment file.
| App | Variable | Example |
|---|---|---|
app/ | VITE_API_BASE_URL | http://localhost:4000 |
client-app/ | VITE_API_BASE_URL | http://localhost:4000 |
admin/ | VITE_API_URL | http://localhost:4000 |
app/ and client-app/ also need a Google Maps key (VITE_GOOGLE_MAP_API_KEY) for maps and address search, and each app has a variable holding the address of its sibling app for cross-links (VITE_CLIENT_APP_URL, VITE_CONSUMER_APP_URL).
cd app && npm install && npm run devMobile app
cd mobile-app
npm install
npm run iosThe mobile app talks to production by default
The API address is set in mobile-app/constants/api.ts and defaults to the production service. Anything you create from a simulator with that default is real data. Point it at a local or staging API before testing flows that write.
Tests and checks
| Folder | Command | What it runs |
|---|---|---|
service/ | npm test | Node test runner over tests/**/*.test.ts |
app/ | npm test | Vitest |
client-app/, admin/ | npm run lint, npm run build | ESLint and the TypeScript build |
mobile-app/ | npx tsc --noEmit, npm run lint | Type check and Expo lint |
HomeLink Hub