BudgetChain Backend is a NestJS-based project built with TypeScript that serves as the robust foundation for BudgetChain. This project is designed to provide a scalable and maintainable backend infrastructure, integrating essential modules like authentication, treasury, budget management, AI, blockchain interactions, reporting, and user management.
- Framework: NestJS with TypeScript
- Key Features:
- Modular architecture with dedicated folders for config, modules (auth, treasury, budget, ai, blockchain, reporting, user), and shared utilities.
- Integration of core dependencies for configuration management, database interaction (TypeORM with PostgreSQL), JWT-based authentication, and API documentation (Swagger).
- Utility packages for validation, security, logging, and performance enhancements.
- Node.js (v14 or above)
- npm or yarn
- NestJS CLI (optional but recommended)
-
Project Setup:
- Clone the repository:
git clone https://github.com/BudgetChain/BudgetChain-Backend.git cd BudgetChain-Backend - Alternatively, initialize a new NestJS project:
nest new BudgetChain-Backend cd BudgetChain-Backend - Configure your TypeScript settings in
tsconfig.jsonas needed. - Create a comprehensive
.gitignoreto exclude directories likenode_modulesanddist. - Initialize basic project documentation (this README serves as a starting point).
- Clone the repository:
-
Dependencies Installation:
- Core Dependencies:
npm install @nestjs/config @nestjs/typeorm typeorm pg npm install @nestjs/jwt @nestjs/passport passport npm install @nestjs/swagger
- Utility Packages:
npm install class-validator class-transformer npm install helmet npm install compression npm install winston nest-winston
- Core Dependencies:
-
Project Structure Setup:
- Organize your project as follows:
src/ ├── config/ # Configuration files and services ├── modules/ # Application modules │ ├── auth/ # Authentication module │ ├── treasury/ # Treasury management │ ├── budget/ # Budget management │ ├── ai/ # AI integrations │ ├── blockchain/# Blockchain interactions │ ├── reporting/ # Reporting and analytics │ └── user/ # User management └── shared/ # Shared utilities and helpers - Use the
shared/folder for common utilities and helper functions. - Create module-specific templates within each module directory for consistency.
- Organize your project as follows:
-
Running the Application:
- Start the development server:
npm run start:dev
- The application will be accessible at
http://localhost:3000.
- Start the development server:
- For more details on NestJS, visit the NestJS Documentation.
- Please refer to the issues section for troubleshooting or to report any problems.
This project is licensed under the MIT License.