Skip to content

MarioMedWilson/car-catalog

Repository files navigation

Car Catalog

This project a golang API that provides endpoints for managing Cars catalogs and there types.

Installation

  1. Clone project
git clone https://github.com/MarioMedWilson/car-catalog.git
  1. Change into the project directory
cd car-catalog
  1. Install pkg
go mod download
  1. Build Project
go build -o main
  1. Run Projcet
./main

Docker option

docker-compose up

Note that if it didn't from first time terminate and rerun

API Endpoints

Car endpoints

Method URL Description
GET /car Retrieve all cars.
POST /car Create a new car.
GET /car/:id Retrieves a specific car by ID.
PUT /car/:id Updates a specific car by ID.
DELETE /car/:id Deletes a specific car by ID.
GET /car/?filter={...} Retrieve cars with filter.

Car type endpoints

Method URL Description
GET /car-type Retrieve all cars types.
POST /car-type Create a new car type.
GET /car-type/:id Retrieves a car type by ID.
PUT /car-type/:id Updates a car type by ID.
DELETE /car-type/:id Deletes a car type by ID.

Examples of requests

POST /car-type

Request body create type

{
    "type": "Diesel cars"
}
POST /car

Request body create car

{
    "name": "F-Type",
    "make": "Jaguar",
    "modelyear": 2012,
    "color": "black",
    "speedrange": "0-350",
    "TypeID": 2
}

ERD Database

Pic

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published