How ama-matioc/genart works
Project type and purpose
• From the file tree and minimal README, we see a frontend folder with a React application (components, contexts, Firebase integrations) and a backend folder containing Python scripts (app.py, img2img.py, txt2img.py).
• This is a full-stack web application for “GenArt,” a generative-art platform built as a bachelor thesis. The frontend provides a single-page UI for users to register/login, generate images from text or images, view a gallery, and store results. The backend exposes REST endpoints to orchestrate ML generation pipelines. Firebase handles authentication and storage of generated assets.
File structure
• Top-level directories:
• backend/ (Python Flask or FastAPI app with two generation modules)
• frontend/ (React SPA with Context API & Firebase integration)
• Key patterns:
• SPA communicates over HTTP to a backend API
• BaaS for user management and storage (Firebase)
• Config files: package.json (frontend dependencies), backend/app.py (API server bootstrap).
README for additional insights
a. Main components
• User’s Browser (UI)
• React SPA (components, AuthContext)
• Firebase Auth (external service)
• Firebase Storage (external)
• Backend API server (app.py)
• ML Modules (txt2img.py, img2img.py)
• Optional: Web server / hosting (e.g., Netlify, AWS S3 + CloudFront)
b. Relationships and interactions
• User → React SPA (UI interactions)
• React SPA ↔ Firebase Auth (sign-up / login / JWT issuance)
• React SPA → Backend API (HTTP POST /generate-txt2img or /generate-img2img with auth token)
• Backend API → ML Modules (library calls, local function invocation)
• Backend API → Firebase Storage (upload generated images)
• React SPA → Firebase Storage (retrieve images for gallery)
c. Architectural patterns / design principles
• Single‐page application front-end
• RESTful API backend
• Separation of concerns: UI, business logic, ML processing, storage, auth
• External BaaS for common cross‐cutting requirements
d. Relevant technologies/frameworks
• Frontend: React, Context API, Firebase JS SDK, CSS
• Backend: Python (Flask or FastAPI), ML libraries in txt2img.py and img2img.py
• External services: Google Firebase Auth & Storage
Detail
• Subcomponents inside the SPA: AuthContext, Generator components.
• Python scripts as distinct modules invoked by the API server.
• Data payload structure (e.g., image bytes, tokens).