Skip to content

yusufstawan/perdinpro

Repository files navigation

PerdinPro (Sistem Informasi Perjalanan Dinas)

This project is a monorepo managed by Turborepo. It contains the backend API and frontend Web application for managing official business trips (Perjalanan Dinas).

Prerequisites

Ensure you have the following installed:

Installation

Install dependencies from the root directory:

pnpm install

Environment Setup

Copy the example environment files to create your local configuration:

  1. Root:
    cp .env.example .env
  2. API:
    cp apps/api/.env.example apps/api/.env
  3. Web:
    cp apps/web/.env.example apps/web/.env

Note: Adjust the values in .env files if necessary, but the defaults should work for local development.

Database Setup

  1. Start the Database: Run the PostgreSQL container using Docker Compose:

    docker compose up -d
  2. Generate Prisma Client: This is required before running any other commands.

    pnpm --filter api prisma:generate
  3. 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:migrate automatically generates the Prisma Client. If you need to regenerate the client without migrating (e.g. after pulling changes), run:

    pnpm --filter api prisma:generate
  4. Default Users:

    Role Username Password
    Admin admin password123
    SDM sdm password123
    Pegawai pegawai password123

Running Development

To start the development server for all applications (API and Web):

pnpm dev

Database Management

To view and manage data directly in the database, you can use Prisma Studio:

pnpm --filter api prisma:studio

This will open a web interface at http://localhost:51212.

Project Structure

  • apps/api: Backend application built with Express and Prisma.
  • apps/web: Frontend application built with Next.js and shadcn/ui.

Troubleshooting

Prisma Client Not Found

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:generate

Support

If you find this project useful, you can support the developer via Saweria:

Saweria

About

PerdinPro (Sistem Informasi Perjalanan Dinas)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published