This authentication service is built using Golang with the Fiber framework, utilizing GORM as the ORM, and MariaDB as the primary database.
- User registration
- User login with JWT
- Authentication middleware
- Refresh token
- User management
Ensure you have installed:
- Clone the repository:
git clone https://github.com/nurefendi/auth-service.git cd auth-service
- Create a
.local.env
or.production.env
file and add the database configuration:DB_USER=root DB_PASSWORD=yourpassword DB_HOST=localhost DB_PORT=3306 DB_NAME=auth_db JWT_SECRET=your_secret_key
- Run MariaDB database:
docker run --name mariadb -e MYSQL_ROOT_PASSWORD=yourpassword -e MYSQL_DATABASE=auth_db -p 3306:3306 -d mariadb
- Install dependencies:
go mod tidy
- Run database migrations:
go run main.go migrate
- Start the application:
go run main.go
This project is licensed under the MIT License.