Skip to content

This repo is for designing and implementing the backend of a mimic version of Reddit using its open API

License

Notifications You must be signed in to change notification settings

NonLegit/Backend-Reddit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NonLegit API

logo

”RESTful API mimics version of Reddit Backend using its open API“


Table of Contents


🌎 Developed With

  • Node.js
  • MongoDB
  • Express.js
  • Mongoose
  • Firebase
  • Nodemailer
  • Crypto
  • Bcryptjs
  • Awilix
  • Google auth library
  • Passport
  • Json web token
  • Multer
  • Mocha
  • Super Test
  • Chai

💻 Get Started


1 - Clone the repository

git clone https://github.com/NonLegit/Backend-Reddit.git

2- Navigate to project folder

cd Backend-Reddit/API/

3 - Install libraries & modules

npm install

4 - Create .env file

NODE_ENV= development
PORT= port number
DATABASE= deployed database connection string
DATABASE_LOCAL= local database connection string
DATABASE_PASSWORD= database password
FRONTDOMAIN = front url
BACKDOMAIN = back url
CROSSDOMAIN = cross url
JWT_SECRET= token secret key
JWT_EXPIRES_IN= expire date of token
JWT_COOKIE_EXPIRES_IN= expire date of cookies
NONLEGITEMAIL= Sender Email
NONLEGITPASSWORD= Sender password
EMAIL_PORT= email port number of email service
EMAIL_HOST= host of email service
FACEBOOK_APP_ID = facebook app id
FACEBOOK_APP_SECRET = facebook app password
GOOGLE_APP_ID = google app id
GOOGLE_APP_SECRET = google app password
FIREBASE_SERVER_KEY = firebase secret key

5- Upload database seeds

npm run migrate

6- Run server

npm run start

7- Generate Unit testing reports

npm run test_covarage

8- Generate functional documentation

npm run jsdoc

🏁 API Documentation

All details about each endpoint can be Found Here


🛠 Software Architecture

logo

  • Domain Layer

    • This layer lies in the center of the architecture where we have application basic entities which are the application model classes or database model classes.
  • Repository Layer

    • The repository layer act as a middle layer between the service layer and model objects.This contain data access pattern for reading and writing operations with the database/ domain layer.
  • Service Layer

    • This layer is used to communicate with the presentation and repository layer. The service layer holds all the business logic of the each entity.In this layer services interfaces are kept separate from their implementation for loose coupling and separation of concerns.
  • Presentation Layer


🛠 Software Design Patterns

1- MVC

logo

2- Dependency Injecton

logo

3- Singleton

logo


📂System Structure

Structure
  • ┣ 📂controllers
  • ┃ ┗ 📜userController.js
  • ┣ 📂data-access
  • ┃ ┗ 📜repository.js
  • ┣ 📂error-handling
  • ┃ ┗ 📜appError.js
  • ┣ 📂models
  • ┃ ┗ 📜userModel.js
  • ┣ 📂migrations
  • ┃ ┗ 📜seeder.js
  • ┣ 📂public
  • ┃ ┣ 📂posts
  • ┃ ┣ 📂subreddits
  • ┃ ┣ 📂users
  • ┣ 📂routes
  • ┃ ┗ 📜userRoutes.js
  • ┣ 📂service
  • ┃ ┣ 📜service.js
  • ┃ ┗ 📜userService.js
  • ┣ 📂 test
  • ┣ 📜app.js
  • ┗ 📜server.js

🧾Database Design

logo

All details about database design can be Found Here


✍️ Contributors


Kirollos Samy


Ahmed Sabry


Khaled Hesham


Doaa Achraf


🔒 License

This software is licensed under MIT License, See License for more information ©NonLegit.

About

This repo is for designing and implementing the backend of a mimic version of Reddit using its open API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published