node --version: v20.18.1npm --version: 10.8.2pnpm --version: 10.10.0
-
Install Node.js, NPM and PNPM if not already:
# Node & npm https://nodejs.org/ # pnpm npm install -g pnpm
-
Create a
.envfile in the project root with the following fields:- NODE_ENV: development - JWT_TOKEN_SECRET: set the secret token as you like - PORT: set the port as you like (should be 8080) - MONGODB_URI: get the mongoDB uri of the link to your account - EMAIL_USER: set email for admin - EMAIL_PASSWORD: set email_password for admin - DOMAIN_FE: domain default send mail
# Install dependencies
pnpm install
# Run development server
pnpm run devOr if using npm:
npm install
npm run devThe backend API runs on:
http://localhost:8080/- (Optional) Frontend or client:
http://localhost:3000/
This project uses ESLint to enforce code quality and maintain consistent coding standards. The rules are specifically configured for the src directory with special configurations for different module types.
To run the linter:
pnpm run lint # Check for linting errors
pnpm run lint:fix # Fix linting errors automatically- TypeScript Safety: Strict type checking with no
anytype allowed - Module Structure: Enforced import ordering and module boundaries
- Naming Conventions:
- Interfaces must start with
Iand use PascalCase - Models must follow PascalCase
- Type aliases must use PascalCase
- Interfaces must start with
- Code Organization: Different rules for controllers, services, routes, and models
Code formatting is handled by Prettier. To format your code:
pnpm run format # Format all TypeScript files
pnpm run format:check # Check formatting without changing filesThis project uses Husky and lint-staged to run linters and formatters before each commit, ensuring that only quality code is committed to the repository.