Giter Club home page Giter Club logo

nexus-rest-api's Introduction

nexus | REST API

This nexus REST API project is designed to be a comprehensive solution for a social media application, utilizing the power of Node.js, Express.js, and MongoDB. These technologies are known for their speed, scalability, and ease of use, making them a great choice for API development.

Our API will feature important functionalities, including user authentication, CRUD operations for posts, the ability to like and dislike posts, and the ability to follow and unfollow users. With these capabilities, users will have a seamless experience in using the API.

Let's get started!

Installation

First you have to clone the repository and install the dependencies:

   git clone https://github.com/naieem-bd/nexus-REST-API.git
   cd nexus-REST-API
   npm install

Environment

After cloning the project, you need to create a .env file in the project directory. You can copy the .env.example file and rename it to .env.

   cp .env.example .env

You may change the .env file according to your needs. To change the .env file, open it with a text editor and change the values of the variables.

Features

  • User authentication
  • CRUD operations for posts
  • Liking / disliking posts
  • Following / unfollowing users
  • Timeline posts
  • And many more

Routes

There are 3 different routes-

Authentication routes

HTTP Method Resource URI Description
POST http://localhost:2727/api/auth/register Register a new user
POST http://localhost:2727/api/auth/login User login

Users routes

HTTP Method Resource URI Description
PUT http://localhost:2727/api/users/:id Update a user
DELETE http://localhost:2727/api/users/:id Delete a user
GET http://localhost:2727/api/users/:id Get a user
PUT http://localhost:2727/api/users/:id Follow a user
PUT http://localhost:2727/api/users/:id Unfollow a user

Posts routes

HTTP Method Resource URI Description
POST http://localhost:2727/api/posts/ Create a post
PUT http://localhost:2727/api/posts/:id Update a post
PUT http://localhost:2727/api/posts/:id/like Like or dislike a post
GET http://localhost:2727/api/posts/:id Get a post
GET http://localhost:2727/api/posts/timeline/:userId Get all timeline posts (own post and followings post)
GET http://localhost:2727/api/posts/profile/:username Get a user's all posts

This 'postman_collection.json' file is available in the root folder.

Acknowledgements

nexus-rest-api's People

Contributors

naieem-bd avatar

Stargazers

Arif Aslam avatar Shatabdi Sharma avatar Arman Hossain avatar Mahmoud M.Abdelwahab avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.