# Phase 1 — Repository & Development Environment

**Status:** Complete (host-native PostgreSQL + Redis; Compose for RabbitMQ/MinIO)

## Objectives

1. Clean repository layout  
2. Local development environment  
3. Backend / frontend scaffolds (no business modules)  
4. Health checks for foundation services  

## Layout

```
/
  backend/                 Maven multi-module (common + app)
  frontend/                Vite + React + TS + Tailwind + i18n
  mobile-api/              Sync/OpenAPI contracts (Flutter later)
  docs/                    Architecture (Phase 0)
  infrastructure/
    compose/docker-compose.yml
    postgres/
  scripts/
    phase1-health.sh
    compose-up.sh
    set-db-password.sh
```

## Services on this host

| Service | Status | Endpoint |
|---------|--------|----------|
| PostgreSQL 16 | Native, enabled | `127.0.0.1:5432` / DB `kohzad_mfs` / user `mfskohz_mfs` |
| Redis 6 | Native, enabled | `127.0.0.1:6379` |
| RabbitMQ | Compose image | `:5672` / UI `:15672` (when Docker/Podman available) |
| MinIO | Compose image | `:9000` / console `:9001` |

## Commands

```bash
# Health
bash scripts/phase1-health.sh

# Optional containers
bash scripts/compose-up.sh

# Backend (requires Java 21 + Maven)
cd backend && mvn -pl kohzad-mfs-app -am spring-boot:run

# Frontend
cd frontend && npm install && npm run dev
```

## Exit criteria

- [x] Repository structure created  
- [x] `.env.example` + gitignore  
- [x] Compose file for RabbitMQ/MinIO (+ optional container PG/Redis)  
- [x] Backend parent POM + runnable app shell (`/api/v1/platform`, actuator)  
- [x] Frontend scaffold with EN/FA/PS + RTL switch  
- [x] Host PostgreSQL + Redis verified earlier  

## Next

**Phase 2:** Flyway baseline + core schema (identity, org, config, audit, geography, currency)
