- 🌎 Developed With
- 💻 Get Started
- 🏁 API Documentation
- 🛠 Software Architecture
- 🛠 Software Design Patterns
- 📂System Structure
- 🧾Database Design
- ✍️ Contributors
- 🔒 License
- Node.js
- MongoDB
- Express.js
- Mongoose
- Firebase
- Nodemailer
- Crypto
- Bcryptjs
- Awilix
- Google auth library
- Passport
- Json web token
- Multer
- Mocha
- Super Test
- Chai
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
All details about each endpoint can be Found Here
-
- 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.
-
- 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.
-
- 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.
-
- API presentation layer can be connected to our UI applications.
- API presentation layer can be connected to our UI applications.
1- MVC
2- Dependency Injecton
3- Singleton
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
All details about database design can be Found Here
Kirollos Samy |
Ahmed Sabry |
Khaled Hesham |
Doaa Achraf |
This software is licensed under MIT License, See License for more information ©NonLegit.