How k-aniket-01/chartliz works
Project type and purpose
• ChartLiz is a full-stack web application (Django MVC) that acts as a real-time stock trading assistant.
• It provides paper-trade simulation, candlestick pattern recognition, educational pages, and WebSocket-driven live updates.
File structure
• Top-level:
• manage.py, db.sqlite3 (local DB placeholder), requirements.txt
• ChartLiz/ (Django project folder with settings.py, asgi.py, wsgi.py, urls.py, models.py, views.py, admin.py, signals.py)
• migrations/ (database schema history)
• static/ (styles.css, PDF resources for patterns and strategy)
• templates/ (Django HTML templates for all pages: index, dashboard, buy/sell forms, portfolio, learn, etc.)
• README.md describes tech stack and usage.
README for additional insights
• Tech: Python, Django, MySQL (production), WebSockets (real-time stock feed), HTML/CSS templates.
• Features: candlestick pattern recognition (PDF docs under static), paper trading simulation (models for Buy/Sell/Portfolio/Transaction), real-time updates via WebSocket channels (asgi.py indicates ASGI setup).
Main components
a. Frontend (Client browsers)
• HTTP requests → Django views & templates
• WebSocket client (JS) → ASGI/WebSocket endpoint
b. Django Application Server
• URL router → Views (MVC controller)
• Templates (views render HTML)
• Models (ORM)
• Signals (e.g., post-save hooks for transactions or notifications)
c. Database (MySQL in production; SQLite in dev)
• Tables: User/Profile, Buy, Sell, Portfolio, Transaction
d. Real-time Data Ingestion
• External Stock Market Data API → WebSocket publisher inside Django (via Channels or custom ASGI consumer)
e. External Services
• Email/SMS notification service (if implemented)
• Third-party authentication (optional)
f. Static & Media
• Styles, PDF docs served via Django’s static files mechanism
Relationships and interactions
• User’s browser
↔ (HTTP) Django URLs → Views → Templates → back to browser
↔ (WebSocket) ASGI consumer → pushes real-time updates
• Views/Controllers
↔ (ORM) Database for CRUD on trades, portfolios
• ASGI Consumer
↔ External Stock API for live quotes
→ broadcast to connected clients
• Signals
↔ triggered on model events → e.g., send notifications
Architectural patterns & design principles
• MVC (Model-View-Controller) inherent in Django
• Event-driven messaging (WebSockets) for real-time updates
• Layered design: Presentation (templates, CSS), Application (views, consumers), Data (models, DB), Integration (external APIs)
Essential details to capture
• Both HTTP and WebSocket pathways
• ORM models and their persistence to DB
• How real-time stock data flows from the external API through the ASGI consumer to the browser
• Where user-triggered trades (buy/sell) flow from frontend to views to DB and back