Building backend systems is rarely just about writing API code.
A real backend project usually includes:
Requirements
APIs
Authentication
Business rules
Database design
Validation
Cloud functions
Infrastructure
Deployment
Monitoring
When developers use AI only for code generation, they often solve these pieces one at a time.
A more structured workflow is to start with the software requirement, generate the technical design, review it, refine it, and then create the project.
That is the kind of workflow supported by AI2DEV and its product Odyssey.
The Problem with Starting Directly from Code
Imagine a client gives us this requirement:
Create a Subscription Management Platform.
Users should be able to:
- Create an account
- Select a subscription plan
- Upgrade or downgrade their plan
- Cancel a subscription
- View billing history
- Manage payment methods
Admins should be able to:
- Create subscription plans
- Update pricing
- View customers
- View subscriptions
- Disable plans
The system should:
- Use REST APIs
- Store data in PostgreSQL
- Use JWT authentication
- Support cloud deployment
- Send notifications
A developer could immediately ask an AI coding tool:
Build this backend.
The AI may start generating:
Controllers
Models
Routes
Services
Repositories
Database queries
But several important architectural decisions still need to be made.
For example:
How should billing events work?
Should payments be synchronous or event driven?
How should plan upgrades be handled?
Where should authentication live?
How should duplicate payments be prevented?
What happens when a payment fails?
How should subscriptions be cancelled?
Should cloud functions be used?
If these decisions are made after the codebase already exists, the project may require significant refactoring.
Start with the Requirement Instead
A better starting point is the full software requirement.
For example:
Build a Subscription Management Platform.
Customers:
- Register and login
- View plans
- Purchase a subscription
- Upgrade subscription
- Downgrade subscription
- Cancel subscription
- View invoices
Admin:
- Create plans
- Update plans
- Disable plans
- View active subscriptions
Technical requirements:
- REST API
- PostgreSQL
- JWT authentication
- Cloud deployment
- Payment provider integration
- Background notification processing
This requirement describes the actual application rather than the framework implementation.
Generate the Software Design with Odyssey
Odyssey can be used to turn the requirement into a structured software design.
The design can describe areas such as:
Application overview
API endpoints
Request fields
Response fields
Database entities
Business rules
Validation rules
Cloud functions
Authentication
Security
Deployment architecture
This gives developers a chance to inspect the system before implementation begins.
Step 1: Design the Main APIs
The subscription API might include:
POST /auth/register
POST /auth/login
GET /plans
GET /plans/{planId}
POST /subscriptions
GET /subscriptions/{subscriptionId}
PATCH /subscriptions/{subscriptionId}
DELETE /subscriptions/{subscriptionId}
GET /customers/{customerId}/subscriptions
GET /customers/{customerId}/invoices
Admin APIs could include:
POST /admin/plans
PUT /admin/plans/{planId}
DELETE /admin/plans/{planId}
GET /admin/customers
GET /admin/subscriptions
Now the API surface is visible before any controllers are generated.
Step 2: Define the Database
The design might identify entities such as:
User
Plan
Subscription
Payment
Invoice
PaymentMethod
Notification
A simplified relationship could look like:
User
|
| 1
|
| N
Subscription
|
| N
|
| 1
Plan
Subscription
|
| 1
|
| N
Payment
Subscription
|
| 1
|
| N
Invoice
This makes the domain model much easier to understand.
Example Subscription Table
CREATE TABLE subscriptions (
id UUID PRIMARY KEY,
user_id UUID NOT NULL,
plan_id UUID NOT NULL,
status VARCHAR(50) NOT NULL,
started_at TIMESTAMP NOT NULL,
expires_at TIMESTAMP,
cancelled_at TIMESTAMP,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL
);
Possible statuses might be:
ACTIVE
PAST_DUE
CANCELLED
EXPIRED
PENDING
Step 3: Define Business Rules
Business rules are one of the most important parts of the design.
For example:
A user can have only one active subscription.
A cancelled subscription cannot be cancelled twice.
Users cannot subscribe to disabled plans.
A downgrade may become active at the next billing cycle.
An upgrade may become active immediately.
A failed payment should not activate the subscription.
Only admins can create or update plans.
These rules are more important than the framework being used.
They define how the product actually behaves.
Step 4: Define Validation
For example, creating a plan might require:
{
"name": "Pro",
"price": 49.99,
"billingCycle": "MONTHLY",
"currency": "USD"
}
Validation rules could include:
Name is required.
Price must be greater than zero.
Currency must be supported.
Billing cycle must be MONTHLY or YEARLY.
An invalid request could return:
{
"error": "VALIDATION_ERROR",
"message": "Invalid plan data",
"fields": {
"price": "Price must be greater than zero"
}
}
Step 5: Separate Synchronous and Background Work
Not everything needs to happen inside the main API request.
For example, subscription creation might follow this flow:
Client
↓
Create Subscription API
↓
Validate Request
↓
Create Payment
↓
Save Subscription
↓
Publish Event
↓
Return Response
Background processing can then handle:
SubscriptionCreated Event
↓
┌──────────────┬─────────────────┐
↓ ↓ ↓
Invoice Email Analytics
Worker Worker Worker
This can improve reliability and keep API requests faster.
Step 6: Use AWS Lambda or Azure Functions
Some background tasks are well suited for serverless functions.
For example:
SendWelcomeEmailFunction
CreateInvoiceFunction
RetryFailedPaymentFunction
SubscriptionExpiryFunction
PaymentWebhookFunction
On AWS:
API Gateway
↓
AWS Lambda
↓
PostgreSQL / RDS
↓
EventBridge / SQS
On Azure:
API Management
↓
Azure Functions
↓
Azure PostgreSQL
↓
Service Bus
The same software requirement can be mapped to different cloud providers.
Step 7: Add Authentication
Authentication can be defined before coding begins.
For example:
POST /auth/login
Request:
{
"email": "developer@example.com",
"password": "********"
}
Response:
{
"accessToken": "jwt-token",
"expiresIn": 3600
}
Protected APIs can require:
Authorization: Bearer <token>
The design can also define roles:
CUSTOMER
ADMIN
And permissions:
CUSTOMER
- View plans
- Manage own subscription
- View own invoices
ADMIN
- Manage plans
- View customers
- View all subscriptions
Step 8: Add Payment Webhooks
Payment systems usually communicate asynchronously using webhooks.
For example:
POST /webhooks/payment
Possible events:
payment.success
payment.failed
subscription.renewed
subscription.cancelled
A webhook handler could follow:
Payment Provider
↓
Webhook API
↓
Verify Signature
↓
Check Idempotency
↓
Update Payment
↓
Update Subscription
↓
Publish Event
The idempotency step is important because payment providers may retry webhook deliveries.
Step 9: Refine the Design Before Code Generation
Suppose the application needs additional requirements later.
You might refine the design with:
Add:
- Redis caching
- Rate limiting
- Payment retry logic
- Dead-letter queues
- Multi-region deployment
- Audit logs
- Admin activity tracking
- Observability
Now the architecture can evolve before implementation becomes expensive to change.
Example Scalable Architecture
┌──────────────┐
│ Frontend │
└──────┬───────┘
↓
┌──────────────┐
│ API Gateway │
└──────┬───────┘
↓
┌───────────────────────┐
│ Subscription Service │
└──────────┬────────────┘
↓
┌──────────┐
│PostgreSQL│
└──────────┘
↓
Event Queue
↓
┌──────────────┼──────────────┐
↓ ↓ ↓
Payments Notifications Invoices
Worker Worker Worker
This is much easier to review as a design than after hundreds of files already exist.
From Odyssey to AI2DEV
Once the design is ready, the next step is creating the project.
A simplified workflow becomes:
Software Requirement
↓
Odyssey
↓
Generate Design
↓
Review
↓
Refine
↓
Create AI2DEV Project
↓
Deployment
This connects architecture work with the broader AI2DEV development workflow.
Why Design-First Development Matters
AI makes generating code faster.
But faster generation does not automatically mean better software.
A badly designed architecture can also be generated quickly.
The important part is making good decisions before generating large amounts of implementation.
For example:
Bad workflow:
Generate
↓
Discover problem
↓
Rewrite
↓
Discover another problem
↓
Rewrite again
Compared with:
Requirement
↓
Design
↓
Review
↓
Refine
↓
Generate
The second workflow can reduce unnecessary implementation changes.
AI2DEV as the Main Platform
AI2DEV is the main platform around the broader development workflow.
Odyssey works as one product within that ecosystem.
A simplified view is:
AI2DEV
│
├── Project generation
├── Cloud workflows
├── Infrastructure
├── Deployment
├── CI/CD
│
└── Odyssey
├── Software requirements
├── Design generation
├── Design refinement
├── Engineering questions
└── Create AI2DEV project
This creates a workflow that goes beyond simply asking an AI model to output source code.
Where This Approach Helps Most
A structured design-first workflow becomes more useful when the application includes:
Multiple APIs
Authentication
Complex business logic
Payment systems
AWS Lambda
Azure Functions
Database relationships
Cloud infrastructure
Background jobs
Event-driven processing
Production deployment
The more moving pieces a project has, the more valuable an explicit design becomes.
Final Thoughts
AI-assisted software development does not have to start with:
Write the code.
It can start with:
Understand the software.
Then move through:
Requirement
↓
Architecture
↓
Business Rules
↓
APIs
↓
Database
↓
Cloud Functions
↓
Project
↓
Deployment
That is where tools like Odyssey and the broader AI2DEV platform become useful.
Instead of treating AI as only a coding assistant, developers can use it earlier in the lifecycle to structure the system before implementation starts.
AI2DEV: https://ai2dev.com/
Odyssey: https://odyssey.ai2dev.com/
Would you rather generate code immediately, or review the complete architecture before creating the project?
Top comments (0)