A social media Backend API which follows a RESTful architecture, it has the following features:-
User signup/login
: User can Signup using an email and a password, a refresh token and an authentication token is returned, which then can be used for login, an authrntication token expires in one hour ie one session is one hour long, another authentication token can be generated using the refresh token whiich lasts 60 days, the refresh token can be revoked upon users request.prose creation and profane
: users can create and access posts in the form ofprose
, it also provide features likeprofane
which allows certain words to be muted.Prose can be deleted as well.Data Storage
: passwords are stored using JWT based encryption, users are given a unique uuid for identification. Data is stored on a production ready database ie postgreSQL.admin tasks
: allows viewing the heath and basic metrics for the api using REST endpoints.Deployment
: The backend is deployed on an AWS EC2 instance , the postgreSQL database is deployed using AWS RDS instance.CI/CD
: A continuous integration and continuous delivery/deployment is set up using github actions, the ci workflow checks for the linting, formatting and security while the cd workflow, builds the code, dockerizes it, creates database migrations and finally deploys the image on the ec2 instance.
(currently not hosted due to free plan limitations)
http://13.201.15.193/app
http://13.201.15.193/api
-
-
Description: Create a new user account.
Request Body:
{ "Name": "name", "Password": "password", "Email": "email" }
Response:
{ "id": "UUID", "email": "string", "name": "string", "is_gold": "bool" }
Status Code: 201 Created
-
Description: Authenticate a user and generate access and refresh tokens.
Request Body:
{ "password": "string", "email": "string" }
Response:
{ "Email": "email", "Token": "Token", "Refresh_token": "Refresh_token" }
Status Code: 200 OK
-
Description: Refresh the access token using the refresh token.
Request Body:
Header:
Bearer "refresh_token"
Response:
{ "Token": "auth_token" }
Status Code: 200 OK
-
Description: Revoke the refresh token.
Request Body:
Header:
Bearer "reresh_token"
Response:
"Token Revoked"
Status Code: 204 No Content
-
Description: Update user account information.
Request Body:
Header :
Bearer "auth_token"
{ "Name": "name", "Password": "password", "Email": "email" }
Response:
{ "id": "", "email": "string", "name": "string", "is_gold": "" }
Status Code: 200 OK
-
-
-
Description: Create a new prose (post).
Request Body: Header:
Bearer "auth_token"
{ "Body":"body" }
Response:
{ "ID": "uuid", "Body": "string", "Created_at":"time", "Updated_at":"time" }
Status Code: 201 Created
-
Description: Get a list of prose.
Request Body:
Header:
Bearer "auth_token"
Response:
[ { "ID": "uuid" "Body": "string" "CreatedAt": "time" "UpdatedAt": "time" }, ]
Status Code: 200 OK
-
Description: Get details of a prose by its ID.
Request Body:
Header:
Bearer "auth_token"
Response:
{ "ID": "uuid" "Body": "string" "CreatedAt": "time" "UpdatedAt": "time" }
Status Code: 200 OK
-
Description: Delete a prose by its ID.
Request Body:
Header:
Bearer "auth_token"
Response:
" Prose Deleted"
Status Code: 204 No Content
-
Description: Check the health status of the API.
-
-
http://13.201.15.193/admin
- Description: Retrieve server metrics.