|
1 | 1 | # Contributing to ProG Coder Shop Microservices |
2 | 2 |
|
3 | | -We welcome contributions to the ProG Coder Shop Microservices project! This document provides guidelines for contributing. |
| 3 | +Thank you for your interest in contributing to ProG Coder Shop Microservices! This guide will help you get started with building, testing, and contributing to the project. |
4 | 4 |
|
5 | | -## How to Report Bugs |
| 5 | +## Table of Contents |
6 | 6 |
|
7 | | -If you find a bug, please create an issue on GitHub with: |
8 | | -- A clear description of the problem |
9 | | -- Steps to reproduce the issue |
10 | | -- Expected vs actual behavior |
11 | | -- Your environment details (OS, .NET version, Docker version) |
| 7 | +- [Contributing to ProG Coder Shop](#contributing-to-prog-coder-shop-microservices) |
| 8 | + - [Table of Contents](#table-of-contents) |
| 9 | + - [Prerequisites](#prerequisites) |
| 10 | + - [Required](#required) |
| 11 | + - [Optional](#optional) |
| 12 | + - [Getting Started](#getting-started) |
| 13 | + - [Building the Project](#building-the-project) |
| 14 | + - [Testing](#testing) |
| 15 | + - [Quick Local Testing](#quick-local-testing) |
| 16 | + - [Project Structure](#project-structure) |
| 17 | + - [Code Style](#code-style) |
| 18 | + - [Questions or Issues?](#questions-or-issues) |
12 | 19 |
|
13 | | -## How to Submit Pull Requests |
| 20 | +## Prerequisites |
14 | 21 |
|
15 | | -1. Fork the repository |
16 | | -2. Create a new branch for your feature or bugfix (`git checkout -b feature/your-feature-name`) |
17 | | -3. Make your changes |
18 | | -4. Test your changes thoroughly |
19 | | -5. Commit your changes with clear commit messages (see Commit Style below) |
20 | | -6. Push to your fork |
21 | | -7. Submit a pull request to the main repository |
22 | | - |
23 | | -## Commit Style |
24 | | - |
25 | | -We follow the [Conventional Commits](https://www.conventionalcommits.org/) specification. |
| 22 | +### Required |
26 | 23 |
|
27 | | -### Format |
| 24 | +- **[.NET SDK 8.0+](https://dotnet.microsoft.com/download/dotnet/8.0)** (specified in `src/Directory.Build.props`) |
| 25 | +- **[Docker Desktop](https://www.docker.com/products/docker-desktop)** (required for running services and infrastructure) |
28 | 26 |
|
29 | | -``` |
30 | | -<type>(<scope>): <subject> |
31 | | -``` |
| 27 | +### Optional |
32 | 28 |
|
33 | | -### Types |
| 29 | +- **[Node.js](https://nodejs.org/)** (v18+ recommended) - Required if you plan to work on the frontend applications in `src/Apps/` |
| 30 | +- **[Just](https://github.com/casey/just)** - Command runner (if you prefer using automation scripts) |
34 | 31 |
|
35 | | -- **feat**: New feature |
36 | | -- **fix**: Bug fix |
37 | | -- **docs**: Documentation changes |
38 | | -- **style**: Code formatting (no logic change) |
39 | | -- **refactor**: Code restructuring |
40 | | -- **perf**: Performance improvements |
41 | | -- **test**: Test changes |
42 | | -- **build**: Build system changes |
43 | | -- **ci**: CI/CD changes |
44 | | -- **chore**: Miscellaneous changes |
| 32 | +## Getting Started |
45 | 33 |
|
46 | | -### Scope (Optional) |
| 34 | +0. (Optional) Comment on the related issue you want to work on |
| 35 | +1. Fork the repository |
| 36 | +2. Make a branch |
| 37 | +3. Make your changes |
| 38 | +4. Push the branch |
| 39 | +5. Make a pull request |
47 | 40 |
|
48 | | -Service or component name: `catalog`, `basket`, `order`, `inventory`, `discount`, `notification`, `search`, `report`, `api-gateway`, `frontend`, etc. |
| 41 | +- There is a [**good first issue**](https://github.com/huynxtb/progcoder-shop-microservices/labels/good%20first%20issue) label for open issues |
49 | 42 |
|
50 | | -### Examples |
| 43 | +## Building the Project |
51 | 44 |
|
52 | 45 | ```bash |
53 | | -# Feature |
54 | | -feat(catalog): add MinIO image upload |
| 46 | +# Builds the whole solution |
| 47 | +dotnet build |
| 48 | +``` |
55 | 49 |
|
56 | | -# Bug fix |
57 | | -fix(order): correct discount calculation |
| 50 | +## Testing |
58 | 51 |
|
59 | | -# Documentation |
60 | | -docs(readme): update setup instructions |
| 52 | +### Quick Local Testing |
61 | 53 |
|
62 | | -# Multiple services |
63 | | -refactor(catalog,inventory): extract common validation |
| 54 | +For most development work, you can simply run: |
64 | 55 |
|
65 | | -# No scope |
66 | | -chore: update dependencies |
| 56 | +```bash |
| 57 | +# Run all tests |
| 58 | +dotnet test |
67 | 59 | ``` |
68 | 60 |
|
69 | | -### Rules |
| 61 | +### GitHub Actions Testing |
| 62 | + |
| 63 | +The project uses GitHub Actions for continuous integration: |
| 64 | + |
| 65 | +1. **CI Pipeline** (automatic) |
| 66 | + - Triggers automatically on pull requests |
| 67 | + - Runs validation for code quality, formatting, and tests. |
70 | 68 |
|
71 | | -- Use imperative mood: "add" not "added" |
72 | | -- Keep subject under 50 characters |
73 | | -- No period at the end |
74 | | -- Reference issues: `Closes #123`, `Fixes #456` |
| 69 | +## Project Structure |
| 70 | + |
| 71 | +``` |
| 72 | +progcoder-shop-microservices/ |
| 73 | +├── src/ |
| 74 | +│ ├── ApiGateway/ # YARP API Gateway |
| 75 | +│ ├── Apps/ # Frontend Applications (React/Next.js) |
| 76 | +│ ├── JobOrchestrator/ # Background Jobs (Quartz.NET) |
| 77 | +│ ├── Services/ # Microservices (Basket, Catalog, Order, etc.) |
| 78 | +│ └── Shared/ # Shared libraries (Common, BuildingBlocks) |
| 79 | +├── test/ # Test projects |
| 80 | +├── .github/ # GitHub Actions workflows |
| 81 | +├── docker-compose.yml # Docker composition for services |
| 82 | +└── samples/ # Sample files |
| 83 | +``` |
75 | 84 |
|
76 | 85 | ## Code Style |
77 | 86 |
|
78 | | -- Follow standard .NET coding conventions |
79 | | -- Use meaningful variable and method names |
80 | | -- Add comments for complex logic |
81 | | -- Ensure your code builds without warnings |
82 | | -- Run code formatter before committing (if available) |
| 87 | +The project enforces consistent code style: |
83 | 88 |
|
84 | | -## Questions? |
| 89 | +- **Formatting**: We follow standard .NET coding conventions. |
| 90 | +- **Editor Configuration**: `.editorconfig` defines coding conventions enforced by the build. |
| 91 | +- **Regions**: We use `#region` directives for organizing code (e.g., `#region using`, `#region Properties`). |
85 | 92 |
|
86 | | -If you have questions, feel free to open a GitHub issue or discussion. |
| 93 | +## Questions or Issues? |
87 | 94 |
|
88 | | -Thank you for contributing! |
| 95 | +Check out [GitHub Issues](https://github.com/huynxtb/progcoder-shop-microservices/issues) or [discussions](https://github.com/huynxtb/progcoder-shop-microservices/discussions). |
89 | 96 |
|
| 97 | +Thank you for contributing to ProG Coder Shop Microservices! |
0 commit comments