This project is a monorepo managed by Turborepo. It contains the backend API and frontend Web application for managing official business trips (Perjalanan Dinas).
Ensure you have the following installed:
Install dependencies from the root directory:
pnpm installCopy the example environment files to create your local configuration:
- Root:
cp .env.example .env
- API:
cp apps/api/.env.example apps/api/.env
- Web:
cp apps/web/.env.example apps/web/.env
Note: Adjust the values in
.envfiles if necessary, but the defaults should work for local development.
-
Start the Database: Run the PostgreSQL container using Docker Compose:
docker compose up -d
-
Generate Prisma Client: This is required before running any other commands.
pnpm --filter api prisma:generate
-
Migrate and Seed: Apply database migrations and seed initial data:
# Run migrations (automatically generates Prisma Client) pnpm --filter api prisma:migrate # Seed data pnpm --filter api db:seed
Note:
prisma:migrateautomatically generates the Prisma Client. If you need to regenerate the client without migrating (e.g. after pulling changes), run:pnpm --filter api prisma:generate
-
Default Users:
Role Username Password Admin adminpassword123SDM sdmpassword123Pegawai pegawaipassword123
To start the development server for all applications (API and Web):
pnpm dev- API: http://localhost:8080
- Web: http://localhost:3000
To view and manage data directly in the database, you can use Prisma Studio:
pnpm --filter api prisma:studioThis will open a web interface at http://localhost:51212.
apps/api: Backend application built with Express and Prisma.apps/web: Frontend application built with Next.js and shadcn/ui.
If you encounter Error [ERR_MODULE_NOT_FOUND] related to generated/prisma/client, it means the Prisma Client hasn't been generated yet. You need to run the generation command manually:
pnpm --filter api prisma:generateIf you find this project useful, you can support the developer via Saweria: