In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner for REST api tests.
create a database:
CREATE DATABASE database_nameadd tables for the database: Script for creating database tables;
Required environment variables:
TOKEN_KEY = "json webtoken key"
DB_NAME = "database_name"
DB_USERNAME = "username"
DB_PASSWORD = "password"| Dark Mode | Light mode |
|---|---|
![]() |
![]() |
Signup page
Login page
Home page
Profile page
Editing profile
User search
| End point | HTTP Method | Description | Parameters | Response |
| /signup | POST | Used for creating an account |
{
"username": "",
"email": "",
"password": ""
} |
{
"accessToken": "",
"username": "",
"user_id": ""
} |
| /login | POST | Used for logging in and receiving a jsonwebtoken |
{
"email": "",
"password": ""
} |
{
"accessToken": "",
"username": "",
"user_id": ""
} |
| /post?post_id= | GET | Used for retrieving a single post |
Header: authorization Query: post_id |
{
"post": {
"user_id": "",
"post_id": "",
"content": "",
"reply_to": "",
"created": "",
"username": "",
"profile_img": "",
"total_likes": "",
"user_like_status": "",
"reply_count": ""
}
} |
| /post | POST | Used for creating a new post |
Header: authorization Body: {
"content": "",
"reply_to": ""
} |
|
| /delete/post?post_id= | DELETE | Used to delete posts |
Header: authorization Query: post_id |
|
| /posts | GET | Used for retrieving posts from followed users for homepage | Header: authorization |
{
"posts": [
{
"user_id": "",
"post_id": "",
"content": "",
"reply_to": "",
"created": "",
"username": "",
"profile_img": "",
"total_likes": "",
"user_like_status": "",
"reply_count": ""
}
]
} |
| /user/posts?username= | GET | Used for retrieving posts from followed users for homepage |
Header: authorization Query: post_id |
{
"posts": [
{
"user_id": "",
"post_id": "",
"content": "",
"reply_to": "",
"created": "",
"username": "",
"profile_img": "",
"total_likes": "",
"user_like_status": "",
"reply_count": ""
}
]
} |
| /replies?post_id= | GET | Used for retrieving replies for a post |
Header: authorization Query: post_id |
{
"posts": [
{
"user_id": "",
"post_id": "",
"content": "",
"reply_to": "",
"created": "",
"username": "",
"profile_img": "",
"total_likes": "",
"user_like_status": "",
"reply_count": ""
}
]
} |
| /users?username= | GET | Retrieves users matching search parameter |
Header: authorization Query: username |
{
"users": [
{
"user_id": "",
"username": "",
"profile_img": "",
"user_follow_status": ""
}
]
} |
| /like | POST | Used to like a post |
Header: authorization Body: {
"post_id": ""
} |
{
"total_likes": "",
"user_like_status": ""
} |
| /account?username= | GET | Used to load profile data of a single user |
Header: authorization Query: username |
{
"following": "",
"followers": "",
"posts": "",
"isFollowing": "",
"user": {
"username": "",
"bio": "",
"profile_img": "",
"user_id": ""
}
} |
| /user/followers?username= | GET | Used to load followers of a user |
Header: authorization Query: username |
{
"followers": [
{
"username": "",
"profile_img": "",
"user_id": "",
"user_follow_status": ""
}
]
} |
| /user/follows?username= | GET | Used to load users that an account follows |
Header: authorization Query: username |
{
"follows": [
{
"username": "",
"profile_img": "",
"user_id": "",
"user_follow_status": ""
}
]
} |
| /user/follow | POST | Used to follow or to unfollow a user |
Header: authorization Body: {
"user_id": "",
"follow": "true/false"
} |
{
"user_like_status": ""
} |
| /profile_img | GET | Used to get the profile image address of the logged in user | Header: authorization |
{
"profile_img": "URL"
} |
| /upload/profile_img | POST | Used to upload a profile image |
Header: authorization Body: {
"image": "base64 image"
} |
|
| /images?url= | GET | Used to retrieve images from the server | Query: url(filename) | File: image |







