Skip to content

LegendarySumit/TechFixAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

95 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽ™๏ธ TechFixAI

Production-ready Voice-to-Ticket Incident Platform

FastAPI Python PostgreSQL SQLite Render Jinja2

Japanese Voice Capture โ€ข AI Transcription & Translation โ€ข Smart Ticket Generation โ€ข Deterministic Dev Assignment

Live Demo โ€ข Features โ€ข Quick Start โ€ข Tech Stack


๐Ÿ“– About

TechFixAI is a production-grade incident management platform that bridges the language gap in Japanese software teams. It captures voice-recorded incident reports in Japanese, transcribes and translates them using Groq Whisper with technical context awareness, and automatically generates structured support tickets โ€” all in one seamless background pipeline.

The platform goes beyond simple transcription. After a voice report is submitted, TechFixAI deterministically assigns the right developer based on incident type and severity โ€” no random shuffling, no manual triage. Built on FastAPI with SQLAlchemy and Jinja2-rendered pages, it supports SQLite locally and PostgreSQL in production.

TechFixAI ships production-ready: full auth with Google OAuth, rate limiting, CAPTCHA, security headers, structured logging, Sentry integration, and Prometheus metrics โ€” all configured and ready to deploy.


โœจ Features

  • โœ… Voice upload pipeline โ€” Audio โ†’ STT โ†’ Translation โ†’ Ticket โ†’ Assignment as a background task
  • โœ… Japanese-to-English translation with technical context awareness
  • โœ… Deterministic developer assignment by incident type and severity
  • โœ… Chat voice helper โ€” transcribe and translate without creating a ticket
  • โœ… Full auth system โ€” email/password + Google OAuth + secure session cookies
  • โœ… CAPTCHA support on login and signup (Cloudflare Turnstile style)
  • โœ… Granular rate limiting for global traffic, auth, uploads, and translation
  • โœ… Admin dashboard with aggregated stats, conversations, and developer metrics
  • โœ… Health and Prometheus metrics endpoints
  • โœ… Structured logging with request IDs and sensitive value redaction
  • โœ… Security headers, HTTPS enforcement, CORS validation, brute-force lockout
  • โœ… Optional Sentry integration for error tracking and tracing

๐Ÿ› ๏ธ Tech Stack

Backend

  • FastAPI โ€” Core web framework and API routing
  • SQLAlchemy โ€” ORM and database abstraction
  • Starlette โ€” Middleware (request ID, security headers, rate limiting)
  • Jinja2 โ€” Server-rendered HTML templates
  • Uvicorn โ€” ASGI server

Database

  • SQLite โ€” Local development default
  • PostgreSQL โ€” Production via DATABASE_URL

AI Services

  • Groq Whisper โ€” Primary speech-to-text transcription
  • OpenAI โ€” Optional fallback
  • Gemini โ€” Optional fallback

Infrastructure & Auth

  • Render โ€” Deployment target
  • Google OAuth 2.0 โ€” Social login
  • Sentry โ€” Optional error tracking and tracing
  • Prometheus โ€” Optional metrics scraping

๐Ÿ“ Project Structure

TechFixAI/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ main.py                  # App entry point, route registration
โ”‚   โ”œโ”€โ”€ models/                  # SQLAlchemy models
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ auth.py              # Login, signup, logout, Google OAuth
โ”‚   โ”‚   โ”œโ”€โ”€ voice.py             # Voice upload, chat-transcribe, status
โ”‚   โ”‚   โ”œโ”€โ”€ tickets.py           # Ticket CRUD and status management
โ”‚   โ”‚   โ”œโ”€โ”€ admin.py             # Dashboard, conversations, developers
โ”‚   โ”‚   โ””โ”€โ”€ pages.py             # Jinja2 page routes
โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”‚   โ”œโ”€โ”€ stt.py               # Groq Whisper STT integration
โ”‚   โ”‚   โ”œโ”€โ”€ translation.py       # Technical-context translation
โ”‚   โ”‚   โ”œโ”€โ”€ ticket_generator.py  # Ticket structuring logic
โ”‚   โ”‚   โ””โ”€โ”€ assignment.py        # Deterministic developer assignment
โ”‚   โ”œโ”€โ”€ middleware/
โ”‚   โ”‚   โ”œโ”€โ”€ rate_limit.py        # Route-specific rate limiters
โ”‚   โ”‚   โ”œโ”€โ”€ request_id.py        # Request ID injection
โ”‚   โ”‚   โ””โ”€โ”€ security.py          # Security headers, HTTPS enforcement
โ”‚   โ”œโ”€โ”€ templates/               # Jinja2 HTML templates
โ”‚   โ”‚   โ”œโ”€โ”€ login.html
โ”‚   โ”‚   โ”œโ”€โ”€ signup.html
โ”‚   โ”‚   โ”œโ”€โ”€ upload.html
โ”‚   โ”‚   โ”œโ”€โ”€ dashboard.html
โ”‚   โ”‚   โ”œโ”€โ”€ tickets.html
โ”‚   โ”‚   โ””โ”€โ”€ developers.html
โ”‚   โ””โ”€โ”€ config.py                # Settings and env variable validation
โ”œโ”€โ”€ .github/
โ”‚   โ””โ”€โ”€ workflows/
โ”‚       โ”œโ”€โ”€ ci.yml
โ”‚       โ”œโ”€โ”€ secret-hygiene.yml
โ”‚       โ””โ”€โ”€ uptime-checks.yml
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ README.md

๐Ÿš€ Quick Start

# Clone the repository
git clone https://github.com/LegendarySumit/TechFixAI.git
cd TechFixAI

# Create and activate virtual environment
python -m venv .venv

# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run the development server
uvicorn app.main:app --reload

Open โ†’ http://127.0.0.1:8000


โš™๏ธ Configuration

Required in Production

SECRET_KEY=your_secret_key
DATABASE_URL=postgresql://...
CORS_ORIGINS=https://your-frontend.vercel.app

Common Production Variables

PUBLIC_DEPLOYMENT=true
FORCE_HTTPS=true
SESSION_COOKIE_SECURE=true
APP_BASE_URL=https://your-backend-domain.onrender.com
ADMIN_EMAILS=[email protected],[email protected]

AI Service Keys

GROQ_API_KEY=your_groq_key        # Required
OPENAI_API_KEY=your_openai_key    # Optional fallback
GEMINI_API_KEY=your_gemini_key    # Optional fallback

Google OAuth

GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
GOOGLE_REDIRECT_URI=https://your-backend-domain.onrender.com/auth/google/callback

SMTP (Optional)

SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=[email protected]
SMTP_PASSWORD=your_password
FROM_EMAIL=[email protected]

โš ๏ธ APP_BASE_URL must point to the backend URL. CORS_ORIGINS must contain frontend origin(s). No trailing slashes.

Deploy On Render + Neon (Backend Only)

  1. Create a Neon Postgres project and copy the pooled connection string.
  2. In Render, create a new Web Service from this repository.
  3. Keep these commands:
    • Build: pip install -r requirements.txt
    • Start: uvicorn app.main:app --host 0.0.0.0 --port $PORT --proxy-headers --forwarded-allow-ips=*
  4. Set DATABASE_URL in Render using your Neon connection string.
  5. Set required env vars in Render: SECRET_KEY, APP_BASE_URL, CORS_ORIGINS, GROQ_API_KEY (plus OAuth/SMTP if used).
  6. Set health check path to /health.

Example Neon URL format:

DATABASE_URL=postgresql://<user>:<password>@<neon-host>/<db>?sslmode=require

This repository now includes a Render blueprint at render.yaml for backend-only deployment.


๐Ÿ“š Usage

  1. Sign up or log in at /signup or /login โ€” Google OAuth available
  2. Upload a voice report at /upload โ€” select a Japanese audio file and submit
  3. The pipeline runs in the background: transcription โ†’ translation โ†’ ticket โ†’ assignment
  4. Track tickets at /tickets โ€” click any ticket for full detail
  5. Chat transcription โ€” use the voice helper to transcribe without creating a ticket
  6. Admin dashboard at /dashboard โ€” stats, developer workload, conversation logs

๐Ÿ”Œ API Endpoints

Voice

Method Endpoint Description
POST /api/voice/upload Upload audio, start pipeline
POST /api/voice/chat-transcribe STT + translation only, no ticket
GET /api/voice/status/{conversation_id} Poll processing status

Tickets

Method Endpoint Description
GET /api/tickets List tickets with filters
GET /api/tickets/{ticket_number} Ticket detail
PATCH /api/tickets/{ticket_number}/status Update status (admin)
DELETE /api/tickets/{ticket_number} Delete ticket (owner or admin)

Admin

Method Endpoint Description
GET /api/admin/dashboard Aggregated stats (auth required)
GET /api/admin/conversations Conversation list (auth required)
GET /api/admin/developers Developer stats (auth required)

Auth & Observability

Method Endpoint Description
GET /auth/google Initiate Google OAuth
GET /auth/google/callback OAuth callback
GET /health Health check (200 healthy, 503 degraded)
GET /metrics Prometheus metrics (when enabled)

๐Ÿง  Deterministic Assignment Rules

Assignment is fully rule-based โ€” no randomness:

  1. Backend/infrastructure + high or critical โ†’ Backend team
  2. Frontend/UI incident โ†’ Frontend team
  3. Database + high or critical โ†’ Backend team
  4. Fallback โ†’ Least loaded developer

๐Ÿ› Troubleshooting

Startup fails during settings load?

  • Verify CORS_ORIGINS is not empty and uses a valid format
  • Ensure APP_BASE_URL points to the backend domain, not the frontend
  • Confirm DATABASE_URL is a valid PostgreSQL connection string

Voice upload not processing?

  • Check that GROQ_API_KEY is set and valid
  • Poll /api/voice/status/{conversation_id} for pipeline progress

Google OAuth failing?

  • Ensure GOOGLE_REDIRECT_URI matches exactly what's registered in Google Cloud Console

๐Ÿ”ฎ Future Enhancements

  • Multi-language support beyond Japanese
  • Slack / Teams notifications on ticket creation
  • SLA tracking and breach alerts
  • ML-based developer assignment
  • Mobile app for on-the-go voice reporting
  • Webhook support for external integrations
  • Role-based access control (RBAC) for teams

๐Ÿ“„ License

This project is licensed under a Proprietary All Rights Reserved License. See the LICENSE file for details.


๐Ÿ‘จโ€๐Ÿ’ป Author

LegendarySumit


๐ŸŽ™๏ธ From voice to resolved โ€” no translation lost.

TechFixAI ยท Built for Japanese engineering teams


โญ Star this repo if you find it helpful!

About

TechFixAI is an enterprise-grade automated incident intake and routing system that transforms multilingual voice input into structured, actionable support tickets with intelligent developer assignment.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors