From 4768bd5184795747048b15ff79026c1cb627e860 Mon Sep 17 00:00:00 2001 From: Thibault Pouch Date: Tue, 3 Mar 2026 09:21:42 +0100 Subject: [PATCH] feat: add CONTRIBUTING.md and LICENSE files for project guidelines and legal terms --- CONTRIBUTING.md | 318 ++++++++++++++++++++++++++++++++++++++++++++++++ LICENSE | 42 +++++++ README.md | 16 ++- 3 files changed, 374 insertions(+), 2 deletions(-) create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..833ce3b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,318 @@ +# Contributing to CrowMate Nest + +Thank you for your interest in contributing to the Nest platform for Headless Hazard! This document provides guidelines and workflows for contributing to this monorepo. + +## Table of Contents + +- [Code of Conduct](#code-of-conduct) +- [Getting Started](#getting-started) +- [Development Workflow](#development-workflow) +- [Coding Standards](#coding-standards) +- [Testing Guidelines](#testing-guidelines) +- [Commit Messages](#commit-messages) +- [Pull Request Process](#pull-request-process) +- [Project Structure](#project-structure) + +## Code of Conduct + +- Be respectful and constructive in all communications +- Focus on what is best for the community and the project +- Show empathy towards other contributors +- Accept constructive criticism gracefully + +## Getting Started + +### 1. Fork and Clone (External Contributors) + +```bash +git clone https://github.com/CrowMate/Nest.git +cd Nest +``` + +### 2. Install Dependencies + +Install dependencies for each sub-project you'll be working on: + +```bash +# Backend +cd nest-backend +npm install + +# Public Frontend +cd ../nest-front +npm install + +# Internal Portal +cd ../nest-intra +npm install +``` + +### 3. Set Up Environment + +Create `.env` files based on the examples in each project. See the main [README.md](./README.md) for required environment variables. + +### 4. Create a Branch + +Always create a new branch from `main` for your work: + +```bash +git checkout main +git pull origin main +git checkout -b feature/your-feature-name +``` + +Branch naming conventions: +- `feature/` - New features +- `fix/` - Bug fixes +- `refactor/` - Code refactoring +- `docs/` - Documentation updates +- `style/` - Code style changes (formatting, etc.) +- `test/` - Adding or updating tests + +## Development Workflow + +### Running Development Servers + +```bash +# Backend (port 3000) +cd nest-backend +npm run dev + +# Frontend (port 5173) +cd nest-front +npm run dev + +# Intranet (port 5174) +cd nest-intra +npm run dev +``` + +### Database Changes (Backend) + +When modifying the Prisma schema: + +```bash +cd nest-backend + +# Push changes directly (development) +npm run db:push + +# Or create a migration (production-ready) +npm run db:migrate + +# Re-seed if needed +npm run db:seed +``` + +## Coding Standards + +### TypeScript + +- **Use TypeScript strictly** - avoid `any` types +- **Define interfaces/types** for all data structures +- **Export types** from centralized locations (e.g., `src/types/index.ts`) +- **Use named exports** over default exports where possible + +### Code Style + +- **2 spaces** for indentation +- **Single quotes** for strings +- **Semicolons** required +- **Trailing commas** in multi-line objects/arrays +- **No unused imports** or variables + +### Linting + +Run linters before committing: + +```bash +# Frontend projects +npm run lint + +# Backend - ensure TypeScript compiles without errors +npm run build +``` + +### Naming Conventions + +- **Variables/Functions**: `camelCase` +- **Components**: `PascalCase` +- **Files**: Match the exported component/function name +- **Constants**: `UPPER_SNAKE_CASE` +- **Database fields**: `camelCase` (Prisma convention) + +### File Organization + +``` +src/ +├── components/ # React components +│ ├── layout/ # Layout components (headers, sidebars) +│ └── shared/ # Reusable components +├── contexts/ # React contexts +├── pages/ # Route pages +├── types/ # TypeScript type definitions +├── utils/ # Utility functions +└── data/ # Mock data, constants +``` + +## Testing Guidelines + +### Backend Testing + +- Test all API endpoints with valid and invalid data +- Verify authentication and authorization +- Test database operations and constraints +- Use tools like Postman or Thunder Client + +### Frontend Testing + +- Test user flows manually in the browser +- Verify responsive design at different breakpoints +- Test authentication flows (login, logout, protected routes) +- Ensure error states are handled gracefully + +### Manual Testing Checklist + +Before submitting a PR: + +- [ ] Code runs without errors +- [ ] New features work as intended +- [ ] Existing features still work (no regressions) +- [ ] UI is responsive and accessible +- [ ] Forms validate properly +- [ ] Error messages are clear and helpful +- [ ] Console has no warnings or errors + +## Commit Messages + +Follow conventional commit format: + +``` +(): + + + +