Overview
The Fiber Boilerplate is a go boilerplate built on top of the Fiber web framework. It offers a simple setup with many out-of-the-box features. Some of these features include basic authentication, role-based authorization, file uploads, UI customization with Tailwind, payment processing via PayPal, logging with file rotation, support for PostGres or MySQL databases with GORM V2, REST API authentication with JWT, Redis integration for cache and session management, hot reload with Air, and easy configuration settings via .env file. The boilerplate also includes setup for Docker and offers easy and almost zero downtime production deployment with a Makefile.
Features
- Basic Auth with Login, Register: Allows users to authenticate themselves with login and registration functionality.
- Email confirmation on Registration: Sends email confirmation to users upon successful registration.
- Role-based authorization using Casbin: Implements role-based authorization for controlling user access to various resources.
- File uploads: Allows users to upload files to the server.
- UI on Tailwind: Provides a customizable user interface with Tailwind CSS.
- Setup ready for VueJS integration: Enables smooth integration with the VueJS frontend framework.
- Laravel mix for UI: Enhances the UI development process by using Laravel Mix.
- Payment processing via PayPal: Integrates with PayPal for processing payments.
- Logging via Phuslu/Log with file rotation: Provides logging functionality with file rotation support.
- PostGres or MySQL with GORM V2: Supports both PostGres and MySQL databases using the GORM V2 library.
- REST API Authentication with JWT: Implements JWT-based authentication for REST APIs.
- APP and API Separation based on JWT Token: Separates application and API logic based on JWT tokens.
- REST-based basic auth: Provides basic authentication for REST APIs.
- Use of Redis for Cache and Session: Utilizes Redis for caching and session management.
- Hot Reload with Air: Enables hot reloading for faster development workflow.
- Flash Message based on cookies: Includes flash messaging functionality based on cookies.
- Easy Config Settings based on .env: Simplifies configuration settings using the .env file.
- Setup for Docker: Provides a Docker setup for easy deployment.
- Easy and Almost Zero Downtime Production Deployment with Makefile: Offers a Makefile for simplified and efficient production deployment.
Installation
To install the Fiber Boilerplate, follow these steps:
- Clone the repository:
git clone https://github.com/sujit-baniya/fiber-boilerplate.git
- Make sure you have installed Redis, MySQL or Postgres.
- Copy the
.env.sample
file to.env
. - Install Node.js to build the frontend.
- Run
npm install
andnpm run prod
to build the frontend. - Start the server and your application should be up and running.
Summary
The Fiber Boilerplate is a powerful go boilerplate built on top of the Fiber web framework. It offers a wide range of features including authentication, authorization, file uploads, UI customization, payment processing, logging, database integration, API authentication, cache management, and more. With easy installation steps and a Makefile for production deployment, the Fiber Boilerplate provides developers with a solid foundation to kickstart their projects and accelerate development productivity.