Files
pos-system/docs/en/guides/development.md
Ho Ngoc Hai 29c40ea681 Update project documentation and scripts for improved setup and bilingual support
- Enhanced `README.md` with a quick start guide and detailed project structure.
- Updated `SETUP_GUIDE.md` by removing it as it was redundant.
- Improved `local-development.md` and `development.md` with clearer instructions for database migrations.
- Added bilingual comments in various scripts for better understanding and usability.
- Updated `.gitignore` to include specific build scripts while ignoring others.
- Enhanced `scripts` for database management, including backup and seeding functionalities with bilingual support.
2025-12-27 10:12:46 +07:00

1.6 KiB

Development Guide

Project Structure

├── apps/              # Frontend applications
├── services/          # Backend microservices
├── packages/          # Shared libraries
├── infra/             # Infrastructure configs
├── deployments/       # Deployment configs
├── scripts/           # Automation scripts
└── docs/              # Documentation

Development Workflow

1. Create a Feature Branch

git checkout -b feature/my-feature

2. Make Changes

  • Write code following TypeScript strict mode
  • Add tests for new functionality
  • Update documentation if needed

3. Run Tests Locally

# All tests
pnpm test

# Specific service
pnpm --filter @goodgo/auth-service test

4. Lint and Format

pnpm lint
pnpm format

5. Create Pull Request

  • Push your branch
  • Create PR targeting develop
  • CI/CD will run automatically

Adding a New Service

  1. Use the template:

    ./scripts/utils/create-service.sh my-new-service
    
  2. Update service configuration

  3. Implement business logic

  4. Add tests

  5. Update documentation

Adding a New Package

  1. Create package in packages/new-package
  2. Add to workspace in pnpm-workspace.yaml
  3. Export from index.ts
  4. Add tests
  5. Document usage

Database Migrations

Database Migrations

# Create migration (dev)
./scripts/db/migrate.sh auth-service dev

# Apply migrations (production)
./scripts/db/migrate.sh auth-service deploy

Debugging

  • Use logger from @goodgo/logger
  • Check Traefik logs: docker logs traefik-local
  • Check service logs: ./scripts/dev/logs.sh auth-service