This project, named GopherGate, is a powerful RESTful API built using the Go programming language. It seamlessly integrates with MySQL, offering robust database capabilities for your application.
View Demo
.
Report Bug
.
Request Feature
- User Creation: Allows the creation of new users with unique email addresses.
- User Authentication: Provides user authentication using email and password.
- User Retrieval: Supports retrieving all users based on their roles, and fetching individual users by their IDs.
- User Update: Enables updating user information, restricted to administrator users.
- User Deletion: Allows deletion of users, restricted to administrator users.
To install and run the GopherGate User Management API, follow these steps:
- Clone the repository:
git clone https://github.com/ebekirbayar/GopherGate-Go-RESTful-API-with-JWT-and-MySQL.git
cd GopherGate-Go-RESTful-API-with-JWT-and-MySQL
go mod tidy
go run main.go
- POST /api/auth/register: Create a new user.
- POST /api/auth/login: Authenticate a user.
- GET /api/users: Retrieve all users based on user roles.
- GET /api/users/me: Retrieve a specific user by ID.
- PUT /api/users/{id}: Update user information.
- DELETE /api/users/{id}: Delete a user.
POST /api/auth/register
Content-Type: application/json
{
"userEmail": "[email protected]",
"userName": "gopher_gate",
"userPassword": "123456789"
}
POST /api/auth/login
Content-Type: application/json
{
"userEmail": "[email protected]",
"userPassword": "123456789"
}
GET /api/users
Authorization: Bearer your_jwt_token
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request after you edit the README.md file with necessary changes.
- Please make sure you check your spelling and grammar.
- Create individual PR for each suggestion.
- Please also read through the Code Of Conduct before posting your first idea as well.
- Thank you for considering contributing to GopherGate: Go RESTful API with JWT and MySQL! Follow the steps below to contribute:
-
Fork the Project: Click the "Fork" button in the top-right corner of the GitHub repository page to create a copy of the project in your GitHub account.
-
Create your Feature Branch: Open a terminal or command prompt and navigate to the directory where you want to clone the repository. Then, run the following command to create a new feature branch:
git checkout -b feature/YourAmazingFeature
Replace "YourAmazingFeature" with a descriptive name for your feature or the issue you're addressing.
- Commit your Changes: Make your desired changes to the project files. After making changes, stage them for commit using the following command:
git add .
Then, commit your changes with a descriptive message:
git commit -m 'Add some AmazingFeature'
Replace "Add some AmazingFeature" with a brief description of the changes you've made.
- Push to the Branch: Once your changes are committed, push your changes to your forked repository on GitHub:
git push origin feature/YourAmazingFeature
This will push your feature branch to your forked repository.
- Open a Pull Request: Go to the GopherGate: Go RESTful API with JWT and MySQL repository on GitHub and switch to the branch you just pushed. Click the "New Pull Request" button to open a new pull request. Provide a descriptive title and detailed description of your changes in the pull request.
That's it! Your pull request will be reviewed by the project maintainers, and any necessary feedback or changes will be discussed there.
Thank you for contributing to GopherGate: Go RESTful API with JWT and MySQL!
Distributed under the MIT License. See LICENSE for more information.
- Ebubekir BAYAR - Computer Engineer - Ebubekir BAYAR