This is a Go authentication project. It uses various packages and modules to provide a complete authentication solution.
The project has the following directory and file structure:
.gitignore
cmd/
main.go
config/
config.go
controllers/
auth_controller.go
docker-compose.yml
Dockerfile
go.mod
go.sum
middleware/
jwt_middleware.go
models/
user.go
repository/
user_repository.go
services/
auth_service.go
utils/
port.go
validations.go
This project uses several dependencies, including:
github.com/golang-jwt/jwt/v4for JWT token generation and validation.github.com/labstack/echo/v4for HTTP request handling and routing.gorm.io/gormfor data persistence and database operations.github.com/mattn/go-sqlite3for SQLite database support.
You can see all the dependencies in the go.sum file.
To run this project, follow these steps:
- Make sure you have Go and Docker installed on your machine.
- Clone this repository.
- Navigate to the project directory.
Build and run the project using Docker Compose:
docker-compose up --buildInstall the dependencies:
go get -u ./...Update the dependencies:
go mod tidyRun the project:
go run cmd/main.goTo run the tests for this project, follow these steps:
- Make sure you have Go installed on your machine.
- Navigate to the project directory.
- Run the tests using the following command:
go test ./...If you want to contribute to this project, please fork the repository, make your changes, and then submit a pull request.
This project is licensed under the terms of the MIT license.