Skip to content

🎥 REST API built with go to handle movies infos

Notifications You must be signed in to change notification settings

jfilipedias/greenlight

Repository files navigation

Greelight

Greenlight is a REST API built with Go 1.23 to get movies informations. It was developed following the Let's Go Further book by Alex Edwards. It implements the following concepts:

  • Configuration management
  • Logging and error handling
  • SQL Database connection pool
  • Database migrations
  • Middlewares
  • Filtering, sort and pagination
  • IP based rate limiting
  • Graceful shutdown with OS signals
  • Email sending
  • Authentication and permission-based authorization
  • Cross Origin Requests
  • Reverse proxy with IP fowarding

Getting stated

Makefile

To help manage and execute the project, there's a Makefile with some actions available. To list the actions and it's description you can run the following command:

$ make help

Enviroment Variables

To run the make actions and adicional setups without any issue you must create a .env file based on the .env.example.

Docker Container

This project use a PostgreSQL database to data persistence. A docker-compose.yaml file is available to setup a simple postgres image. You can get and install the Docker tooling following the official documentation.

To pull the image and start the container you can run the following command:

$ docker compose up -d

Database Migrations

To run migrations related actions it's required install the migration tool e.g:

$ cd /tmp
$ curl -L /~https://github.com/golang-migrate/migrate/releases/download/v4.16.2/migrate.linux-amd64.tar.gz | tar xvz
$ mv migrate ~/go/bin/

Dependencies

About

🎥 REST API built with go to handle movies infos

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published