This is the backend part of Linkr: A simple link-sharing social network.
Here you can find the respective repository for the front end application: Linkr.
-
Fork or clone repository
-
Create a postgreSQL database
-
Import database information via ./dump.sql file
-
Configure the .env file as the .env.exemple:
PORT: port number (default is 5000)
DATABASE_URL: postgres connection string
JWT_SECRET: JWT secret key
- Install libraries
npm i
- To start the application, on development mode:
npm run dev
- Or if you want to run the application on production mode:
npm start
The api will be available at http://localhost:5000.
Category | HTTP Verbs | Private | Endpoints | Action |
---|---|---|---|---|
Auth | POST | /signup | To sign up a new user account | |
Auth | POST | /signin | To login an existing user account | |
User | GET | ✓ | /user/:id | To retrieve posts of a single user |
User | GET | ✓ | /followers/user | To retrieve all users followers |
User | GET | ✓ | /search/:name | To retrieve a search list |
User | POST | ✓ | /follow | To follow a single user |
User | POST | ✓ | /unfollow | To unfollow a single user |
User | GET | ✓ | /verifyFollowers | To retrieve followerers verification |
Post | GET | ✓ | /timeline | To retrieve all posts of followed ones |
Post | POST | ✓ | /posts | To create a single post |
Post | POST | ✓ | /posts/like | To like a single post |
Post | POST | ✓ | /posts/dislike | To dislike a single post |
Post | PUT | ✓ | /posts/:id | To edit a single post |
Post | DELETE | ✓ | /posts/:id | To delete a single post |
Share | POST | ✓ | /share/:postId | To create a single post share |
Share | DELETE | ✓ | /share/:postId | To delete a single post share |
Hashtag | GET | ✓ | /trends | To retrieve a hashtag rank list |
Hashtag | GET | ✓ | /hashtag/:hashtag | To retrieve a single hashtag |
Comment | POST | ✓ | /comment/:postId | To create a single comment |