1. Install the packages
You need Node.js 22 or newer (see Requirements). In the project folder:
npm install
2. Create your settings file
cp .env.example .env
Open .env and change at least these lines:
AUTH_SECRET="paste-a-long-random-string-here"
OWNER_EMAIL="you@your-agency.om"
OWNER_PASSWORD="a-strong-password-for-the-owner"
Generate a good secret with:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
Every variable is explained in Environment variables.
3. Create the database and the sample agency
npm run setup
This runs prisma generate (the database client), prisma db push (creates the tables in prisma/dar.db) and npm run db:seed (settings, areas, the owner account from OWNER_EMAIL / OWNER_PASSWORD, four sample staff members, 24 listings, inquiries and viewings). Running it again is safe: the seed only fills what is empty.
To start over with a clean database:
npm run db:reset
4. Run it
npm run dev
| Address | What |
|---|---|
| http://localhost:3303 | redirects to the Arabic site /ar |
| http://localhost:3303/en | English site |
| http://localhost:3303/en/dashboard | agency dashboard (sign in with OWNER_EMAIL / OWNER_PASSWORD) |
| http://localhost:3303/en/docs | this documentation |
The sample staff accounts are aisha@dar.test (admin), salim@dar.test, maryam@dar.test and khalid@dar.test (agents), all with the password in SEED_STAFF_PASSWORD. Delete or deactivate them before going live (Dashboard > Team).
5. Check that everything works
npm run lint # TypeScript, no errors expected
npm test # unit tests for statuses, roles, search, SEO and texts
npm run build # production build
npm start # then, in a second terminal:
python scripts/e2e_api.py http://localhost:3303
scripts/e2e_api.py signs in as the owner and the agents, sends inquiries and viewing requests, walks them through their statuses and checks every permission. It creates a few test records, so run it on a test database.
Production
The full steps (a Linux server with PM2 and Nginx, or Docker, backups and PostgreSQL) are in Deployment. To understand each setup step instead of running npm run setup, read Manual setup and deployment.