The backend app contains several folder. These folders are mentioned below with their roles
.
├── assets
├── controllers
│ └── auth
├── docs
├── middlewares
├── models
├── routes
├── services
├── __tests__
│ └── unit
│ ├── controllers
│ │ └── auth
│ ├── middlewares
│ └── utils
│ └── scripts
└── utils
├── mocks
└── scripts
assets/
- Assets directory contains the image assets once the image is dropped in this folder a record will be created in the firebase collection.controllers/
- Controllers directory, contains controllers. Controllers are functions that runs when the user hits an endpoint. This function receives a request and response object. Controllers in our app are express middlewares.docs/
- Contains file with README and setup guide.models/
-models
, not to be confused with models provided by ORMs, are classes that are used for the following things
- Model the db collection
- Providing an interface to process firestore data in the collection
middlewares/
- Middlewares are functions that intercepts the request to process some data.routes/
- Routes contain the routes for the application, they contain different directories based on different route groups.services/
- This directory contains functions which are responsible for fetching or storing data in firestore.utils/
- Utils contian reusable code which cannot be categorized into directories.__tests__
- Contains unit tests for the applcation.