diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b61d616f..c95ec0e7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,130 +1,377 @@ -# 🌟 Contributing to GitHub Tracker +# Contributing to GitHub Tracker -Thank you for showing interest in **GitHub Tracker**! πŸš€ -Whether you're here to fix a bug, propose an enhancement, or add a new feature, we’re thrilled to welcome you aboard. Let’s build something awesome together! +Thank you for your interest in contributing to GitHub Tracker. -
+This guide explains how to set up the project, understand the repository structure, make changes, run checks, and submit a pull request. -## πŸ§‘β€βš–οΈ Code of Conduct +--- + +## Before You Start + +Before contributing, please: -Please make sure to read and adhere to our [Code of Conduct](https://github.com/GitMetricsLab/github_tracker/CODE_OF_CONDUCT.md) before contributing. We aim to foster a respectful and inclusive environment for everyone. +1. Read this guide. +2. Read the project's Code of Conduct. +3. Check existing issues and pull requests to avoid duplicate work. +4. If the change is significant, discuss the proposed approach in an issue before implementation. + +--- -
+## Development Prerequisites -## πŸ›  Project Structure +Install the following tools: + +* Git +* Node.js 20 or later +* npm +* MongoDB +* Docker Desktop (optional) + +Verify your installation: ```bash +node --version +npm --version +git --version +``` + +--- + +## Repository Structure + +```text github_tracker/ -β”œβ”€β”€ backend/ # Node.js + Express backend -β”‚ β”œβ”€β”€ routes/ # API routes -β”‚ β”œβ”€β”€ controllers/ # Logic handlers -β”‚ └── index.js # Entry point for server -β”‚ -β”œβ”€β”€ frontend/ # React + Vite frontend -β”‚ β”œβ”€β”€ components/ # Reusable UI components -β”‚ β”œβ”€β”€ pages/ # Main pages/routes -β”‚ └── main.jsx # Root file -β”‚ -β”œβ”€β”€ public/ # Static assets like images -β”‚ -β”œβ”€β”€ .gitignore -β”œβ”€β”€ README.md -β”œβ”€β”€ package.json -β”œβ”€β”€ tailwind.config.js -└── CONTRIBUTING.md +β”œβ”€β”€ .github/ # GitHub workflows and repository configuration +β”œβ”€β”€ backend/ # Node.js + Express backend +β”œβ”€β”€ public/ # Static frontend assets +β”œβ”€β”€ spec/ # Backend unit/integration tests +β”œβ”€β”€ src/ # React frontend source code +β”œβ”€β”€ .gitignore # Git ignored files +β”œβ”€β”€ CODE_OF_CONDUCT.md # Community guidelines +β”œβ”€β”€ CONTRIBUTING.md # Contribution documentation +β”œβ”€β”€ docker-compose.yml # Docker service configuration +β”œβ”€β”€ Dockerfile.dev # Frontend development image +β”œβ”€β”€ Dockerfile.prod # Frontend production image +β”œβ”€β”€ package.json # Project scripts and dependencies +β”œβ”€β”€ tailwind.config.js # Tailwind CSS configuration +└── vite.config.ts # Vite configuration ``` +The repository separates the frontend and backend into different directories while keeping the frontend tooling at the project root. + --- -## 🀝 How to Contribute +## Setting Up the Project -### 🧭 First-Time Contribution Steps +### 1. Fork the repository -1. **Fork the Repository** 🍴 - Click "Fork" to create your own copy under your GitHub account. +Create your own fork of the repository on GitHub. -2. **Clone Your Fork** πŸ“₯ - ```bash - git clone https://github.com//github_tracker.git - ``` +### 2. Clone your fork -3. **Navigate to the Project Folder** πŸ“ - ```bash - cd github_tracker - ``` +```bash +git clone github_tracker +cd github_tracker +``` -4. **Create a New Branch** 🌿 - ```bash - git checkout -b your-feature-name - ``` +### 3. Install root dependencies -5. **Make Your Changes** ✍ - After modifying files, stage and commit: +```bash +npm install +``` - ```bash - git add . - git commit -m "✨ Added [feature/fix]: your message" - ``` +### 4. Install backend dependencies -6. **Push Your Branch to GitHub** πŸš€ - ```bash - git push origin your-feature-name - ``` +```bash +cd backend +npm install +cd .. +``` + +### 5. Configure environment variables + +The Docker configuration expects environment files at: + +- `.env` +- `backend/.env` + +Create these files locally when running the application or Docker workflow. + +Do not commit environment files containing secrets, credentials, or API keys. -7. **Open a Pull Request** πŸ” - Go to the original repo and click **Compare & pull request**. - --- -## 🚦 Pull Request Guidelines -### **Split Big Changes into Multiple Commits** -- When making large or complex changes, break them into smaller, logical commits. -- Each commit should represent a single purpose or unit of change (e.g. refactoring, adding a feature, fixing a bug). +## Creating a Branch + +Do not work directly on the main branch. + +Create a descriptive branch: + +```bash +git checkout -b feature/short-description +``` + +Examples: + +```bash +git checkout -b feature/user-dashboard +git checkout -b fix/login-validation +git checkout -b docs/setup-guide +``` + +Keep the branch focused on one feature, fix, or documentation improvement. + --- -- βœ… Ensure your code builds and runs without errors. -- πŸ§ͺ Include tests where applicable. -- πŸ’¬ Add comments if the logic is non-trivial. -- πŸ“Έ Attach screenshots for UI-related changes. -- πŸ”– Use meaningful commit messages and titles. + +## Development Workflow + +### Frontend + +The frontend is located under: + +```text +src/ +``` + +Run the Vite development server from the project root: + +```bash +npm run dev +``` + +The development server uses port `5173`. + +### Backend + +The backend is located under: + +```text +backend/ +``` + +Install backend dependencies: + +```bash +cd backend +npm install +``` + +cd backend +npm install +npm start + +The backend Docker configuration exposes port `5000`. + +### Docker Development + +The complete development environment can be started from the project root: + +```bash +npm run docker:dev +``` + +or: + +```bash +docker compose --profile dev up --build +``` + +This starts the frontend and backend services together. --- -## 🐞 Reporting Issues +## Making Changes + +When implementing a change: -If you discover a bug or have a suggestion: +1. Understand the existing code before modifying it. +2. Keep changes focused. +3. Follow the existing project structure. +4. Avoid unrelated refactoring. +5. Reuse existing components and utilities where possible. +6. Update documentation when behaviour or setup instructions change. +7. Add or update tests for new functionality where applicable. -➑️ [Open an Issue](https://github.com/GitMetricsLab/github_tracker/issues/new/choose) +--- + +## Testing and Validation -Please include: +Before opening a pull request, run the appropriate checks. -- **Steps to Reproduce** -- **Expected vs. Actual Behavior** -- **Screenshots/Logs (if any)** +### Backend tests + +```bash +npm run test:backend +``` + +### Frontend tests + +```bash +npm test -- --run +``` + +### Lint + +```bash +npm run lint +``` + +### Production build + +```bash +npm run build +``` + +If your change affects multiple areas, run all applicable checks. + +--- + +## Commit Guidelines + +Write clear and descriptive commit messages. + +Good examples: + +```text +feat: add repository activity filter +fix: resolve authentication validation issue +docs: improve local setup instructions +test: add authentication integration tests +refactor: simplify user activity service +``` + +Avoid unclear messages such as: + +```text +update +changes +fix +new code +``` + +Keep commits focused so that each commit represents a logical change. + +--- + +## Pull Request Process + +Before creating a pull request: + +* Make sure your branch is up to date. +* Run relevant tests. +* Run linting where applicable. +* Verify that the application builds successfully. +* Review your own changes. +* Remove debugging code and unnecessary files. +* Update documentation if required. + +Then push your branch: + +```bash +git add . +git commit -m "docs: improve contributor onboarding" +git push origin feature/short-description +``` + +Open a pull request against the the main branch. --- -## 🧠 Good Coding Practices +## Pull Request Description -1. **Consistent Style** - Stick to the project's linting and formatting conventions (e.g., ESLint, Prettier, Tailwind classes). +A useful pull request should explain: -2. **Meaningful Naming** - Use self-explanatory names for variables and functions. +### What changed? + +Briefly describe the implementation. + +### Why was it changed? + +Explain the issue or problem being addressed. + +### How was it tested? + +Mention the commands or tests used. + +For UI changes, include screenshots when appropriate. + +--- + +## Reporting Issues + +When reporting a bug, include: + +* A clear description of the problem +* Steps to reproduce +* Expected behaviour +* Actual behaviour +* Relevant error messages or logs +* Screenshots when useful +* Environment information when relevant + +For feature requests, explain: + +* The problem being solved +* The proposed behaviour +* Why the feature would be useful + +--- + +## Documentation Contributions + +Documentation improvements are welcome. + +When updating documentation: + +* Use clear headings. +* Keep instructions in the order a new contributor would follow them. +* Use fenced code blocks for commands. +* Keep terminology consistent. +* Avoid unnecessary duplication. +* Verify commands before documenting them. +* Update related documentation when setup or workflow changes. + +--- + +## Code Quality Guidelines + +### Naming + +Use descriptive names for variables, functions, components, and files. + +### Reusability + +Prefer reusable components and utilities over duplicated logic. + +### Comments + +Add comments when they explain non-obvious logic. Avoid comments that simply repeat what the code already says. + +### Testing + +New functionality should include appropriate tests where practical. + +### Security + +Do not commit credentials, API keys, tokens, passwords, or other sensitive configuration. + +--- -3. **Avoid Duplication** - Keep your code DRY (Don't Repeat Yourself). +## Getting Help -4. **Testing** - Add unit or integration tests for any new logic. +If you are unsure about an implementation: -5. **Review Others’ PRs** - Help others by reviewing their PRs too! +1. Check the README. +2. Check this contributing guide. +3. Review existing code and tests. +4. Search existing issues and pull requests. +5. Open an issue or discussion when further clarification is needed. --- -## πŸ™Œ Thank You! +## Code of Conduct -We’re so glad you’re here. Your time and effort are deeply appreciated. Feel free to reach out via Issues or Discussions if you need any help. +Please follow the project's Code of Conduct when participating in the repository. -**Happy Coding!** πŸ’»πŸš€ +Thank you for contributing to GitHub Tracker! diff --git a/README.md b/README.md index a747b53a..b08d51ee 100644 --- a/README.md +++ b/README.md @@ -1,142 +1,487 @@ -# 🌟 **GitHub Tracker** 🌟 - - -**Track Activity of Users on GitHub** - -Welcome to **GitHub Tracker**, a web app designed to help you monitor and analyze the activity of GitHub users. Whether you’re a developer, a project manager, or just curious, this tool simplifies tracking contributions and activity across repositories! πŸš€πŸ‘©β€πŸ’» - -

- github-tracker -

- - - - - - - - - - - - - - - - - - - -
🌟 Stars🍴 ForksπŸ› IssuesπŸ”” Open PRsπŸ”• Close PRs
StarsForksIssuesOpen Pull RequestsClosed Pull Requests
+# GitHub Tracker + +**Track and analyze GitHub user activity.** + +GitHub Tracker is a web application that helps users monitor and analyze GitHub activity across repositories. The project includes a React + Vite frontend, a Node.js + Express backend, MongoDB integration, Docker development/production workflows, and automated testing. + +--- + +## Table of Contents + +* [Overview](#overview) +* [Tech Stack](#tech-stack) +* [Project Structure](#project-structure) +* [Prerequisites](#prerequisites) +* [Local Setup](#local-setup) +* [Environment Configuration](#environment-configuration) +* [Running the Application](#running-the-application) +* [Docker Development](#docker-development) +* [Docker Production](#docker-production) +* [Testing](#testing) +* [Linting and Build](#linting-and-build) +* [Contribution Workflow](#contribution-workflow) +* [Troubleshooting](#troubleshooting) + +--- + +## Overview + +GitHub Tracker is organized into separate frontend and backend responsibilities: + +* **Frontend**: React and Vite application responsible for the user interface. +* **Backend**: Node.js and Express application responsible for server-side functionality and API operations. +* **Database**: MongoDB through Mongoose. +* **Testing**: Jasmine and SuperTest for backend unit and integration tests, with Vitest and React Testing Library available for frontend testing. +* **Containerization**: Docker and Docker Compose provide development and production workflows. + +--- + +## Tech Stack + +### Frontend + +* React.js +* Vite +* React Router +* Tailwind CSS +* Material UI +* Axios +* Recharts +* Framer Motion + +### Backend + +* Node.js +* Express +* MongoDB +* Mongoose +* Passport +* Passport Local +* Express Session +* bcryptjs +* Octokit + +### Testing + +* Jasmine +* SuperTest +* Vitest +* React Testing Library +* JSDOM + +### Development Tools + +* ESLint +* Docker +* Docker Compose +* npm + +--- + +## Project Structure + +```text +github_tracker/ +β”œβ”€β”€ .github/ # GitHub workflows and repository configuration +β”œβ”€β”€ backend/ # Node.js + Express backend +β”œβ”€β”€ public/ # Static frontend assets +β”œβ”€β”€ spec/ # Backend Jasmine unit/integration tests +β”œβ”€β”€ src/ # React frontend source code +β”œβ”€β”€ .dockerignore # Docker build exclusions +β”œβ”€β”€ .gitignore # Git exclusions +β”œβ”€β”€ CODE_OF_CONDUCT.md # Community guidelines +β”œβ”€β”€ CONTRIBUTING.md # Contribution and onboarding guide +β”œβ”€β”€ docker-compose.yml # Docker development and production services +β”œβ”€β”€ Dockerfile.dev # Frontend development container +β”œβ”€β”€ Dockerfile.prod # Frontend production container +β”œβ”€β”€ eslint.config.js # ESLint configuration +β”œβ”€β”€ index.html # Vite HTML entry point +β”œβ”€β”€ package.json # Frontend and root project dependencies/scripts +β”œβ”€β”€ postcss.config.cjs # PostCSS configuration +β”œβ”€β”€ tailwind.config.js # Tailwind configuration +β”œβ”€β”€ tsconfig.json # TypeScript configuration +β”œβ”€β”€ tsconfig.app.json # Application TypeScript configuration +β”œβ”€β”€ tsconfig.node.json # Node/Vite TypeScript configuration +└── vite.config.ts # Vite configuration +``` --- -## πŸ› οΈ Tech Stack +## Prerequisites + +Before setting up the project, install: + +* Node.js 20 or later +* npm +* Git +* MongoDB +* Docker Desktop (optional, required only for Docker workflows) + +Verify Node.js and npm: + +```bash +node --version +npm --version +``` -- **Frontend**: React.js + Vite -- **Styling**: TailwindCSS + Material UI -- **Data Fetching**: Axios + React Query -- **Backend**: Node.js + Express +Verify Git: + +```bash +git --version +``` + +If you are using the local MongoDB setup, make sure MongoDB is installed and running before starting backend services. --- -## πŸš€ Setup Guide -1. Clone the repository to your local machine: +## Local Setup + +### 1. Clone the repository + ```bash -$ git clone https://github.com/yourusername/github-tracker.git +git clone +cd github_tracker ``` -2. Navigate to the project directory: +### 2. Install root dependencies + +From the project root: + ```bash -$ cd github-tracker +npm install ``` -3. Run the frontend +### 3. Install backend dependencies + +Open a second terminal: + ```bash -$ npm i -$ npm run dev +cd backend +npm install ``` -4. Run the backend +### 4. Configure environment variables + +The project uses environment files for configuration. + +The Docker Compose configuration expects: + +```text +.env +backend/.env +``` + +Do not commit real secrets, API keys, database credentials, or session secrets to Git. + +If environment variables are required for your local setup, create the required files locally using the variables expected by the frontend and backend configuration. + +--- + +## Running the Application + +### Frontend + +From the project root: + ```bash -$ npm i -$ npm start +npm run dev ``` -## πŸ§ͺ Backend Unit & Integration Testing with Jasmine +Vite starts the frontend development server on port `5173`. -This project uses the Jasmine framework for backend unit and integration tests. The tests cover: -- User model (password hashing, schema, password comparison) -- Authentication routes (signup, login, logout) -- Passport authentication logic (via integration tests) +### Backend -### Prerequisites -- **Node.js** and **npm** installed -- **MongoDB** running locally (default: `mongodb://127.0.0.1:27017`) +Open a separate terminal and move into the backend directory: -### Installation -Install all required dependencies: -```sh +```bash +cd backend npm install -npm install --save-dev jasmine @types/jasmine supertest express-session passport passport-local bcryptjs -``` - -### Running the Tests -1. **Start MongoDB** (if not already running): - ```sh - mongod - ``` -2. **Run Jasmine tests:** - ```sh - npx jasmine - ``` - -### Test Files -- `spec/user.model.spec.cjs` β€” Unit tests for the User model -- `spec/auth.routes.spec.cjs` β€” Integration tests for authentication routes - -### Jasmine Configuration -The Jasmine config (`spec/support/jasmine.mjs`) is set to recognize `.cjs`, `.js`, and `.mjs` test files: -```js -spec_files: [ - "**/*[sS]pec.?(m)js", - "**/*[sS]pec.cjs" -] -``` - -### Troubleshooting -- **No specs found:** Ensure your test files have the correct extension and are in the `spec/` directory. -- **MongoDB connection errors:** Make sure MongoDB is running and accessible. -- **Missing modules:** Install any missing dev dependencies with `npm install --save-dev `. - -### What Was Covered -- Jasmine is set up and configured for backend testing. -- All major backend modules are covered by unit/integration tests. -- Tests are passing and verified. +``` + +For development with automatic restart on file changes: + +```bash +npm run dev +``` + +For a normal production-style start: + +```bash +npm start +``` + +The backend server runs on port `5000` when configured through the project's Docker setup. + +Keep the frontend and backend running in separate terminals during local development. + + +## Docker Development + **MongoDB:** MongoDB is not included in Docker Compose. Contributors must have MongoDB running separately and configure the backend to connect to it. + +Docker Compose provides a complete development setup containing frontend and backend services. + +Make sure Docker Desktop is installed and running. + +From the project root: + +```bash +docker compose --profile dev up --build +``` + +The corresponding npm shortcut is: + +```bash +npm run docker:dev +``` + +### Development services + +| Service | Port | Purpose | +| -------- | ---: | ----------------------- | +| Frontend | 5173 | Vite development server | +| Backend | 5000 | Express backend | + +The development containers mount the local source directories, allowing changes to be reflected during development. + +To stop the development containers: + +```bash +docker compose --profile dev down +``` --- -[![Star History Chart](https://api.star-history.com/svg?repos=GitMetricsLab/github_tracker&type=Date)](https://www.star-history.com/#GitMetricsLab/github_tracker&Date) +## Docker Production + +The project also provides a production Docker configuration. + +Build and start the production services: + +```bash +docker compose --profile prod up -d --build +``` + +Or use: + +```bash +npm run docker:prod +``` + +### Production services + +| Service | Port | Purpose | +| -------- | ---: | ----------------------------- | +| Frontend | 3000 | Nginx-served production build | +| Backend | 5000 | Production backend | + +To stop the production containers: + +```bash +docker compose --profile prod down +``` --- -# πŸ‘€ Our Contributors +## Testing -- We extend our heartfelt gratitude for your invaluable contribution to our project. -- Make sure you show some love by giving ⭐ to our repository. +The repository contains backend unit and integration tests using Jasmine and SuperTest. -
- - - -
+### Backend tests +From the project root: +```bash +npm run test:backend +``` + +The backend tests cover areas including: + +* User model behaviour +* Password hashing +* Password comparison +* Authentication routes +* Signup and login flows +* Passport authentication logic +* API integration behaviour + +You can also run Jasmine directly when required: + +```bash +npx jasmine +``` + +### Test files + +Backend test files are located under: + +```text +spec/ +``` + +Examples include: + +```text +spec/user.model.spec.cjs +spec/auth.routes.spec.cjs +``` + +### Frontend tests + +Vitest is available through: + +```bash +npm test +``` + +Additional frontend testing dependencies include React Testing Library and JSDOM. + +--- + +## Linting and Build + +Run ESLint: + +```bash +npm run lint +``` + +Create a production frontend build: + +```bash +npm run build +``` + +Preview the production build locally: + +```bash +npm run preview +``` + +These checks should be performed before submitting a pull request where applicable. + +--- + +## Contribution Workflow + +The recommended contribution workflow is: + +```text +Fork repository + ↓ +Clone your fork + ↓ +Create a feature branch + ↓ +Install dependencies + ↓ +Create and test changes + ↓ +Run lint/tests/build + ↓ +Commit changes + ↓ +Push branch + ↓ +Open Pull Request + ↓ +Address review feedback +``` + +For detailed contribution instructions, see [CONTRIBUTING.md](CONTRIBUTING.md). --- -

- - ⬆️ Back to Top - -

+## Troubleshooting + +### `npm install` fails + +Check that you are using a supported Node.js version: + +```bash +node --version +``` + +Then remove dependencies and reinstall if necessary: + +```bash +rm -rf node_modules +npm install +``` + +On Windows, you can delete the `node_modules` directory manually and run: + +```bash +npm install +``` + +### Frontend does not start + +Make sure you are running the command from the repository root: + +```bash +npm run dev +``` + +Check that port `5173` is not already being used. + +### Backend does not start + +Make sure backend dependencies are installed: + +```bash +cd backend +npm install +``` + +Also verify that MongoDB is running and that the required backend environment variables are configured. + +### MongoDB connection errors + +Make sure MongoDB is running and that the connection configuration in `backend/.env` is correct. + +The local MongoDB setup commonly uses: + +```text +mongodb://127.0.0.1:27017 +``` + +### Docker errors + +Make sure Docker Desktop is running. + +Check the available containers: + +```bash +docker ps +``` + +Rebuild the development environment when dependencies or Docker configuration change: + +```bash +docker compose --profile dev up --build +``` + +### Tests cannot find modules + +Install dependencies again: + +```bash +npm install +``` + +If backend dependencies are missing: + +```bash +cd backend +npm install +``` + +--- + +## Contribution + +New contributors should read [CONTRIBUTING.md](CONTRIBUTING.md) before making changes. + +Please ensure that changes are focused, tested where applicable, and clearly described in the pull request. + +Thank you for contributing to GitHub Tracker! diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md new file mode 100644 index 00000000..e5d3df45 --- /dev/null +++ b/docs/DEVELOPMENT.md @@ -0,0 +1,288 @@ +# Development Guide + +This document provides a quick reference for contributors working on GitHub Tracker. + +--- + +## Development Architecture + +GitHub Tracker consists of two main application layers: + +```text + GitHub Tracker + | + β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” + | | + Frontend Backend + React Express + | | + Vite MongoDB + | + User Interface +``` + +### Frontend + +The frontend is located in: + +```text +src/ +``` + +The application uses React and Vite. + +Start frontend development with: + +```bash +npm run dev +``` + +The Vite development server runs on port `5173`. + +### Backend + +The backend is located in: + +```text +backend/ +``` + +It uses Node.js and Express and communicates with MongoDB. + +Install backend dependencies: + +```bash +cd backend +npm install +``` + +The backend Docker service uses port `5000`. + +--- + +## Development Options + +There are two recommended ways to work on the project. + +### Option 1: Run services locally + +Run the frontend from the repository root: + +```bash +npm install +npm run dev +``` + +Run the backend from a separate terminal: + +```bash +cd backend +npm install +``` + +### Backend + +The backend is located in: + +```text +backend/ +``` + +It uses Node.js and Express and communicates with MongoDB. + +Install backend dependencies: + +```bash +cd backend +npm install +``` + +For development, use: + +```bash +npm run dev +``` + +This starts the server with Nodemon, which automatically restarts the server when backend files change. + +For a normal start: + +```bash +npm start +``` + +The backend Docker service uses port `5000`. + + +This approach is useful when actively developing and debugging individual services. + +--- + +### Option 2: Use Docker + **MongoDB:** MongoDB is not included in Docker Compose. Contributors must have MongoDB running separately and configure the backend to connect to it. + +Docker Compose can start the frontend and backend together. + +From the repository root: + +```bash +npm run docker:dev +``` + +Equivalent command: + +```bash +docker compose --profile dev up --build +``` + +Stop the services with: + +```bash +docker compose --profile dev down +``` + +--- + +## Ports + +| Component | Development Port | +| --------- | ---------------: | +| Frontend | 5173 | +| Backend | 5000 | + +The production frontend is exposed on port `3000`. + +--- + +## Testing Workflow + +Backend tests are located in: + +```text +spec/ +``` + +Run backend tests: + +```bash +npm run test:backend +``` + +Run frontend tests: + +```bash +npm test +``` + +Before submitting a pull request, also run: + +```bash +npm run lint +npm run build +``` + +--- + +## Recommended Contributor Workflow + +```text +Read issue + ↓ +Understand existing implementation + ↓ +Create feature branch + ↓ +Install dependencies + ↓ +Configure environment + ↓ +Run application + ↓ +Implement changes + ↓ +Run tests + ↓ +Run lint/build + ↓ +Review changes + ↓ +Commit + ↓ +Push branch + ↓ +Open Pull Request +``` + +--- + +## Docker Workflow + +### Development + +```bash +docker compose --profile dev up --build +``` + +### Stop development containers + +```bash +docker compose --profile dev down +``` + +### Production + +```bash +docker compose --profile prod up -d --build +``` + +### Stop production containers + +```bash +docker compose --profile prod down +``` + +--- + +## Environment Configuration + +Environment-specific configuration should remain outside version control. + +The project expects environment files for local/Docker configuration: + +```text +.env +backend/.env +``` + +Never commit secrets or credentials. + +When adding a new environment variable: + +1. Identify which service uses it. +2. Add it to the appropriate local environment file. +3. Update the documentation if contributors need to configure it. +4. Do not commit the actual secret value. + +--- + +## Before Opening a Pull Request + +Run the checks relevant to your changes: + +```bash +npm run lint +npm test +npm run test:backend +npm run build +``` + +Not every change requires every check, but contributors should run the checks affected by their changes. + +Review the final diff before pushing: + +```bash +git status +git diff +``` + +A clean, focused pull request makes review easier and helps maintain project quality.