- Renamed auth-service to iam-service across various files for consistency. - Updated Dockerfiles, deployment configurations, and documentation to reflect the service name change. - Enhanced testing commands in documentation to point to the new iam-service. - Removed outdated auth-service files and configurations to streamline the project structure. - Improved bilingual documentation for clarity on the new service structure and usage.
89 lines
1.6 KiB
Markdown
89 lines
1.6 KiB
Markdown
# 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
|
|
|
|
```bash
|
|
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
|
|
|
|
```bash
|
|
# All tests
|
|
pnpm test
|
|
|
|
# Specific service
|
|
pnpm --filter @goodgo/iam-service test
|
|
```
|
|
|
|
### 4. Lint and Format
|
|
|
|
```bash
|
|
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:
|
|
```bash
|
|
./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
|
|
|
|
```bash
|
|
# Create migration (dev)
|
|
./scripts/db/migrate.sh iam-service dev
|
|
|
|
# Apply migrations (production)
|
|
./scripts/db/migrate.sh iam-service deploy
|
|
```
|
|
|
|
## Debugging
|
|
|
|
- Use logger from `@goodgo/logger`
|
|
- Check Traefik logs: `docker logs traefik-local`
|
|
- Check service logs: `./scripts/dev/logs.sh iam-service`
|