How herol3oy/austen works
Project Type & Purpose
• The application offers both client-side (Angular UI with Angular Material and component-based pages) and server-side functionalities (server routes, middleware for authentication, and API endpoints).
File Structure
• Top-level configuration files (e.g., angular.json, package.json, tsconfig files, etc.) indicate an Angular project with a custom setup using Analog for server-side rendering.
• Additional folders (public, screenshots) serve static assets and UI references.
Key Components
a. Frontend (Angular Client):
• Core Angular Application:
• Entry points: main.ts and main.server.ts.
• App components and configuration: app.component, app.config.ts, and app.config.server.ts.
• UI Layer:
• Components: Various UI components like topbar, graph card, confirm dialog.
• Pages: Auth pages (login), Home, About, Countries, Discover, My Graphs, etc.
• Service Layer on the Client:
• Styling & Assets:
• Global styles (styles.scss) and other assets like index.html and content in the public folder.
b. Backend / Server:
• API Endpoints:
• Under “src/server/routes/v1”: Routes like getMermaidSyntax.ts that process requests.
• Middleware:
• Authentication (auth.ts) that manages access to routes.
• Integration with Supabase:
• Interaction with Supabase (src/server/supabase.ts) to store and retrieve graph data.
c. External Services & APIs:
• External APIs:
• Open Library for book search.
• DeepSeek and OpenAI for AI-powered character analysis.
• Database:
• Supabase is used as the primary datastore (graphs table with fields for id, book_name, author_name, svg_graph, mermaid_syntax, emojis, user_id, is_public, created_at) as described in the README.
• Deployment & Hosting:
• Cloudflare Pages is mentioned as part of the stack for hosting.
Relationships & Interactions
• The Angular client interacts with the server backend through well-defined API endpoints. For instance, when generating a graph, the client calls an endpoint (e.g., getMermaidSyntax) which in turn may query Supabase or trigger an AI analysis.
• The services in the Angular app encapsulate calls to external APIs (Open Library, DeepSeek, OpenAI) to retrieve book data and AI results.
• The server side uses middleware (auth.ts) to secure its APIs before data or AI processing is handled.
• The design should clearly illustrate data flow: from user actions in the UI to service calls, API backend processing, and storage/retrieval in Supabase.
Architectural Patterns & Elements to Highlight
• Separation between the client (Angular frontend) and the server (API routes, middleware). This separation is key in a full-stack application.
• How Angular modules and components follow a modular UI design pattern.
• How external services and APIs integrate with both the frontend and backend, serving as crucial pillars of functionality.
• Mention that both server-side rendering (SSR using Analog) and API-driven interactions are part of the system’s design.