Skip to content

A RESTful Workout Management API built in Go with Docker and PostgreSQL. Features user authentication, full CRUD, clean architecture, and unit testing.

Notifications You must be signed in to change notification settings

matiasalek/go-http

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏋️ Workout Management API – Golang, PostgreSQL & Docker

A clean and scalable RESTful API built in Go for managing workouts. This project was developed as part of the Frontend Masters – Complete Go for Professional Developers course.

🚀 Features

  • Full CRUD for workouts (Create, Read, Update, Delete)
  • User registration & login with password hashing
  • Auth-protected routes using middleware
  • PostgreSQL integration (Dockerized)
  • Modular architecture with interfaces and dependency injection
  • Unit testing for core business logic

📦 Tech Stack

  • Go 1.22+
  • PostgreSQL
  • Docker / Docker Compose
  • Chi Router
  • bcrypt

🛠️ Getting Started

1. Clone the repository

git clone https://github.com/matiasalek/go-http.git
cd go-http

2. Run the app using Docker Compose

docker-compose up --build

This will start:

The Go backend on http://localhost:8000

A PostgreSQL container on port 5432

3. 📡 API Endpoints

Base URL: http://localhost:4000/api

POST /register – Register a new user

POST /login – Login and receive session

GET /workouts – List workouts

POST /workouts – Create new workout

PUT /workouts/{id} – Update workout

DELETE /workouts/{id} – Delete workout

🔐 Protected routes require a valid session cookie.

4. ✅ Running Tests

go test ./...

About

A RESTful Workout Management API built in Go with Docker and PostgreSQL. Features user authentication, full CRUD, clean architecture, and unit testing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages