Greenlight is a REST API for movies built with Go, following the "Let's Go Further" book by Alex Edwards.
Greenlight is a RESTful API that allows clients to create, read, update, and delete information about movies. It's built using modern Go practices and follows a clean architecture approach.
- RESTful API endpoints for movie management
- JSON response formatting
- Custom data validation
- Structured error handling
- PostgreSQL database integration (coming soon)
- Authentication and authorization (coming soon)
greenlight/
├── bin/ # Compiled application binaries
├── cmd/ # Application-specific code
│ └── api/ # API application
├── internal/ # Private application code
│ └── data/ # Data access layer
├── migrations/ # SQL migrations
└── remote/ # Configuration for deployment
| Method | URL Pattern | Handler | Action |
|---|---|---|---|
| GET | /v1/healthcheck | healthcheckHandler | Show application information |
| POST | /v1/movies | createMovieHandler | Create a new movie |
| GET | /v1/movies/:id | showMovieHandler | Show details of a movie |
- Go 1.24 or higher
# Run the API with default settings (port 4000)
go run ./cmd/api
# Run on a different port
go run ./cmd/api -port=5000
# Run in a specific environment
go run ./cmd/api -env=production- Basic API structure
- JSON response handling
- Router configuration
- Custom data types (Runtime)
- Data validation
- Database integration
- Authentication
This project is licensed under the MIT License - see the LICENSE file for details.
This project is based on the "Let's Go Further" book by Alex Edwards.