Folder structure, READMEs

This commit is contained in:
Kaushik 2022-11-12 16:37:02 +05:30
parent 92f121e60c
commit 1f0b049cb7
13 changed files with 12 additions and 2 deletions

View File

@ -2,5 +2,5 @@ require("dotenv-flow").config();
const path = require("path"); const path = require("path");
module.exports = { module.exports = {
"config": path.resolve("config", "config.js") "config": path.resolve("config", "sequelize.js")
}; };

1
boilerplates/README.md Normal file
View File

@ -0,0 +1 @@
## Boilerplates - reusable code templates

1
config/README.md Normal file
View File

@ -0,0 +1 @@
## Configuration files and data

1
controllers/README.md Normal file
View File

@ -0,0 +1 @@
## Controllers - business logic functions, end of the API route

1
middleware/README.md Normal file
View File

@ -0,0 +1 @@
## Middleware - functionalities that must be in the middle of the API route control flow

1
migrations/README.md Normal file
View File

@ -0,0 +1 @@
## Database (mainly Sequelize's) migrations

1
models/README.md Normal file
View File

@ -0,0 +1 @@
## Database ORM (mainly Sequelize's) models

View File

@ -5,7 +5,7 @@ const Sequelize = require("sequelize");
const basename = path.basename(__filename); const basename = path.basename(__filename);
const env = process.env.NODE_ENV || "development"; const env = process.env.NODE_ENV || "development";
const config = require(__dirname + "/../config/config.js")[env]; const config = require(__dirname + "/../config/sequelize.js")[env];
const db = {}; const db = {};
// Create new Sequelize instance // Create new Sequelize instance

1
routes/README.md Normal file
View File

@ -0,0 +1 @@
## Routes - define control flow of the API route

1
seeders/README.md Normal file
View File

@ -0,0 +1 @@
## Database (mainly Sequelize's) seeders - initial data feed, for dummy data and testing

1
utils/README.md Normal file
View File

@ -0,0 +1 @@
## General, reusable functionalities unrelated to API

1
validators/README.md Normal file
View File

@ -0,0 +1 @@
## Validators - middleware functions for request object validation