How ypoonia/tryai works
Project type and purpose
• This is a Python-based backend service called “Store Monitoring System.”
• It exposes REST endpoints, processes data both synchronously and asynchronously (Celery), performs CRUD against a database, runs computing algorithms, and generates reports.
File structure
Top-level view:
• app/
• controllers/ ← HTTP request handlers invoking business logic
• core/ ← configuration (e.g., FastAPI settings, Celery config)
• database/ ← CRUD methods, DB session management
• models/ ← ORM classes for database tables
• schemas/ ← Pydantic request/response models
• routes/ ← FastAPI routers binding endpoints to controllers
• services/ ← domain logic (e.g., compute_Algo, report_service)
• tasks/ ← Celery task definitions for background jobs
• utils/ ← helper modules (e.g., URL resolver)
• celery_app.py ← Celery app factory
• main_rcs.py ← FastAPI app initialization & router mounting
• reports.json ← static or seed data for reports
• requirements.txt ← dependencies (FastAPI, SQLAlchemy, Celery, etc.)
README for additional insights
• Project is called “Store Monitoring System.”
• There’s an existing Excalidraw deck and Google Doc describing workflows.
• Features likely include data ingestion, real-time monitoring, scheduled reports, background processing.
a. Main components:
1. Client / Consumer (Web UI or external service)
2. API Layer (FastAPI in main_rcs.py + routes + controllers)
3. Business Logic Layer (services package)
4. Database (SQL database accessed via database/crud.py + models)
5. Task Queue & Worker (Celery broker, celery_app.py + tasks)
6. External/Internal Utilities (url_resolver, static reports.json)
b. Relationships & Interactions:
• Client → HTTP → FastAPI Routes → Controllers
• Controllers ↔ Schemas (validate input/output)
• Controllers → Services → CRUD (sync operations for reads/writes)
• Controllers → Celery Tasks (for long-running report jobs)
• Celery Worker → Services (compute_Algo, report_service) → Database updates & report storage
• Database → Controllers (fetching compiled monitoring data)
c. Architectural patterns & principles:
• Layered architecture (Presentation, Controllers, Services, Data Access)
• Separation of sync vs. async paths (FastAPI vs. Celery)
• Dependency injection via config in app/core/config.py
• Use of Pydantic schemas for strong typing and validation
• Modular folder structure for testability and maintainability
d. Key technologies & frameworks:
• FastAPI (HTTP server, routing)
• Pydantic (schemas)
• SQLAlchemy or similar ORM (models + CRUD)
• Celery (task queue) + broker (e.g., Redis/RabbitMQ)
• Python compute libraries (e.g., NumPy in compute_Algo)
• External docs / reporting tools (Google Docs, Excalidraw referenced)