Skip to content

Repository Air Research Preview Program: home assignment task Task 1

Notifications You must be signed in to change notification settings

sgehrig/jb_air_task1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Air Task 1 API

This project provides a REST API for managing Customers, ShopItemCategories, ShopItems, and Orders using Go, Gin, GORM, and SQLite.

Prerequisites

  • Go 1.24 or newer
  • Gin and GORM (installed via go mod tidy)
  • No external database setup required (uses SQLite)

Setup

  1. Clone the repository:

    git clone <your-repo-url>
    cd air-research-task1
  2. Download dependencies:

    go mod tidy

Running the API

Start the API server with:

go run main.go

The server will start (by default) on localhost:8080.

API Endpoints

  • GET /customers
  • POST /customers
  • GET /customers/:id
  • PUT /customers/:id
  • DELETE /customers/:id
  • GET /categories
  • POST /categories
  • GET /categories/:id
  • PUT /categories/:id
  • DELETE /categories/:id
  • GET /items
  • POST /items
  • GET /items/:id
  • PUT /items/:id
  • DELETE /items/:id
  • GET /orders
  • POST /orders
  • GET /orders/:id
  • PUT /orders/:id
  • DELETE /orders/:id

Running Tests

To run all API endpoint tests:

go test ./api

Notes

  • The database is automatically initialized with some default data if empty.
  • All data is stored in a local SQLite file (db.sqlite by default).
  • No additional configuration is required.

About

Repository Air Research Preview Program: home assignment task Task 1

Topics

Resources

Stars

Watchers

Forks

Languages