Skip to content

BizzBuzz API, a makeshift social media application that allows user to create long post messages.

Notifications You must be signed in to change notification settings

Aliemeka/bizzbuzz-api

Repository files navigation

bizzbuzz-api

BizzBuzz API, a makeshift social media application that allows user to create long post messages.

Endpoint documentation

BizzBuzz API Documentation on Postman

Set up

  1. Clone the project in your local computer
  2. Enter npm install or yarn start to install all dependencies
  3. Terminal/CLI command: npm run setup:env to create .env file based on the .env.example file. This command creates the file along with error message in Windows, Linux or MacOS printed command prompt, bash or terminal. This is fine it is due to the command used, one tries for Windows if fails it try for Linux/Mac.
  4. You to ensure you have all listed environment variables. Check config.js to see the required node.js server
  5. Run npm run dev on your terminal or command line interface to run the server in developement mode.
  6. Start the server with npm start

Dependencies

Main dependencies

Express.js for api server
mongoose - Mongodb ORM for crud operations
jsonwebtoken to create authorization tokens
bcrypt for hashing passwords and tokens
SendGrid Mail for sending emails
dotenv for parsing envvironment variables
Cloudinary Node.js SDK

Dev dependencies

Nodeemon monitoring script of node.js development

Routes

Auth routes /auth

  • POST /auth/register to register a new user
  • POST /auth/login logins a new user
  • POST /auth/change-password changes user password*
  • POST /auth/reset-password request a password resets*
  • POST /auth/confirm-reset?token={{token}}&id={{id}} resets to new password*

Posts routes /posts

  • GET /posts gets all post
  • POST /posts adds a new post*
  • GET /posts/{postId} gets a post*
  • PUT /posts/{postId} updates a post* **
  • DELETE /posts/{postId} deletes a post* **

Post likes routes

  • GET /posts/{postId}/like add or remove like* **
  • GET /posts/{postId}/likes gets all likes on a post*

Post replies routes /posts/{postId}/replies

  • GET /posts/{postId}/replies gets all post replies*
  • POST /posts/{postId}/replies adds a reply to a post*
  • GET /posts/{postId}/replies/{replyId} gets a post reply*
  • PUT /posts/{postId}/replies/{replyId} edits a reply on a post* **
  • DELETE /posts/{postId}/replies/{replyId} deletes a reply on a post* **

* requires jwt token on Authorization header of request
** requires that user is the author of post/like/reply

Contribution

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
  2. Update the README.md with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters.
  3. Make all pull requests of new features to the develop branch so it can be project

About

BizzBuzz API, a makeshift social media application that allows user to create long post messages.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published