This document outlines the recommended folder structure for the B2B e-commerce platform.
TSG-Portfolio/
├── src/
│ ├── controllers/ # Application controllers
│ ├── models/ # Database models
│ ├── routes/ # API routes
│ ├── services/ # Business logic
│ ├── middleware/ # Middleware functions
│ └── utilities/ # Utility functions
│
├── frontend/ # Frontend source code
│ ├── components/ # React components
│ ├── pages/ # React pages
│ └── styles/ # CSS/SCSS styles
│
├── migrations/ # Database migration files
│
└── .env # Environment variables
-
src/: Contains all the backend source code.
- controllers/: Handles incoming requests and responses.
- models/: Defines the structure of data.
- routes/: Manages the API endpoints.
- services/: Contains business logic and interacts with models.
- middleware/: Functions that run before processing requests, for tasks like authentication.
- utilities/: Helper functions for various tasks.
-
frontend/: Contains all the source code for the frontend application.
- components/: Reusable UI components.
- pages/: React pages and routing.
- styles/: Style sheets and design files.
-
migrations/: Scripts for database migrations to manage schema changes.
-
.env: Stores all environment variables used in the application setup.
This structure is flexible and can be adjusted according to the project's specific needs, but following a consistent structure will improve maintainability and collaboration within the development team.