The backend of a online forum, imitating Reddit
The code are constructed in such layer: Controller -> Logic -> DAO
- Sign Up
- Login(with JWT token)
- Get all community in the forum
- Create a post in a community
- Get post detail by its ID
- Get all the posts in the forum
- Get all the posts in a community
- Voting(implemented by Redis)
Go 1.20.4
Redis 7.0.11
MySQL 8.0.33
- Go to settings/config.yaml, modify the configuration as you need
redis-server
(orredis-server.exe
in Windows)go build -o main
./main
I use Postman to test the code.
-
In Postman, import the collection from
postman_json_template/bluebell.postman_collection.json
, then sign up. -
Except signup and login, every features in bluebell need user to login, so put the token inside your request
- Use refresh-token to get access-token