This repository contains a simple API written in Go, designed to be reusable and easily integrated into multiple projects. The API is built with a focus on performance, scalability, and maintainability.
-
History
-
Roles
-
Permissions
-
Authentication
-
Users
-
Add 2FA and passKey, and add Google reCAPTCHA to all endpoints starting with /auth
-
Add testing
-
Add CI pipeline with GitHub actions(build image)
-
Make installed for shortcuts
-
Docker installed if you want to build and start postgres or redis containers
-
Build and start Redis container with the command
make docker-redis
-
Build and start postgres container with the command
make docker-postgres
-
Rename .env.example to
app.env
-
JWT .pem files with ES512(ECDSA SHA-512) algorithm:
./assets/private/keys/jwt/private.pem
./assets/private/keys/jwt/public.pem
You ca use this website to generate JWT keys for your tests JWT online generator -
Password is hashed using Argon2id algorithm. If you want to customize salinity, you can edit the .env.example file
Others information such configurations are on app.env
git clone https://github.com/4kpros/go-api.git
cd go-api/
The entry point of the project is cmd/
folder. In this folder the is the main.go
file.
make install
make build
make run
API docs with openAPI v3.1(latest) is on
/api/v1/docs
If you want to scan vulnerabilities(security issues)
make scan
You can choose between 4 templates: Scalar(Default), Redocly, Stoplight, Swagger.