# FastTool backend modular structure

This folder introduces a production-oriented layout while preserving existing behavior:

- `app/factory.py`: app factory and router composition.
- `app/core/`: centralized configuration.
- `app/api/routers/`: route modules (`system` health router now, more can be migrated incrementally).
- `app/middleware/`: reusable middleware functions.
- `legacy_main.py`: original monolithic implementation retained for backward compatibility.

## Migration strategy

1. Keep all existing endpoints available by including `legacy_main.app.router`.
2. Move features one domain at a time from `legacy_main.py` into `app/api/routers/*` + service modules.
3. Add tests per domain before deleting migrated monolith sections.
