A production-ready Flask backend demonstrating AI/LLM integration patterns, RESTful API design, and relational database architecture
OpenBuild is a developer portfolio platform that allows users to document their project journeys through timeline-based updates. The platform demonstrates production-grade backend engineering with integrated AI capabilities for automated project summarization.
What makes this project stand out:
- Production AI integration with proper error handling and fallback strategies
- Modular Flask architecture using application factory pattern
- Engineered data pipeline: Relational DB โ Structured JSON โ LLM prompt โ Validated response
- Complete backend implementation with authentication, authorization, and data management
Built to showcase: Backend development skills, AI integration understanding, production reliability patterns, and full-stack thinking.
- โ Flask Application Factory Pattern - Modular, testable application structure
- โ Blueprint-Based Routing - Separated concerns across auth, projects, posts, and home modules
- โ SQLAlchemy ORM - Normalized 3-table schema with proper relationships
- โ Database Migrations - Version-controlled schema changes with Flask-Migrate (Alembic)
- โ RESTful API Design - 14 endpoints across 4 blueprints
- โ Session-Based Authentication - Flask-Login with user session management
- โ Password Security - Bcrypt hashing with salt
- โ CSRF Protection - Flask-WTF token validation on all forms
- โ Authorization Checks - User-owned resource verification
- โ SQL Injection Prevention - Parameterized queries via SQLAlchemy
- โ Production Reliability Patterns - Timeout handling, fallback logic, response validation
- โ Data Export Pipeline - Structured JSON serialization from relational database
- โ Engineered Prompts - Context-aware, factual prompt templates (not generic "summarize this")
- โ LLM as External Service - Treats Ollama API as unreliable dependency with proper error handling
- โ Schema Versioning - JSON export format versioning (v1.2.0) for consistency
- โ Image Upload Handling - Pillow-based image processing with validation
- โ Markdown Rendering - Rich text support for developer content
- โ Infinite Scroll - HTMX-powered feed pagination
- โ Server-Side Rendering - Jinja2 templates with custom filters
โโโโโโโโโโโโโโโ
โ Browser โ
โโโโโโโโฌโโโโโโโ
โ HTTP Requests
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Flask Application โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Blueprints Layer โ โ
โ โ โข auth โข home โ โ
โ โ โข project โข post โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Middleware Layer โ โ
โ โ โข Flask-Login (auth) โ โ
โ โ โข Flask-WTF (CSRF) โ โ
โ โ โข Session Management โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Business Logic Layer โ โ
โ โ โข WTForms Validation โ โ
โ โ โข File Upload Handler โ โ
โ โ โข AI Summary Service โโโโโโผโโโโโโโ
โ โ โข Export Service โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ Data Layer (ORM) โ โ โ
โ โ โข Users โข Projects โ โ โ
โ โ โข Posts โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
โ SQLite โ โ Ollama LLM API โ
โ Database โ โ (localhost:11434) โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ
User Request
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 1. Export Project Data (Relational DB โ JSON) โ
โ โข Query Users, Projects, Posts tables โ
โ โข Transform to structured schema (v1.2.0) โ
โ โข Calculate metrics (duration, post types) โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 2. Generate Rule-Based Summary (Fallback) โ
โ โข Deterministic summary from data โ
โ โข Always available (no external dependency) โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 3. Engineer Factual Prompt โ
โ โข Include complete project context โ
โ โข Structured instructions for LLM โ
โ โข Prompt versioning for iteration โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 4. Call Ollama API (with reliability patterns) โ
โ โข 60-second timeout โ
โ โข Connection error handling โ
โ โข HTTP error handling โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโ
โ LLM Response โ
โโโโโโโโโฌโโโโโโโโ
โ
โโโโโโโโโโโผโโโโโโโโโโโ
โ Response Valid? โ
โ (length โฅ 20) โ
โโโโโโโโโโโฌโโโโโโโโโโโ
โ
โโโโโโโโโโดโโโโโโโโโ
โ โ
Yes No
โ โ
โผ โผ
โโโโโโโโโโโโ โโโโโโโโโโโโ
โ Use LLM โ โ Use โ
โ Response โ โ Fallback โ
โโโโโโฌโโโโโโ โโโโโโฌโโโโโโ
โ โ
โโโโโโโโโโฌโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ Save to Database โ
โ (projects table) โ
โโโโโโโโโโฌโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ Display to User โ
โโโโโโโโโโโโโโโโโโโโ
- Flask 3.0.3 - Lightweight WSGI web application framework
- SQLAlchemy 3.1.1 - Python SQL toolkit and ORM
- Flask-Migrate 4.0.7 - Database migration handling (Alembic wrapper)
- Flask-Login 0.6.3 - User session management
- Flask-Bcrypt 1.0.1 - Password hashing (Bcrypt algorithm)
- Flask-WTF 1.2.1 - Form handling and CSRF protection
- Ollama - Local LLM server (llama3.2 model)
- Requests 2.32.3 - HTTP client for API communication
- Custom prompt engineering module
- JSON-based data export pipeline
- Jinja2 - Server-side templating engine
- HTMX - Dynamic content loading (infinite scroll)
- Markdown 3.10 - Markdown to HTML rendering
- Vanilla CSS - Custom styling (no framework dependencies)
- Pillow 10.4.0 - Image processing and validation
- MoviePy 1.0.3 - Video processing (future feature)
- Python-dotenv 1.0.1 - Environment variable management
- Email-validator 2.2.0 - Email format validation
- SQLite (Development) - File-based relational database
- PostgreSQL-ready - SQLAlchemy abstraction allows easy migration
erDiagram
Users ||--o{ Projects : owns
Users ||--o{ Posts : authors
Projects ||--o{ Posts : contains
Users {
int id PK
string username UK
string email UK
string password_hash
datetime created_at
}
Projects {
int id PK
int user_id FK
string title
text description
string status "enum: ideation, in_progress, beta, launched"
datetime start_date
datetime created_at
datetime updated_at
string tech_stack "comma-separated"
string repo_url
text ai_summary "LLM-generated summary"
string ai_summary_version "schema version"
datetime ai_summary_generated_at
}
Posts {
int id PK
int user_id FK
int project_id FK
string title
text content "markdown format"
string post_type "enum: init, update, feature, fix, decision, learning, milestone"
datetime created_at
string image_file "filename in uploads/"
}
Users โ Projects (One-to-Many)
- Cascade delete: Deleting a user removes all their projects
- Foreign key:
projects.user_idโusers.id
Projects โ Posts (One-to-Many)
- Cascade delete: Deleting a project removes all its posts
- Foreign key:
posts.project_idโprojects.id
Users โ Posts (One-to-Many)
- Foreign key for attribution:
posts.user_idโusers.id - Maintains author reference even if project changes
Project Status:
ideation- Idea/planning phasein_progress- Active developmentbeta- Testing phaselaunched- Production/live
Post Types:
init- Project initializationupdate- General progress updatefeature- New feature implementationfix- Bug fixdecision- Architectural decisionlearning- Lesson learnedmilestone- Major achievementreflection- Project reflection
How do you integrate LLMs into production backends when they're unreliable external services?
LLMs introduce unique challenges:
- Unpredictable response times (can exceed 30+ seconds)
- Non-deterministic outputs
- API failures (connection, timeout, rate limits)
- Cost considerations (API vs. local hosting)
Transform relational data into LLM-consumable format:
# export.py - Data Export Pipeline
def export_project_data(project_id):
"""
Export structured project data from relational database.
Schema versioning ensures prompt consistency.
"""
project = Projects.query.get(project_id)
posts = Posts.query.filter_by(project_id=project.id).all()
# Schema v1.2.0 - Versioned for prompt evolution
return {
'schema_version': '1.2.0',
'enums': {'post_types': POST_TYPES},
'meta': {
'id': project.id,
'title': project.title,
'tech_stack': [t.strip() for t in project.tech_stack.split(",")],
'status': project.status,
'start_date': project.start_date.isoformat(),
# ... metadata
},
'journey': {
'total_steps': len(posts),
'logs': [
{
'step': i + 1,
'title': post.title,
'content': post.content,
'post_type': post.post_type,
'post_intent': infer_journey_intent(post.post_type, i+1),
'created_at': post.created_at.isoformat()
}
for i, post in enumerate(posts)
]
}
}Why this matters:
- โ Structured, consistent input for LLM
- โ Complete project context in one payload
- โ Schema versioning allows prompt iteration
- โ Decouples database from AI service
Factual, structured prompts with full context:
# app/ai/prompt.py
def build_summary_prompt(project_json, rule_based_summary):
"""
Engineer prompts with explicit constraints.
Includes rule-based summary as ground truth.
"""
return f"""
You are a technical writing assistant for developers.
Your task:
Rewrite the provided project summary into a clear, concise,
recruiter-friendly paragraph suitable for a portfolio.
Strict rules:
- Do NOT add new information.
- Do NOT invent features or outcomes.
- Do NOT change technical facts.
- Do NOT use marketing language.
Post-type awareness:
- Use `post_type` to adjust tone (milestone vs update).
Technology usage requirement:
- When technologies are mentioned, briefly state their use.
- Each technology should have a concise, functional purpose.
Input context:
Project data (structured):
{project_json}
Rule-based summary (ground truth):
{rule_based_summary}
Output requirements:
- 1 short paragraph (2 max if necessary)
- No bullet points, emojis, or filler
- Focus on clarity and real development work
Return ONLY the rewritten summary text.
"""Why this matters:
- โ Constrains LLM behavior with explicit rules
- โ Provides "ground truth" fallback as reference
- โ Prevents hallucination by limiting creative freedom
- โ Versioned prompts enable A/B testing
Never trust external services - always have a fallback:
# app/ai/summary.py
def generate_ai_summary(project_json):
"""
Try LLM API, fallback to rule-based summary on any failure.
This ensures the feature always works, even if AI fails.
"""
# 1. Generate deterministic fallback (no external dependencies)
rule_based_summary = generate_rule_based_fallback(project_json)
# 2. Try LLM with comprehensive error handling
try:
prompt = build_summary_prompt(project_json, rule_based_summary)
# 3. Call with timeout (LLMs can hang)
ai_output = run_llm(prompt)
# 4. Validate response quality
if not ai_output or len(ai_output.strip()) < 20:
print("[WARN] LLM response too short, using fallback")
return rule_based_summary
return ai_output.strip()
except ConnectionError as e:
print(f"[ERROR] Ollama server not reachable: {e}")
return rule_based_summary
except TimeoutError as e:
print(f"[ERROR] LLM request timed out: {e}")
return rule_based_summary
except Exception as e:
print(f"[ERROR] Unexpected AI error: {e}")
return rule_based_summary
# app/ai/llm.py
def run_llm(prompt: str) -> str:
"""
Call Ollama LLM API with proper timeout and error handling.
Raises specific exceptions for different failure modes.
"""
try:
response = requests.post(
OLLAMA_URL, # http://localhost:11434/api/generate
json={
"model": MODEL_NAME, # llama3.2
"prompt": prompt,
"stream": False
},
timeout=60 # Hard timeout to prevent hanging
)
response.raise_for_status() # Raise HTTPError for 4xx/5xx
data = response.json()
if "response" not in data:
raise ValueError("Invalid response format")
return data["response"]
except requests.exceptions.ConnectionError as e:
raise ConnectionError(f"Ollama server not reachable: {e}")
except requests.exceptions.Timeout as e:
raise TimeoutError(f"LLM request timeout: {e}")
except requests.exceptions.HTTPError as e:
raiseWhy this matters:
- โ Graceful degradation - Feature works even if AI fails
- โ Timeout protection - Prevents hanging requests
- โ Specific error handling - Different failures handled differently
- โ Logging - Failures are visible for monitoring
- โ Always returns a result - Never breaks user experience
AI as a feature, not the core product:
# app/routes/project.py
@project_bp.route('/project/<int:project_id>/ai-summary/generate', methods=['POST'])
@login_required
def ai_summary_generate_ready(project_id):
"""
AI summary is an optional feature, not a requirement.
Project functionality works without it.
"""
project = Projects.query.get_or_404(project_id)
# Authorization check
if project.user_id != current_user.id:
abort(403)
try:
# Export data (works independently of AI)
project_data = export_project_data(project_id)
# Generate summary (always succeeds due to fallback)
summary = generate_ai_summary(project_data)
# Save to database
project.ai_summary = summary
project.ai_summary_version = "1.2.0"
project.ai_summary_generated_at = datetime.now(timezone.utc)
db.session.commit()
flash("AI summary generated successfully!", "success")
except Exception as e:
# Even if everything fails, user gets feedback
flash(f"Could not generate summary: {str(e)}", "danger")
return redirect(url_for('project.ai_summary', project_id=project_id))Current Implementation:
- โ Local LLM (Ollama) - Zero API costs
- โ Synchronous processing - Simple, predictable
- โ Manual trigger - User-initiated
- โ Versioned outputs - Stored in database with metadata
What I'd do differently at scale:
-
Async Processing
- Move LLM calls to background jobs (Celery/RQ)
- Add job status tracking (pending/processing/complete)
- Implement webhook notifications
-
Caching Strategy
- Cache summaries by project hash (detect changes)
- Invalidate on new posts
- Reduce redundant LLM calls
-
Cost Optimization
- Monitor token usage
- Implement rate limiting per user
- Add cost budget tracking
-
Monitoring & Observability
- Track LLM response times
- Log failure rates
- Alert on degraded performance
-
A/B Testing
- Test prompt variations
- Measure summary quality (user feedback)
- Iterate on prompt engineering
openbuild/
โ
โโโ app/ # Main application package
โ โโโ __init__.py # Flask app factory (create_app)
โ โโโ models.py # SQLAlchemy models (Users, Projects, Posts)
โ โโโ form.py # WTForms definitions
โ โโโ constants.py # App-wide constants (enums, mappings)
โ โ
โ โโโ routes/ # Blueprint modules
โ โ โโโ auth.py # Authentication (register, login, logout)
โ โ โโโ home.py # Home/feed (infinite scroll with HTMX)
โ โ โโโ project.py # Project CRUD + AI summary endpoints
โ โ โโโ post.py # Post CRUD (updates, images)
โ โ
โ โโโ ai/ # AI integration layer
โ โ โโโ llm.py # Ollama API client (timeout, error handling)
โ โ โโโ prompt.py # Prompt engineering templates
โ โ โโโ summary.py # AI summary generator (LLM + fallback)
โ โ โโโ ai_summary_service.py # Service orchestration
โ โ
โ โโโ static/ # Static assets
โ โ โโโ css/ # Stylesheets
โ โ โ โโโ style.css # Main CSS file
โ โ โโโ uploads/ # User-uploaded images (posts)
โ โ
โ โโโ templates/ # Jinja2 templates
โ โโโ base.html # Base layout (nav, flash messages)
โ โโโ home.html # Landing page + community feed
โ โโโ register.html # User registration form
โ โโโ login.html # Login form
โ โโโ projects.html # User's project list
โ โโโ project_detail.html # Project timeline (all posts)
โ โโโ project_edit.html # Edit project metadata
โ โโโ post_new.html # Create new post/update
โ โโโ ai_summary.html # AI summary display
โ โโโ partials/ # HTMX partials
โ โโโ _feed_items.html # Feed item template (infinite scroll)
โ
โโโ migrations/ # Alembic database migrations
โ โโโ alembic.ini # Alembic configuration
โ โโโ env.py # Migration environment
โ โโโ versions/ # Migration version scripts
โ
โโโ exports/ # JSON export storage
โ โโโ project_*.json # Exported project data for LLM
โ
โโโ instance/ # Instance-specific files (gitignored)
โ โโโ app.db # SQLite database
โ
โโโ export.py # Standalone export utility (CLI)
โโโ run.py # Application entry point
โโโ requirements.txt # Python dependencies
โโโ .env # Environment variables (SECRET_KEY, DB_URL)
โโโ .gitignore # Git ignore rules
โโโ LICENSE # MIT License
โโโ README.md # This file
Key Files Explained:
| File | Purpose | Lines of Code |
|---|---|---|
app/__init__.py |
Flask app factory, blueprint registration | ~60 |
app/models.py |
Database models (Users, Projects, Posts) | ~90 |
app/routes/project.py |
Project CRUD + AI integration endpoints | ~180 |
app/ai/llm.py |
Ollama API client with error handling | ~50 |
app/ai/summary.py |
AI summary logic + fallback | ~90 |
app/ai/prompt.py |
Prompt engineering templates | ~60 |
export.py |
Data export pipeline (DB โ JSON) | ~125 |
| Method | Endpoint | Handler | Auth | Description |
|---|---|---|---|---|
| GET/POST | /register |
auth.register() |
โ | User registration with validation |
| GET/POST | /login |
auth.login() |
โ | Session-based login |
| GET | /logout |
auth.logout() |
โ | Session termination |
| Method | Endpoint | Handler | Auth | Description |
|---|---|---|---|---|
| GET | / |
home.view_home() |
โ | Landing page + community feed |
| GET | /?page=N |
home.view_home() |
โ | HTMX paginated feed (5 posts/page) |
| Method | Endpoint | Handler | Auth | Description |
|---|---|---|---|---|
| GET/POST | /project/new |
project.new_project() |
โ | Create new project |
| GET | /project |
project.view_projects() |
โ | List user's projects |
| GET | /project/<id> |
project.project_details() |
โ | View project timeline |
| GET/POST | /project/<id>/edit |
project.project_edit() |
โ | Edit project metadata |
| POST | /project/<id>/delete |
project.project_delete() |
โ | Delete project (cascade) |
| GET | /project/<id>/ai-summary |
project.ai_summary() |
โ | View AI-generated summary |
| POST | /project/<id>/ai-summary/generate |
project.ai_summary_generate_ready() |
โ | Trigger AI summary generation |
| Method | Endpoint | Handler | Auth | Description |
|---|---|---|---|---|
| GET/POST | /project/<id>/post/new |
post.post_new() |
โ | Create new post/update |
| GET/POST | /post/<id>/edit |
post.post_edit() |
โ | Edit existing post |
| POST | /post/<id>/delete |
post.post_delete() |
โ | Delete post |
Total: 14 endpoints across 4 blueprints
- Python 3.11+ (Download)
- Ollama (Installation Guide) - For AI features
- Git (Download)
git clone https://github.com/nimish-23/openbuild.git
cd openbuild# Windows
python -m venv env
env\Scripts\activate
# Linux/Mac
python3 -m venv env
source env/bin/activatepip install -r requirements.txtDependencies installed:
- Flask ecosystem (Flask, SQLAlchemy, Migrate, Login, Bcrypt, WTF)
- AI integration (requests for Ollama API)
- Media processing (Pillow, MoviePy)
- Utilities (python-dotenv, markdown, email-validator)
Create a .env file in the project root:
SECRET_KEY=your-secret-key-here
DATABASE_URL=sqlite:///instance/app.dbGenerate a secure secret key:
python -c "import secrets; print(secrets.token_hex(32))"# Initialize migration repository (first time only)
flask db init
# Create initial migration
flask db migrate -m "Initial schema: Users, Projects, Posts"
# Apply migration to database
flask db upgradeThis creates the SQLite database at instance/app.db with all tables.
Option 1: Local Installation
# Start Ollama server
ollama serve
# Pull llama3.2 model (in separate terminal)
ollama pull llama3.2Option 2: Run Without AI The application works without Ollama - AI features will fall back to rule-based summaries.
python run.pyApplication will start at: http://localhost:5000
- Navigate to http://localhost:5000/register
- Create an account
- Log in and start creating projects
Export project data to JSON for inspection or external processing:
# Export project with ID 1
python export.py 1
# Export saved to: exports/project_1.jsonExport Format (Schema v1.2.0):
{
"schema_version": "1.2.0",
"enums": {
"post_types": [
"init",
"update",
"feature",
"fix",
"decision",
"learning",
"milestone"
]
},
"meta": {
"id": 1,
"title": "OpenBuild",
"tech_stack": ["Python", "Flask", "SQLAlchemy", "Ollama"],
"status": "in_progress",
"start_date": "2026-01-01 00:00:00",
"created_at": "2026-01-01 00:00:00"
},
"journey": {
"total_steps": 5,
"logs": [
{
"step": 1,
"title": "Initial Setup",
"content": "Set up Flask application with SQLAlchemy...",
"post_type": "init",
"post_intent": "foundation",
"created_at": "2026-01-01T10:00:00"
}
]
}
}โ Application Factory Pattern
- Environment-based configuration
- Testable architecture
- Multiple instances supported
โ Database Migrations
- Version-controlled schema changes
- Rollback capability
- Team collaboration support
โ Security Practices
- Password hashing (Bcrypt)
- CSRF protection
- Session security
- Input validation
- SQL injection prevention (ORM)
โ Error Handling
- Graceful AI service degradation
- User-facing error messages
- Logging for debugging
โ Modular Architecture
- Blueprints for separation of concerns
- Service layer for business logic
- Easy to test and maintain
Click to expand deployment guide
Environment Configuration:
- Set strong
SECRET_KEY(64+ characters) - Use PostgreSQL instead of SQLite
- Set
FLASK_ENV=production - Configure proper logging (file + monitoring)
- Set up environment-specific
.envfiles
Database:
- Migrate to PostgreSQL/MySQL
- Set up connection pooling
- Configure automated backups
- Set up read replicas (if scaling)
Web Server:
- Deploy with Gunicorn (WSGI server)
- Configure Nginx reverse proxy
- Enable HTTPS (Let's Encrypt)
- Set up static file serving (Nginx/CDN)
AI Service:
- Host Ollama on separate server (resource intensive)
- Configure Ollama service monitoring
- Set up LLM request queuing
- Implement rate limiting per user
Security:
- Enable HTTPS only
- Configure CORS policies
- Set file upload limits
- Implement rate limiting (Flask-Limiter)
- Add security headers (helmet)
Monitoring & Logging:
- Set up application logging (logging module)
- Configure error tracking (Sentry)
- Monitor AI service health
- Track database performance
- Set up uptime monitoring
Internet
โ
โผ
โโโโโโโโโโโโโโโ
โ Nginx โ โ SSL termination, static files, reverse proxy
โโโโโโโโฌโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโ
โ Gunicorn โ โ WSGI server (4 workers)
โโโโโโโโฌโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโ
โ Flask App โ โ Application
โโโโโโโโฌโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ PostgreSQL โ โ Ollama โ
โ Database โ โ LLM Service โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
Example Gunicorn Command:
gunicorn -w 4 -b 0.0.0.0:8000 --timeout 120 run:appBased on what I'd build next to improve the platform:
Backend & Testing:
- Unit Testing - pytest with fixtures for models, routes (targeting 80%+ coverage)
- Integration Tests - Test AI pipeline end-to-end with mock LLM responses
- API Documentation - Swagger/OpenAPI spec for all endpoints
- Logging System - Structured logging with rotation for debugging and monitoring
- Database Indexes - Add indexes on frequently queried fields (user_id, project_id, created_at)
AI/LLM Improvements:
- Async Job Queue - Move AI generation to background with Celery + Redis (avoid blocking requests)
- Summary Caching - Cache summaries by project content hash to reduce redundant LLM calls
- Prompt Experiments - A/B test different prompt templates and measure quality
- User Feedback Loop - Thumbs up/down on AI summaries to track improvement over time
- Multiple Model Support - Allow switching between Ollama models (llama3.2, mistral, etc.)
Production Deployment:
- PostgreSQL Migration - Move from SQLite to production-ready database
- Docker Compose Setup - Containerize Flask app, database, and Ollama for easy deployment
- GitHub Actions CI/CD - Automated testing and deployment pipeline
- Rate Limiting - Prevent AI endpoint abuse (5 generations/hour per user)
User-Facing Features:
- Public Project Pages - Share project timelines with recruiters via shareable link
- GitHub Sync - Auto-create posts from commit messages (webhook integration)
- Markdown Editor - Rich text editor with live preview for post content
- Export to PDF - Generate portfolio-ready project documentation
- Activity Analytics - Visualize posting frequency, project progress over time
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
Code Style:
- Follow PEP 8 for Python code
- Use type hints where applicable
- Write docstrings for functions
This project is licensed under the MIT License - see the LICENSE file for details.
Nimish
GitHub: @nimish-23
- Flask Community - Excellent documentation and ecosystem
- Ollama Team - Making local LLM deployment accessible
- Meta AI - Llama model development
- SQLAlchemy - Powerful and flexible ORM
Built to demonstrate production-ready backend engineering with AI integration
A portfolio project showcasing Flask, SQLAlchemy, AI/LLM integration, and production reliability patterns