How mohamed-samehh/financial-advisor works
Project type and purpose
• This is a multi‐platform financial advisor system.
• Two client UIs: an Angular SPA for web, a Flutter app for mobile/desktop/web.
• A primary backend in Laravel (REST API, business data, authentication, email).
• A separate Flask microservice for machine learning (model inference & data analysis).
• A relational database (MySQL/PostgreSQL) for user/finance data, plus email/queue services.
File structure
• Top-level “Angular” folder: an Angular 14+ web client (components for login, dashboard, expenses, chatbot, etc.).
• “Flutter”: cross-platform mobile & desktop client. Routes, screens mirror Angular features; calls the same REST API.
• “Laravel”: core API service (Controllers, Models, Migrations, Middleware, Mail, Routes). Implements authentication, budgeting, expenses, goals, categories, chatbot proxy.
• “Flask”: lightweight ML microservice (app.py, business_logic.py, ml_models.py). Exposes endpoints consumed by Laravel or directly by frontends for AI predictions.
README
• Confirms: personalized financial recommendations via AI/ML.
• Backends must orchestrate data flows between user data in DB and ML models.
a. Main components
• Clients: Angular Web App; Flutter Mobile/Desktop App
• API Gateway/Backend: Laravel
• ML Service: Flask microservice
• Persistence: Relational Database
• External services: SMTP/email provider; (optionally) third-party market/stock data APIs
• Infrastructure: Load balancer, Docker/K8s (if used), CI/CD pipeline
b. Relationships & interactions
1. User interacts with Angular or Flutter → sends HTTPS requests to Laravel API.
2. Laravel authenticates (Sanctum/JWT), reads/writes DB, queues emails.
3. For financial insights, Laravel forwards relevant data → Flask ML microservice → returns predictions/analysis.
4. Laravel aggregates ML response + database records → JSON → clients.
5. Laravel sends emails via SMTP service.
c. Architectural patterns & principles
• Microservices: separate ML logic (Flask) from business logic (Laravel).
• MVC in Laravel: Controllers → Models → Migrations.
• Modular frontends: Angular modules, Flutter screens and services.
• Service layer in clients: api_service.ts, auth_service.dart.
• Security: API Guard (Angular auth.guard), Laravel middleware for CORS/auth.
d. Key technologies & libraries
• Frontends: Angular, TypeScript, RxJS; Flutter, Dart.
• Backend: Laravel (PHP 8+, Sanctum, Eloquent ORM, Mail), Flask (Python 3, scikit-learn / TensorFlow).
• Database: MySQL or PostgreSQL.
• Dev & CI: Docker, Git, GitHub Actions, Composer, npm, pub.
Elements
• Blue for frontend clients
• Green for core backend (Laravel)
• Orange for ML microservice (Flask)
• Gray for infrastructure/external services
• Clouds for external services
• Rectangles for applications/microservices