Skip to content

"This is a REST API repository that can be used to manage car data with authentication features."

Notifications You must be signed in to change notification settings

Hassanjadi/car-management-api

Repository files navigation

Car Management API

Membuat sebuah REST API yang dapat digunakan untuk melakukan manajemen data mobil dengan fitur authentication. Kriteria sebagai berikut:

  1. Membuat database dengan menggunakan SQL hingga melakukan CRUD data
  2. Mampu menerapkan Service Repository Pattern di dalam sebuah Project
  3. Mampu membuat asynchronous function dan menjalankannya
  4. Mampu menerapkan Token Based Authentication sebagai metode autentikasi di dalam REST API
  5. Mampu membuat Open API Documentation dari REST API yang akan dibuat
  6. Menggunakan TypeScript sebagai bahasa pemrograman

Done

  • Membuat database dengan menggunakan SQL hingga melakukan CRUD data
  • Mampu menerapkan Service Repository Pattern di dalam sebuah Project
  • Mampu membuat asynchronous function dan menjalankannya
  • Mampu menerapkan Token Based Authentication sebagai metode autentikasi di dalam REST API
  • Mampu membuat Open API Documentation dari REST API yang akan dibuat
  • Menggunakan TypeScript sebagai bahasa pemrograman

Entity Relationship Diagram

ERD

Project Installation Guide

This project is a sample Node.js application with Express.js using Docker Compose for container management and Knex.js as the ORM for the database. This is a step-by-step guide to install and run this project locally.

Prerequisites

Make sure you have installed the following software before getting started:

Installation Steps

  1. Clone the Repository

    git clone https://github.com/Hassanjadi/car-management-api
    
  2. Navigate to the Project Directory

    cd car-management-api
    
  3. Install Dependencies

    npm install
    
  4. Build and Run Docker Containers

    docker-compose up --build
    
  5. Run Database Migrations & Seeds

    npx knex migrate:latest
    
    npx knex seed:run
    

The project is now running and can be accessed at http://localhost:3000.

Endpoint

Endpoint Authentication

No URI Method Description
1 /api/v1/register POST Register Member
2 /api/v1/login POST Login

Endpoint Users

No URI Method Description
1 /api/v1/user GET Getting All Users
2 /api/v1/admin POST Adding Admin
3 /api/v1/who-am-i GET Current User

Endpoint Cars

No URI Method Description
1 /api/v1/cars POST Adding Cars
2 /api/v1/cars GET Getting All Cars
3 /api/v1/cars/:id GET Getting Specified Cars
4 /api/v1/cars/:id PUT Update Cars
5 /api/v1/cars/:id DELETE Delete car

Postman Test

Run In Postman

About

"This is a REST API repository that can be used to manage car data with authentication features."

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published