A sleek and efficient Go backend application for managing movies, powered by PostgreSQL and designed for seamless development experience.
- 🚀 Fast Development: Utilizes
fresh
for automatic server reloading - 🗃️ Robust Database: Seamless PostgreSQL integration
- 🔧 CRUD Operations: Complete movie management functionality
- 🐳 Docker Support: Easy containerization and local development
Before you begin, ensure you have the following installed:
- Docker 🐳 - For containerizing the PostgreSQL database
- Go 🟢 - Programming language runtime
- Fresh 🔄 - Development server with auto-restart capability
git clone https://github.com/tundx0/go-movies-backend.git
cd go-movies-backend
Use Docker Compose to spin up the database:
docker-compose up -d
go mod tidy
go install github.com/gravityblast/fresh@latest
Edit the database connection settings in ./cmd/api/main.go
if needed. Default configuration supports local PostgreSQL setup.
fresh -c ./cmd/api/fresh.conf
The server will be available at:
http://localhost:8080
Explore the various endpoints for movie management:
GET /movies
- Retrieve all moviesGET /movies/{id}
- Get a specific moviePOST /movies
- Create a new moviePUT /movies/{id}
- Update an existing movieDELETE /movies/{id}
- Remove a movie
To stop the application and remove the PostgreSQL container:
docker-compose down