Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antnzr/chat-go
Some golang stuff
https://github.com/antnzr/chat-go
bash docker gin github-actions golang jwt-authentication makefile postgresql rest-api swagger
Last synced: 4 days ago
JSON representation
Some golang stuff
- Host: GitHub
- URL: https://github.com/antnzr/chat-go
- Owner: antnzr
- Created: 2023-03-08T17:32:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-05-01T15:21:08.000Z (over 1 year ago)
- Last Synced: 2024-06-21T04:52:31.679Z (5 months ago)
- Topics: bash, docker, gin, github-actions, golang, jwt-authentication, makefile, postgresql, rest-api, swagger
- Language: Go
- Homepage:
- Size: 6.94 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
## The App
| RESOURCE | HTTP METHOD | ROUTE | DESCRIPTION |
| -------- | ----------- | ------------------------------ | ------------------------ |
| auth | POST | /api/v1/auth/signup | Register a new user |
| auth | POST | /api/v1/auth/login | Login user |
| auth | GET | /api/v1/auth/refresh | Request a new token pair |
| auth | GET | /api/v1/auth/logout | Logout user |
| users | GET | /api/v1/users/me | Get me |
| users | GET | /api/v1/users/:id | Find user by id |
| users | GET | /api/v1/users | Find users |
| users | PATCH | /api/v1/users | Update user |
| users | DELETE | /api/v1/users | Delete user |
| chats | GET | /api/v1/chats | Find my chats |
| chats | GET | /api/v1/chats/:chatId/messages | Find chat's messages |
| | | /swagger/index.html | Api docs |#### TOOLS:
- golang 1.20
- gin
- gorilla/websocket
- postgres, pgx
- zap logging
- nginx (local ssl setup with minica)
- gin-swagger [docs](https://home.domain/swagger/index.html)#### Generate rsa key for jwt, and paste them to .env or use a script in a `scripts` dir
```sh
ssh-keygen -t rsa -b 4096 -m PEM -f access_jwtRS256.key \
openssl rsa -in access_jwtRS256.key -pubout -outform PEM -out access_jwtRS256.key.pub \
base64 -w 0 access_jwtRS256.key \
base64 -w 0 access_jwtRS256.key.pub \
``````sh
ssh-keygen -t rsa -b 4096 -m PEM -f refresh_jwtRS256.key \
openssl rsa -in refresh_jwtRS256.key -pubout -outform PEM -out refresh_jwtRS256.key.pub \
base64 -w 0 refresh_jwtRS256.key \
base64 -w 0 refresh_jwtRS256.key.pub \
```