Skip to content

danielroth1/ERPDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

52 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Repository Structure and Development Workflow

πŸ“ Repository Structure

erp/
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ workflows/
β”‚   β”‚   └── ci-cd.yml              # CI/CD pipeline
β”‚   └── README.md                   # This file
β”‚
β”œβ”€β”€ services/                       # Microservices
β”‚   β”œβ”€β”€ user-management/           # User authentication & management
β”‚   β”‚   β”œβ”€β”€ UserManagement/        # Main project
β”‚   β”‚   β”‚   β”œβ”€β”€ Controllers/
β”‚   β”‚   β”‚   β”œβ”€β”€ Models/
β”‚   β”‚   β”‚   β”œβ”€β”€ Services/
β”‚   β”‚   β”‚   β”œβ”€β”€ Infrastructure/
β”‚   β”‚   β”‚   └── Program.cs
β”‚   β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”‚   β”œβ”€β”€ .dockerignore
β”‚   β”‚   └── README.md
β”‚   β”‚
β”‚   β”œβ”€β”€ inventory/                 # Inventory & stock management
β”‚   β”œβ”€β”€ sales/                     # Orders & invoices
β”‚   β”œβ”€β”€ financial/                 # Accounting & ledger
β”‚   β”œβ”€β”€ dashboard/                 # Analytics & reporting
β”‚   └── gateway/               # API Gateway with YARP
β”‚
β”œβ”€β”€ frontend/                       # React SPA
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ features/              # Feature-based organization
β”‚   β”‚   β”‚   β”œβ”€β”€ auth/
β”‚   β”‚   β”‚   β”œβ”€β”€ inventory/
β”‚   β”‚   β”‚   β”œβ”€β”€ sales/
β”‚   β”‚   β”‚   β”œβ”€β”€ financial/
β”‚   β”‚   β”‚   └── dashboard/
β”‚   β”‚   β”œβ”€β”€ store/                 # Redux store
β”‚   β”‚   β”œβ”€β”€ components/            # Shared components
β”‚   β”‚   β”œβ”€β”€ services/              # API clients
β”‚   β”‚   └── App.tsx
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ nginx.conf
β”‚   └── package.json
β”‚
β”œβ”€β”€ infrastructure/                 # Infrastructure as Code
β”‚   β”œβ”€β”€ k8s/
β”‚   β”‚   β”œβ”€β”€ base/                  # Base Kubernetes manifests
β”‚   β”‚   β”‚   β”œβ”€β”€ mongodb.yaml
β”‚   β”‚   β”‚   β”œβ”€β”€ kafka.yaml
β”‚   β”‚   β”‚   └── services/
β”‚   β”‚   β”œβ”€β”€ local/                 # Local dev overlays
β”‚   β”‚   β”‚   └── kustomization.yaml
β”‚   β”‚   └── production/            # Production configs
β”‚   β”‚       β”œβ”€β”€ kustomization.yaml
β”‚   β”‚       β”œβ”€β”€ ingress.yaml
β”‚   β”‚       └── secrets.yaml.example
β”‚   β”‚
β”‚   β”œβ”€β”€ monitoring/                # Prometheus & Grafana
β”‚   β”‚   β”œβ”€β”€ prometheus/
β”‚   β”‚   β”‚   └── prometheus.yml
β”‚   β”‚   └── grafana/
β”‚   β”‚       β”œβ”€β”€ datasources.yml
β”‚   β”‚       β”œβ”€β”€ dashboards.yml
β”‚   β”‚       └── dashboards/
β”‚   β”‚
β”‚   β”œβ”€β”€ logging/                   # Loki configuration
β”‚   β”‚   └── loki-config.yml
β”‚   β”‚
β”‚   β”œβ”€β”€ cert-manager/              # TLS certificate management
β”‚   β”‚   β”œβ”€β”€ cluster-issuer.yaml
β”‚   β”‚   └── install.sh
β”‚   β”‚
β”‚   └── docker/                    # Docker-specific configs
β”‚       └── mongodb-init.js        # MongoDB initialization
β”‚
β”œβ”€β”€ tests/                          # Test suites
β”‚   β”œβ”€β”€ unit/                      # Unit tests per service
β”‚   β”œβ”€β”€ integration/               # Integration tests
β”‚   └── e2e/                       # End-to-end Playwright tests
β”‚
β”œβ”€β”€ docs/                           # Documentation
β”‚   β”œβ”€β”€ IMPLEMENTATION_GUIDE.md    # Step-by-step implementation
β”‚   β”œβ”€β”€ LOCAL_DEVELOPMENT.md       # Local setup guide
β”‚   β”œβ”€β”€ DEPLOYMENT.md              # Production deployment
β”‚   β”œβ”€β”€ ARCHITECTURE.md            # System architecture
β”‚   β”œβ”€β”€ API_DOCUMENTATION.md       # API reference
β”‚   β”œβ”€β”€ MONITORING.md              # Observability guide
β”‚   └── TESTING.md                 # Testing strategy
β”‚
β”œβ”€β”€ .gitignore                      # Git ignore rules
β”œβ”€β”€ .env.example                    # Environment variables template
β”œβ”€β”€ docker-compose.yml              # Local Docker Compose stack
β”œβ”€β”€ skaffold.yaml                   # Skaffold configuration
└── README.md                       # Project overview

πŸ”„ Development Workflow

Branch Strategy

We use Git Flow with the following branch structure:

  • main - Production-ready code
  • develop - Integration branch for features
  • feature/* - New features
  • bugfix/* - Bug fixes
  • hotfix/* - Production hotfixes
  • release/* - Release preparation

Branch Naming Conventions

feature/user-authentication
feature/inventory-low-stock-alerts
bugfix/order-status-update
hotfix/security-jwt-validation
release/v1.0.0

Workflow Steps

1. Start New Feature

# Create feature branch from develop
git checkout develop
git pull origin develop
git checkout -b feature/your-feature-name

# Make changes and commit
git add .
git commit -m "feat: add user registration endpoint"

# Push to remote
git push origin feature/your-feature-name

2. Create Pull Request

PR Template:

## Description
Brief description of changes

## Type of Change
- [ ] New feature
- [ ] Bug fix
- [ ] Breaking change
- [ ] Documentation update

## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests pass
- [ ] E2E tests pass
- [ ] Manual testing completed

## Checklist
- [ ] Code follows project coding standards
- [ ] Self-review completed
- [ ] Comments added for complex logic
- [ ] Documentation updated
- [ ] No console.log or debug code
- [ ] Dependencies are up to date

3. Code Review Requirements

  • Minimum 1 approval required
  • All CI checks must pass:
    • Backend tests (70%+ coverage)
    • Frontend tests (70%+ coverage)
    • Linting passes
    • Build succeeds
  • No merge conflicts
  • Branch up to date with base branch

4. Merge Process

# Update feature branch with latest develop
git checkout develop
git pull origin develop
git checkout feature/your-feature-name
git rebase develop

# Squash commits if needed
git rebase -i HEAD~3

# Push (force if rebased)
git push origin feature/your-feature-name --force-with-lease

After approval, use Squash and Merge to keep history clean.

πŸ“ Commit Message Convention

We follow Conventional Commits:

<type>(<scope>): <subject>

<body>

<footer>

Types

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes (formatting)
  • refactor: Code refactoring
  • test: Adding or updating tests
  • chore: Maintenance tasks
  • perf: Performance improvements
  • ci: CI/CD changes

Examples

feat(auth): add JWT refresh token endpoint

Implements refresh token functionality to extend user sessions
without requiring re-authentication.

Closes #123

---

fix(inventory): correct stock calculation for concurrent updates

Use pessimistic locking to prevent race conditions when multiple
users adjust stock simultaneously.

Resolves #456

---

docs(api): add GraphQL schema documentation

Add inline documentation for all GraphQL types and queries.

πŸ§ͺ Testing Requirements

Before Committing

# Backend tests
dotnet test

# Frontend tests
cd frontend && npm test

# Linting
cd frontend && npm run lint

Pre-commit Hook (recommended)

Create .git/hooks/pre-commit:

#!/bin/sh

echo "Running pre-commit checks..."

# Run backend tests
dotnet test --no-build --verbosity quiet
if [ $? -ne 0 ]; then
    echo "❌ Backend tests failed"
    exit 1
fi

# Run frontend tests
cd frontend && npm test -- --run
if [ $? -ne 0 ]; then
    echo "❌ Frontend tests failed"
    exit 1
fi

echo "βœ… All checks passed"
exit 0

πŸ” Code Review Guidelines

What to Look For

Architecture

  • Follows microservices patterns
  • Proper separation of concerns
  • Appropriate use of design patterns

Code Quality

  • Readable and maintainable
  • No code duplication
  • Proper error handling
  • Appropriate logging

Security

  • No hardcoded secrets
  • Input validation
  • Authentication/authorization checks
  • SQL injection prevention

Performance

  • No N+1 queries
  • Proper indexing
  • Caching where appropriate
  • Async operations used correctly

Testing

  • Adequate test coverage
  • Tests are meaningful
  • Edge cases covered
  • Integration tests for critical paths

Providing Feedback

Good Feedback:

❌ "This code is bad"
βœ… "Consider extracting this logic into a separate service to improve testability and follow SRP"

❌ "Wrong approach"
βœ… "This approach might cause performance issues with large datasets. Consider pagination?"

❌ "Fix this"
βœ… "This could throw NullReferenceException. Add null check or use nullable reference types"

πŸš€ Release Process

1. Create Release Branch

git checkout develop
git pull origin develop
git checkout -b release/v1.0.0

2. Update Version Numbers

  • Update version in all csproj files
  • Update version in package.json
  • Update CHANGELOG.md

3. Final Testing

# Run full test suite
dotnet test
cd frontend && npm test

# Build Docker images
docker-compose build

# Test locally
docker-compose up

4. Merge to Main

git checkout main
git merge release/v1.0.0 --no-ff
git tag -a v1.0.0 -m "Release version 1.0.0"
git push origin main --tags

# Merge back to develop
git checkout develop
git merge release/v1.0.0 --no-ff
git push origin develop

5. Deploy to Production

Triggered automatically by CI/CD when pushing to main with new tag.

πŸ“Š Project Management

Issue Labels

  • bug - Something isn't working
  • enhancement - New feature or request
  • documentation - Documentation improvements
  • good first issue - Good for newcomers
  • help wanted - Extra attention needed
  • priority: high - High priority
  • priority: medium - Medium priority
  • priority: low - Low priority
  • wontfix - This will not be worked on

Issue Template

## Description
Clear description of the issue

## Steps to Reproduce (for bugs)
1. Go to '...'
2. Click on '...'
3. See error

## Expected Behavior
What should happen

## Actual Behavior
What actually happens

## Environment
- OS: [e.g. Windows 11]
- Browser: [e.g. Chrome 120]
- Version: [e.g. 1.0.0]

## Screenshots
If applicable

🀝 Contributing

Getting Started

  1. Fork the repository
  2. Clone your fork
  3. Create a feature branch
  4. Make changes
  5. Submit pull request

Coding Standards

C# (.NET)

  • Follow Microsoft C# Coding Conventions
  • Use async/await for asynchronous operations
  • Use dependency injection
  • Add XML documentation comments for public APIs

TypeScript/React

General

  • Write self-documenting code
  • Keep functions small and focused
  • Use meaningful variable names
  • Add comments for complex logic only

πŸ“ž Contact

For questions or support:

πŸ“„ License

MIT License - see LICENSE file for details

About

Demo of an ERP system using microservice architecture with ASP.NET for the backends and React for the frontend

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors