/CommentOnEverything

Comment on Everything social media backend

Primary LanguageJavaScript


Logo

COE - Backend

Comment on Everything social media backend
Explore the API docs »

Frontend repo · Report Bug · Request Feature

Table of Contents

About The Project

Backend services for Comment on Everything social media

API Endpoint : https://comment-on-everything.herokuapp.com
API Documentation : https://documenter.getpostman.com/view/17936847/UVkjwJ2j

Built With

Getting Started

To get a local copy up and running follow these simple example steps.

Installation

  1. Clone the repo
git clone https://github.com/OferElfassi/CommentOnEverything.git
  1. Install NPM packages
npm install
  1. Add .env file and write your credentials
DB_NAME="********"
DB_USER="********"
DB_PASS="********"
DB_HOST="********"
AWS_BUCKET_NAME="********"
AWS_BUCKET_REGION="********"
AWS_ACCESS_KEY="********"
AWS_SECRET_KEY="********"

Usage

In order to use the demo API use the following endpoint - https://comment-on-everything.herokuapp.com

Here's example call to the API:

GET: get posts by hashtag

var settings = {
  "url": "https://comment-on-everything.herokuapp.com/api/posts/hashtag/Electronics",
  "method": "GET",
  "timeout": 0,
};

$.ajax(settings).done(function (response) {
  console.log(response);
});

Response (JSON)

{
  "message": "success",
  "data": [
    {
      "_id": "61c59b5e7888c5fc326ddffd",
      "description": "Love that series ",
      "createdAt": "2021-12-24T10:04:48.413Z",
      "image": {
        "url": "https://comment-on-everything-bucket.s3.amazonaws.com/99631954-45e2-45f6-a6e8-60a50348a94b.jpg",
        "key": "99631954-45e2-45f6-a6e8-60a50348a94b.jpg"
      },
      "reactions": [],
      "comments": [],
      "hashtag": "61c592c4186ee007e46fb7fb",
      "id": "61c59b5e7888c5fc326ddffd"
    }
  ]
}

For more examples, please refer to the Documentation

Project Diagrams

MVC Diagram

coe-mvc

Database ERD

coe-erd

Contact

Ofer Elfassi - @Linkedin - ofer2212@gmail.com