This is a backend development app that utilizes JSON Web Tokens (JWT) for authentication. It provides an API that allows clients to authenticate and access protected resources.
- Prerequisites
- Installation
- Usage
- API Endpoints
- Architecture Layers
- Linting and Code Quality
- Contributing
- License
Before running this application, ensure that you have the following prerequisites installed:
- Go: Install Go
- Docker: Install Docker
- Docker Compose: Install Docker Compose
- Clone this repository
git clone https://github.com/kemalkochekov/JWT-Backend-Application.git
- Navigate to the project directory:
cd JWT-Backend-Application
- Build the Docker image:
docker-compose build
- Start the Docker containers:
docker-compose up
- The application will be accessible at:
localhost:8080
The following API endpoints are available:
- POST http://localhost:8080/users/signup
- POST http://localhost:8080/users/login
- GET http://localhost:8080/logout
- GET http://localhost:8080/users
- GET http://localhost:8080/admin
For detailed API documentation, including examples, request/response structures, and authentication details, please refer to the
![View API Doc Button](https://private-user-images.githubusercontent.com/85355663/288228565-0c231cef-ee76-4cdf-bc41-e900845da493.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1NjEyMTEsIm5iZiI6MTcyNDU2MDkxMSwicGF0aCI6Ii84NTM1NTY2My8yODgyMjg1NjUtMGMyMzFjZWYtZWU3Ni00Y2RmLWJjNDEtZTkwMDg0NWRhNDkzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI1VDA0NDE1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI1YzBkMTQ2MTE0Yzc3MTNjMThhNGZiZjk2NDdjZDk4YjMyMjYwNTRhMTE2MjdkZGY2ODFkZGJjYjU1MzM5YmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.i0HoCMf0XFTLdMobzgEaj-llnu-LqY9tC_6R75O29GE)
I've designed a structured Go (Golang) backend architecture using Fiber, PostgreSQL, Redis, JWT auth middleware, and Docker, ensuring a robust and organized system.
This project maintains code quality using golangci-lint
, a fast and customizable Go linter. golangci-lint
checks for various issues, ensures code consistency, and enforces best practices, helping maintain a clean and standardized codebase.
To install golangci-lint
, you can use brew
:
brew install golangci-lint
- Configuration:
After installing golangci-lint, create or use a personal configuration file (e.g., .golangci.yml) to define specific linting rules and settings:
golangci-lint run --config=.golangci.yml
This command initializes linting based on the specified configuration file.
- Run the linter:
Once configuration is completed, you can execute the following command at the root directory of your project to run golangci-lint:
golangci-lint run
This command performs linting checks on your entire project and provides a detailed report highlighting any issues or violations found.
- Customize Linting Rules:
You can customize the linting rules by modifying the .golangci.yml
file.
For more information on using golangci-lint, refer to the golangci-lint documentation.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request. Ensure that you follow the existing code style and conventions.
This project is licensed under the MIT License.