Skip to content

Backend Folder Structure

shivy02 edited this page Mar 3, 2024 · 1 revision

/Backend/models

file-naming:

income-schema.js, cost-schema.js, user-schema.js

Description:

Contains schemas for data that is stored in the database.

/Backend/routes

file-naming:

income-router.js, user-router.js, chat-router.js

Description:

Routes define the relationship between the URLs (or endpoints) of your web application and the corresponding controllers that handle the requests. In other words, routes map URLs to specific controller functions.

/Backend/controllers

file-naming:

user-controller.js, cost-controller.js, income-controller.js, chat-controller.js

Description:

The controller is responsible for handling the logic behind user inputs and actions. It acts as an intermediary between the data (model) and the presentation (view). In a web application, the controller receives the HTTP request, processes it, interacts with the data layer (e.g., querying the database), and sends an appropriate HTTP response back to the client.

/Backend/api/...

folder-naming:

/api/plaid, /api/chatbot, etc.

Description:

Contains files that interact with external apis and supplementary files needed to parse data and test.

/Backend/middleware

Description:

Contains all middleware functions - functions that get executed when a request is sent, and a response given. Will have access to the request object ( req ), the response object ( res ), and the next function in the application's request-response cycle. All error handlers, validators, and authenticators will reside here.

/Backend/config

Description:

Contains drivers, database connection, and environment files

/Backend/utils

Description

Contains utility functions and additional files that we need.