Request

Request Management Form for College Students and Faculties

Table of Contents

Installation

Using pnpm

pnpm install

Using npm

npm install

Using bun

bun install

Using Docker

To set up the application with Docker, ensure you have Docker installed and running. Use the following command in your project's root directory:

docker-compose up

This command will start the PostgreSQL container and any other services defined in your docker-compose.yml file.

Setup

After installing the dependencies, you need to generate the Prisma client, run the migrations, and seed the database.

Using pnpm

npx prisma generate
npx prisma migrate dev --name init
npx prisma db seed

Using npm

npx prisma generate
npx prisma migrate dev --name init
npx prisma db seed

Using bun

bun prisma generate
bun prisma migrate dev --name init
bun prisma db seed

Using Docker

Ensure that your Docker containers are running. You can execute the following commands inside your Docker container:

docker exec -it <container_name_or_id> npx prisma generate
docker exec -it <container_name_or_id> npx prisma migrate dev --name init
docker exec -it <container_name_or_id> npx prisma db seed

Replace <container_name_or_id> with the actual name or ID of your Docker container.

Environment Variables

Create a .env file in the root of your project and add the following environment variables:

DATABASE_URL="postgres://username:password@localhost:5432/database"
JWT_SECRET="your-secret-key"

Replace username, password, database, and your-secret-key with your actual database credentials and a secure secret key.

Running the Application

Using pnpm

pnpm start:dev

Using npm

npm run start:dev

Using bun

bun run start:dev

Using Docker

To run the application using Docker:

docker-compose up app

This command will start your application containerized in Docker.


🎉 Congratulations! Your application is now running.

Testing the API Endpoint To test the API endpoint, use a API management software like Postman or Hoppscotch:

Method: GET URL: http://localhost:8000/department Make sure your application is running and accessible at http://localhost:8000. Replace /department with the appropriate endpoint path according to your API design.