satongx/NodeJs-Backend-Folder-Structure
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
#example backend/ ├── src/ # Source code │ ├── api/ # API-specific modules │ │ ├── controllers/ # Controllers (business logic) │ │ │ ├── propertyController.js │ │ │ └── userController.js │ │ ├── routes/ # Route handlers │ │ │ ├── propertyRoutes.js │ │ │ └── userRoutes.js │ │ ├── validations/ # Request validation schemas │ │ ├── propertyValidation.js │ │ └── userValidation.js │ │ │ ├── config/ # Configurations │ │ ├── db.js # Database connection │ │ └── index.js # Centralized configuration management │ │ │ ├── core/ # Core app modules │ │ ├── middlewares/ # Middlewares for processing requests │ │ │ ├── authMiddleware.js │ │ │ ├── errorMiddleware.js │ │ │ └── rateLimiter.js │ │ ├── services/ # Service layer for reusable business logic │ │ │ ├── propertyService.js │ │ │ └── userService.js │ │ ├── utils/ # Utility functions and helpers │ │ │ ├── logger.js │ │ │ ├── jwt.js │ │ │ └── errorHandler.js │ │ │ ├── models/ # Database models (Mongoose/Sequelize) │ │ ├── Property.js │ │ └── User.js │ │ │ ├── modules/ # Advanced modules (e.g., notifications, search) │ │ ├── notifications/ # Notifications logic (email, SMS, push) │ │ │ ├── emailService.js │ │ │ └── smsService.js │ │ ├── search/ # Search engine integrations │ │ ├── elasticSearch.js │ │ └── queryBuilder.js │ │ │ ├── jobs/ # Background jobs (e.g., workers, cron) │ │ ├── queue.js # Job queue management │ │ └── propertyWorker.js │ │ │ ├── index.js # App entry point │ └── server.js # Server setup │ ├── tests/ # Tests (unit, integration, e2e) │ ├── unit/ # Unit tests │ ├── integration/ # Integration tests │ └── e2e/ # End-to-end tests │ ├── scripts/ # Deployment and automation scripts │ ├── start.sh # Start script for production │ └── db-migrate.js # Database migration script │ ├── .env # Environment variables ├── .gitignore # Git ignore rules ├── README.md # Documentation └── package.json # Dependencies