Backend for Codex - novel reading platform.
Codex-Backend is built in GoLang, using Gin for server and AWS-dynamoDB firestore (moving to Heroku Postgres) PostgreSQL for database.
It is deployed on Heroku (thats why the code is in api directory).
Deployed on personal server in Docker.
run server:
GIN_MODE=debug go run api/cmd/web/main.goGIN_MODE=debug go run api/cmd/worker/main.goBoth are needed
5 Groups of endpoints: Client, Manage, User, Validate and Health.
- Client is responsible for basic GET requests.
- Manage is responsible for Upload/Modification/Delete operations.
- User is responsible for user authentication, authorization and Registration (Delete is not yet implemented).
- Validate is responsible for validating user tokens.
- Health is responsible for checking the health of the server.
- GET
/all- Get all novels - GET
/:novel- Get a novel by id - GET
/:novel/:chapter- Get chapter from novel using both ids - GET
/:novel/all- Get all chapters from novel using id - GET
/:novel/chapter- Get cursor paginated chapters from novel using id
Pagination querries:
?limit=100- Limit the number of results returned, Max = 200, Min = 1?cursor=""- Encoded offset, will be handled automatically?sort="asc"- Sort order, asc or desc
-
POST
/epubCreate Novel/Chapters from epub file. -
POST
/create/novelCreate Novel -
POST
/create/chapterCreate Chapter -
PUT
/update/novel- Update novel -
PUT
/update/chapter- Update chapter -
DELETE
/delete/novel- Delete novel -
DELETE
/delete/chapter- Delete chapter
- POST
/login- Login user - POST
/logout- Logout user - POST
/register- Register user
- GET
/- Validate user token
- GET
/- Check health of server For now this does nothing, but will be used to check the health of Docker image.