Sign inSign up

ifedayoawe/greenlight

By ifedayoawe

•Updated over 3 years ago

JSON API for creating, retrieving and managing information about movies and users of the API.

Image
0

958

ifedayoawe/greenlight repository overview

⁠greenlight

A fully featured JSON API for creating, retrieving and managing information about movies and users of the API.

⁠Description

A fast, secure, efficient, scalable and maintainable API server using Golang, a PostgreSQL database with migration files to make writing SQL migration easier. The idea behind this project is using dependency injection to implement efficient functions, using middleware and chaining handlers, taking into consideration best practices.The project is designed as intended for usage in a production environment and a github link is provided. Greenlight-github ⁠

⁠Features

  • Health check: Shows environment, availablility status and application version
  • User Registration: Automatic Movie Read Permissions and Default Profile Picture
  • User Account Activation (Sends Token To Email)
  • Create User Authentication/Login Token
  • User Change Password
  • Create User Reset Password Token (Sends Token To Email)
  • User Reset Password
  • Update User Details: Name, Email
  • User Update Profile Picture
  • Get User Details: Name, Email, Profile Picture Image-Path.
  • Serving User Profile Picture
  • User Logout
  • Delete User Account
  • List All Movies (Authenticated Users)
  • Get A Specific Movie With It's ID (Authenticated Users)
  • Add Movie Write Permissions For a User by an Admin
  • Create A New Movie By Users With Movie Write Permissions
  • Update A Movie
  • Delete A Movie
  • Search For Movies Using Specific Query Parameters
  • Dynamic Sorting For Movies Returned From The Database
  • Dynamic Pagination For Movies Data
  • Returning Movies Metadate (Current Page, Page Size, Total Pages, Total Records) with Movie Object
  • Request and Error Logging Using A Custom JSON Logger
  • Unit and Integration tests
  • Creating a Request Rate Limiter using users IP (Burst:4, r/s:2)
  • Recover Panic
  • Graceful Shutdown Of Application
  • Configurable Request Origin Using Command line Flags
  • Displaying Application Metrics

⁠Usage

To pull the docker image docker pull ifedayoawe/greenlight:latest which will automatically pull the latest image. The default application port is 4000, an easy way would be to use my greenlight.yaml docker-compose file to automate the process, of course a .env file containing the DBPASS, DBNAME, SMTP_USERNAME, SMTP_PASSWORD, SMTP_SENDER, SMTP_HOST and GREENLIGHT_DB_DSN environmental variables would be needed and also executing the SQL migration files to create the necessary tables would be needed check my github link.

⁠Known Bugs

There are no known issues.

Test code coverage is around 62.6%.

Tag summary

Content type

Image

Digest

sha256:a1943e12f…

Size

8 MB

Last updated

over 3 years ago

docker pull ifedayoawe/greenlight