Skip to content

proteyo/volt-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Volt Service API

A backend-focused RESTful web service built with Go, Gin, layered architecture and in-memory business logic.

The project demonstrates CRUD operations, service-layer separation, handlers, models, utility functions, unit tests and a simple HTML frontend for different roles.

Features

  • REST API built with Gin
  • CRUD for users
  • CRUD for products
  • CRUD for categories
  • CRUD for orders
  • Order status updates
  • Courier assignment
  • Chat messages inside orders
  • Layered architecture
  • In-memory data storage
  • Unit tests
  • Simple frontend pages for admin, client and courier flows

Tech Stack

  • Go
  • Gin
  • REST API
  • In-memory storage
  • HTML/CSS frontend
  • Unit testing

Project Structure

volt-service/
├── frontend/
│   ├── admin.html
│   ├── client.html
│   ├── courier.html
│   ├── login.html
│   └── register.html
├── handlers/
├── models/
├── services/
├── tests/
├── utils/
├── main.go
├── go.mod
├── go.sum
└── README.md
API Endpoints
Users
POST   /users
GET    /users
GET    /users/:id
DELETE /users/:id
Products
POST   /products
GET    /products
GET    /products/:id
GET    /products/category/:categoryID
PUT    /products
DELETE /products/:id
Categories
POST   /categories
GET    /categories
GET    /categories/:id
PUT    /categories
DELETE /categories/:id
Orders
POST   /orders
GET    /orders
GET    /orders/:id
PUT    /orders/:id/status
PUT    /orders/:id/assign
PUT    /orders/:id/chat
GET    /orders/:id/chat
DELETE /orders/:id
How to Run

Install dependencies:

go mod tidy

Run the server:

go run main.go

The API runs on:

http://localhost:8080
How to Run Tests
go test ./...
What I Practiced
Designing REST API routes
Separating handlers, services and models
Implementing CRUD operations
Working with in-memory storage
Adding business logic for orders and couriers
Writing unit tests
Structuring a Go backend project
Status

Academic backend project focused on Go, REST API design, CRUD operations, service-layer architecture and unit testing.

About

Go/Gin REST API with users, products, categories, orders, courier assignment, chat messages and unit tests.

Topics

Resources

Stars

Watchers

Forks

Contributors