This project provides a REST API for managing Customers, ShopItemCategories, ShopItems, and Orders using Go, Gin, GORM, and SQLite.
- Go 1.24 or newer
- Gin and GORM (installed via
go mod tidy) - No external database setup required (uses SQLite)
-
Clone the repository:
git clone <your-repo-url> cd air-research-task1
-
Download dependencies:
go mod tidy
Start the API server with:
go run main.goThe server will start (by default) on localhost:8080.
GET /customersPOST /customersGET /customers/:idPUT /customers/:idDELETE /customers/:idGET /categoriesPOST /categoriesGET /categories/:idPUT /categories/:idDELETE /categories/:idGET /itemsPOST /itemsGET /items/:idPUT /items/:idDELETE /items/:idGET /ordersPOST /ordersGET /orders/:idPUT /orders/:idDELETE /orders/:id
To run all API endpoint tests:
go test ./api- The database is automatically initialized with some default data if empty.
- All data is stored in a local SQLite file (
db.sqliteby default). - No additional configuration is required.