https://github.com/abuzain432432/nest-js-muuve
https://github.com/abuzain432432/nest-js-muuve
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/abuzain432432/nest-js-muuve
- Owner: abuzain432432
- Created: 2024-08-19T16:21:44.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-10-29T16:12:40.000Z (8 months ago)
- Last Synced: 2025-01-07T06:16:32.863Z (5 months ago)
- Language: TypeScript
- Size: 696 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Guidelines About Project
## Table of Contents
- [Folder Structure](#folder-structure)
- [Testing Guidelines](#testing-guidelines)
- [File Naming Conventions](#file-naming-conventions)
- [Coding Standards](#coding-standards)## Folder Structure
This project follows a modular folder structure for better organization and maintainability. Below is the structure for the `auth` module:
### Key Directories:
- **`__mock__/`**: Contains mocked services for unit testing, isolating tests from actual implementations.
- **`__fixtures__/`**: Includes fixture data for setting up test scenarios.
- **`dto/`**: Contains Data Transfer Objects to manage the structure of data models.
- **`enums/`**: Organizes enums used throughout the module.
- **`auth.controller.ts`, `auth.service.ts`, `auth.module.ts`**: Core files for the module, facilitating easy access and understanding of functionalities.## Testing Guidelines
### Unit Tests
- **Scope**: Test the smallest units of code, such as services and controllers.
- **Mocking**: Mock dependencies (e.g., services) to isolate the functionality of the unit under test.### Integration Tests
- **Scope**: Test each module and its endpoints, including both success and error cases.
- **Mocking**: Mock actual database interactions to isolate the logic of the application.### End-to-End (E2E) Tests
- **Scope**: Test the complete application by interacting with actual endpoints.
- **Environment**: Use a dedicated test environment with a running server instance.## File Naming Conventions
- Use **camelCase** for JavaScript and TypeScript variables, functions etc.
- Name files according to their functionality (e.g., `auth.controller.ts`, `user-response.dto.ts`).
- Use clear and descriptive names for mocks and fixtures (e.g., `auth.service.mock.ts`, `user-response.fixture.ts`).## Coding Standards
- Follow **TypeScript** best practices.
- Write **clean, readable, and maintainable code**.
- Use **consistent indentation** (2 spaces).
- Document code where necessary with comments and JSDoc style annotations.