Murigi-Nganga / UniApi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uni API

An API for managing institutions, courses and students

Getting Started

Prerequisites

Ensure you have the following installed:

  • Java (version 17)
  • PostgreSQL Database (and optionally, PgAdmin)
  • Docker (if you'd like to run the application using docker)

Running the application

The application can be run in two ways:

A. Locally

If you're using an IDE like IntelliJ, you can run the app using the 'Play' button

Otherwise, you can run the app on your terminal:

  1. Navigate to your project directory

    cd /path/to/your/project
  2. Run:

    gradlew bootRun

B. Using docker

  1. First build your application to produce a .jar file

    gradlew bootJar
  2. You will find the .jar file in the build/libs directory

    /your-project
    |---build
        |---libs
            |---your-application.jar
    |---build.gradle
  3. Build the image

    docker build -t <your-image-name>:<tag> .
  4. Run the container based on the image, adding environment variables. Note that docker adds a tag (latest) at the end if one is not defined

    docker run -p 8080:8080 \
    -e DATABASE_URL=<your-db-url> \
    -e DATABASE_USERNAME=<your-db-username> \
    -e DATABASE_PASSWORD=<your-db-password> \
    <your-image-name>:<tag>

Note: If you're on Linux/MacOS, use ./gradlew instead of gradlew

Database Schema

The database schema used:

Database Schema Image

Postman collection

The following resource contains a published collection of the API Endpoints for Uni API:

Uni API Postman Collection

About


Languages

Language:Java 99.5%Language:Dockerfile 0.5%