https://github.com/hixraid/blog
Blog REST API (Go, Gin, MySQL)
https://github.com/hixraid/blog
blog go jwt mysql rest-api
Last synced: 27 days ago
JSON representation
Blog REST API (Go, Gin, MySQL)
- Host: GitHub
- URL: https://github.com/hixraid/blog
- Owner: HixRaid
- License: mit
- Created: 2023-11-09T20:18:00.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-10T20:08:35.000Z (over 2 years ago)
- Last Synced: 2025-01-22T21:25:52.627Z (over 1 year ago)
- Topics: blog, go, jwt, mysql, rest-api
- Language: Go
- Homepage:
- Size: 81.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# 💬 Blog
Simple Go blog
## 📄 Routes
- /auth
- /sign-up `POST` SignUp
- /sign-in `POST` SignIn
- /api
- /users
- /:user_id `GET` GetUserById
- / `GET` GetAllUsers
- / `PUT` UpdateUserById 🧑 `auth`
- / `DELETE` DeleteUserById 🧑 `auth`
- /posts
- / `POST` CreatePost 👑 `auth / admin`
- / `GET` GetAllPosts
- /:post_id `GET` GetPostById
- /:post_id `PUT` UpdatePostById 👑 `auth / admin`
- /:post_id `DELETE` DeleteUserById 👑 `auth / admin`
- /:post_id/comments
- / `POST` CreateCommentByPostId 🧑 `auth`
- / `GET` GetCommentsByPostId
- /comments
- /:comment_id `PUT` UpdateCommentById 🧑 `auth`
- /:comment_id `DELETE` DeleteCommentById 🧑 `auth`
## 🛠️ Built with
- Go `1.21.4`
- MySQL `8.0.34`
## 📦 Libraries
| Name | Module | Version |
| :----- | :----------------------------------------------------------------------- | :------- |
| gin | [github.com/gin-gonic/gin](https://github.com/gin-gonic/gin) | `1.9.1` |
| jwt | [github.com/golang-jwt/jwt/v5](https://github.com/golang-jwt/jwt) | `5.1.0` |
| viper | [github.com/spf13/viper](https://github.com/spf13/viper) | `1.17.0` |
| logrus | [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) | `1.9.3` |
| sqlx | [github.com/jmoiron/sqlx](https://github.com/jmoiron/sqlx) | `1.3.5` |
| mysql | [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) | `1.7.1` |
| crypto | [golang.org/x/crypto](https://cs.opensource.google/go/x/crypto) | `0.15.0` |