damms005 / sample-facebook-post-rest-api

A RESTful API that minimally mimics Facebook's post functionality.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sample Facebook Post API

Project Art This project aims to be a powerful RESTful implementation of the posts functionality of Facebook, with the major difference that this one is going to the moon ๐Ÿš€๐Ÿš€๐Ÿš€.

It is an ExpressJS-powered Node application backend (server). Hence, you will need a client tool to interact with it.

Setup

Please ensure to have the following set up and running:

  • Node.js >= v15.14.0
  • MySQL >= v8.0.25
  • Terminal or Command Line
  • Postman (to test our API with)
  • SendGrid (for quick, scalable and reliable means of sending emails)

Usage

  1. Create an account with SendGrid, then follow this guide to get your SendGrid API keys
  2. Create a database in MySQL
  3. Clone this repo and cd into the cloned folder
  4. Run cp .env.example .env from the terminal
  5. UPDATE all DATABASE_* field in .env with the appropriate MySQL database details
  6. Run npm run setup-database. This script creates the necessary database schema
  7. Run npm run dev on the terminal to start the app. The app URL will be displayed on the terminal (e.g. http://localhost:5000)
  8. Open Postman to interact with the app using the URL gotten in the step above.

API Documentation

Postman documentation version of the API is available here

Test

npm run test

About

A RESTful API that minimally mimics Facebook's post functionality.


Languages

Language:TypeScript 99.6%Language:Shell 0.4%