ant generate api my-api produces the following structure:
Top-level files
api/ — application root
Everything inside api/ is the Flask application. The Dockerfile copies this directory into /app and sets it as the working directory.
app.py
The Flask application factory. Creates the app, registers CORS, initializes the database, loads .env, and registers all blueprints. Every new route generated by ant generate route is automatically imported and registered here.
startup/
routes/
Flask Blueprints — one file per resource. Each route file defines a blueprint registered at /<route_name> and calls the corresponding service. Routes contain no business logic.
services/
Business logic layer — one file per resource. Services receive data from routes, apply logic, call repositories, and return results. All validation, calculations, and orchestration live here.
repositories/
Data access layer — one file per resource. All SQLAlchemy queries live here. Repositories extend Repository (the base class in Repository.py) which provides add(), add_all(), and delete().
models/
SQLAlchemy dataclass models — one file per table. Each model inherits from Base and uses @dataclass to define columns. No methods, no business logic — column definitions only.
schemas/
Marshmallow schemas for request validation. Used in POST/PUT routes to validate incoming JSON before it reaches the service layer.
decorators/
Custom Flask route decorators. The default project ships token_required and role_required for Bearer token authentication and role-based access.
helper/
Shared utilities available across all layers.
apis/
Third-party API client wrappers. The default project ships AWSClient — a boto3 session wrapper that supports profile-based, key-based, and ECS task role authentication.
.github/workflows/
A GitHub Actions workflow that builds the Docker image and pushes it to Amazon ECR on every push to main. Configure the ECR repository and AWS region in the workflow env vars.