GreenLight is a robust JSON API for retrieving and managing information about movies. This project was built following the guidance provided in Alex Edwards' book "Let's Go Further" on building REST APIs in Golang.
- Retrieve a list of movies with details such as title, description, release year, and genre
- Create, update, and delete movie records
- Search and filter movies based on various criteria
- Pagination support for efficient data retrieval
- Authentication and authorization for secure access to the API
- Go: The programming language used for the backend development
- PostgreSQL: The relational database management system used to store movie data
- Docker: Used to containerize the application and the database
- GitHub Actions: Utilized for continuous integration and deployment (CI/CD) workflows
- Gin Web Framework: A fast and lightweight web framework used for building the REST API
- GORM: An Object-Relational Mapping (ORM) library used for interacting with the database
- JWT: JSON Web Tokens used for authentication and authorization
- Go (version 1.16 or higher)
- Docker
- PostgreSQL (optional, if not using Docker)
- Clone the repository:
git clone https://github.com/your-username/GreenLight.git
- Change into the project directory:
cd GreenLight
- Build the Docker images:
docker-compose build
- Start the Docker containers:
docker-compose up -d
- The API will be available at
http://localhost:8000
.
The GreenLight API provides the following endpoints:
Method | Endpoint | Description |
---|---|---|
GET | /movies | Retrieve a list of movies |
POST | /movies | Create a new movie |
GET | /movies/{id} | Retrieve a specific movie |
PUT | /movies/{id} | Update a movie |
DELETE | /movies/{id} | Delete a movie |