/FriendStagram-API

Backend server for FriendStagram. Written with Javascript, Node.js & PSQL 🔥

Primary LanguageJavaScript

FriendStagram API


Backend server for FriendStagram. Written with Javascript, Node.js & Postgres.

Endpoints

Users

var users = 'routes/user-route.js';
GET /users //Returns all users & their posts
DELETE /users //Delete the user. Authenticated.
POST /users/login //Loging in. Return session token used for authentication
GET /users/logout //Deletes users session. Authenticated.
GET /users/logoffallothersessions //Deletes all other session tied to the account. Authenticated.
GET /users/:username //Return user info + posts about the specific user

Posts

var posts = 'routes/post-route.js';
GET /posts //Return all posts. Parameters available to sort,limit,offset and search
GET /posts/id/:id //Return info about post with specific id
POST /posts //Upload a post. Authenticated.
DELETE /posts //Ability to delete a post. Authenticated.

Following

var follows = 'routes/follow-routes.js';
GET /follow/getAllFollowing/:userId //Returns all users that this user follows
GET /follow/getAllFollowers/:userId //Returns all users that this user is followed by
POST /follow //Follow a user. Authenticated
DELETE /follow //Unfollows a user. Authenticated

Features

  • User sessions with JWT
  • Password hashing using BCrypt
  • Scalable
  • Image hosting using Cloudinary

Setup

  1. Install Docker at your machine.
  2. Pull the latest code
  3. Build a friendstagram into a docker image
make build
  1. Run
docker-compose -f docker-compose.yml up -d friendstagram