Gorest

screenshot of Gorest

Go RESTful API starter kit with Gin, JWT, GORM (MySQL, PostgreSQL, SQLite), Redis, Mongo, 2FA, email verification, password recovery

Overview

gorest is a starter kit written in Golang with the Gin framework. It is designed for rapid prototyping and developing RESTful APIs. The source code is released under the MIT license and can be used for personal or commercial projects. The current version is 1.6.x, which includes breaking changes.

Features

  • Built on top of Gin: gorest is built using the Gin framework, providing a robust foundation for developing RESTful APIs.
  • Encryption at rest: Users have the option to enable encryption for storing private user information securely.
  • Easy database integration: gorest supports multiple databases (MySQL, PostgreSQL, SQLite3, Redis, MongoDB) without requiring additional configuration files.
  • Environment variables using GoDotEnv: gorest allows the use of environment variables for easy configuration using GoDotEnv.
  • CORS policy: Cross-Origin Resource Sharing (CORS) policy is implemented to control access to resources from different origins.
  • Authentication: gorest supports basic authentication and two-factor authentication for enhanced security.
  • JWT (JSON Web Tokens): gorest uses the golang-jwt/jwt library for implementing JWT-based authentication.
  • Password hashing: User passwords are securely hashed using Argon2id, with the option to use a secret for added security.
  • JSON protection: gorest protects JSON data from hijacking to ensure data integrity.
  • Simple firewall: A simple firewall is implemented with options to whitelist/blacklist IP addresses for added security.
  • Email validation and verification: gorest includes support for email validation and verification, including pattern matching and MX lookup.
  • Forgotten password recovery: Users can recover forgotten passwords through a secure recovery process.
  • HTML template rendering: gorest supports rendering HTML templates for building user interfaces.
  • Error logging and crash reporting: Error logs and crash reports can be forwarded to sentry.io for easy monitoring and debugging.
  • Token handling: gorest provides functions for handling authentication tokens on client devices' cookies.
  • Logout: Users can logout with the option to delete tokens from cookies and ban active tokens for improved security.
  • Easy to learn and use: gorest is designed to be easy to learn and use, with lots of example code provided.

Summary

gorest is a powerful and flexible starter kit built in Golang with the Gin framework for developing RESTful APIs. It offers a wide range of features, including authentication, encryption, database integration, and more. With its easy installation process and extensive documentation, gorest provides developers with a solid foundation for building scalable and secure APIs.