How arxane/semantic-code-refactorer works
Project type and purpose
• This is a full-stack web application (“AI Semantic Code Refactorer”)
• Frontend: React (in frontend/)
• Backend: FastAPI (in app/), Python 3.8+
• Database: PostgreSQL, with Alembic migrations
• External AI service: OpenAI API
File structure
• Top-level folders:
• frontend/ → React SPA (package.json, src/)
• app/ → FastAPI application
– core/ (config, DB connection)
– models/ (SQLAlchemy ORM models)
– schemas/ (Pydantic request/response models)
– routes/ (API endpoints)
– services/ (business logic, AI refactoring modules)
• alembic/ → migration scripts for schema versioning
• tests/ → integration/unit tests
• requirements.txt, .env.example
README
• Confirms key components, tech stack, and runtime flow
• Describes features: semantic analysis, refactor suggestions, feedback loop
Elements
• Labels: “React Frontend,” “FastAPI API,” “AI Service,” “PostgreSQL DB,” “OpenAI”
• User actions → Frontend
• Frontend API calls → FastAPI
• FastAPI → Service layer & DB → OpenAI
Detailed capture of essential architecture
• main.py bootstraps the app, includes routes
• core/config.py reads env vars
• core/database.py initializes SQLAlchemy engine & sessions
• models/ ↔ ORM mapping
• schemas/ ↔ request/response contracts
• services/ ↔ AI logic (real vs. mock)
• Migration flow: Alembic CLI → alembic/env.py → versions → PostgreSQL