A full-stack financial technology application that fetches, stores, and visualizes stock market data with interactive charts and real-time analytics.
Live Demo β’ Quick Start β’ Features β’ API Docs β’ Deploy
Try it now!
- Frontend Dashboard: https://your-demo-link.com
- API Documentation: https://your-demo-link.com/docs
- Sample API Call:
GET /api/stocks/AAPL
Demo fetches real stock data for Apple, Google, Tesla, and more!
- Real-time stock price charts with Recharts
- 30-day historical data visualization
- Price, volume, and technical indicators
- Responsive design for mobile and desktop
- FastAPI backend with automatic OpenAPI documentation
- RESTful endpoints for stock data management
- Real-time data fetching from Yahoo Finance
- Comprehensive error handling and validation
- PostgreSQL database with SQLAlchemy ORM
- Efficient data storage and retrieval
- Database migrations and schema management
- Support for SQLite (development) and PostgreSQL (production)
- Docker containerization for consistent deployments
- Ansible automation for Infrastructure as Code
- Nginx reverse proxy with SSL support
- GitHub Actions CI/CD pipeline
- Health monitoring and logging
- CORS configuration for secure API access
- Environment-based configuration
- Automated testing and quality checks
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | React 18, Recharts, Axios | Interactive dashboard and data visualization |
| Backend | Python 3.11, FastAPI, SQLAlchemy | High-performance API and business logic |
| Database | PostgreSQL, SQLite | Data persistence and management |
| Infrastructure | Docker, Docker Compose | Containerization and orchestration |
| Deployment | Ansible, Nginx, AWS EC2 | Automated deployment and hosting |
| DevOps | GitHub Actions, pytest, ESLint | CI/CD, testing, and code quality |
# Clone the repository
git clone https://github.com/sanketyelave/mini-quant.git
cd mini-quant
# Start all services with Docker
docker-compose up --build
# Access the application
open http://localhost:5173 # Frontend Dashboard
open http://localhost:8000/docs # API DocumentationThat's it! The application will be running with:
- β React frontend on port 3000
- β FastAPI backend on port 8000
- β PostgreSQL database in container
- β Sample stock data ready to explore
Click to expand manual setup instructions
cd backend
python -m venv venv
# Activate virtual environment
source venv/bin/activate # macOS/Linux
# OR
venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Start the API server
python app.pycd frontend
npm install
npm start# Backend (.env)
DATABASE_URL=sqlite:///./stock_data.db
CORS_ORIGINS=http://localhost:5173
# Frontend (.env)
REACT_APP_API_URL=http://localhost:8000| Method | Endpoint | Description | Example |
|---|---|---|---|
GET |
/api/health |
Health check | {"status": "ok"} |
GET |
/api/stocks/{symbol} |
Get historical data | GET /api/stocks/AAPL |
POST |
/api/stocks/fetch/{symbol} |
Fetch fresh data | POST /api/stocks/fetch/TSLA |
# Fetch latest Tesla stock data
curl -X POST "http://localhost:8000/api/stocks/fetch/TSLA"
# Get historical data
curl "http://localhost:8000/api/stocks/TSLA"
# Health check
curl "http://localhost:8000/api/health"Visit http://localhost:8000/docs for complete interactive API documentation with:
- Request/response schemas
- Try-it-now functionality
- Authentication examples
- Error code references
# Using Make (recommended)
make test
# Manual testing
cd backend && pytest -v
cd frontend && npm test# Backend coverage
cd backend && pytest --cov=. --cov-report=html
# Frontend coverage
cd frontend && npm test -- --coverage --watchAll=falseThe application includes test endpoints with sample data for:
- AAPL (Apple Inc.)
- GOOGL (Alphabet Inc.)
- TSLA (Tesla Inc.)
- MSFT (Microsoft Corporation)
# Production build
docker-compose -f docker-compose.prod.yml up --build -d
# Check status
docker-compose psClick for complete AWS deployment guide
- AWS account with EC2 access
- SSH key pair for server access
- Domain name (optional, for SSL)
# Instance specifications
- AMI: Ubuntu Server 22.04 LTS
- Type: t3.small (recommended) or t2.micro (free tier)
- Security Groups: HTTP (80), HTTPS (443), SSH (22), Custom (8000)Add these secrets in Settings β Secrets and variables β Actions:
| Secret Name | Value | Example |
|---|---|---|
SERVER_HOST |
Your EC2 public IP | 18.191.45.123 |
SERVER_USER |
SSH username | ubuntu |
SSH_PRIVATE_KEY |
Private key content | -----BEGIN RSA PRIVATE KEY-----... |
DB_PASSWORD |
Database password | SecurePassword123! |
SSL_EMAIL |
Your email for SSL | your-email@example.com |
cd deployment/ansible
# Configure inventory
cp inventory.yml.example inventory.yml
# Edit with your server details
# Deploy
ansible-playbook -i inventory.yml playbook.yml# Check application health
curl http://YOUR_SERVER_IP/api/health
# Access dashboard
open http://YOUR_SERVER_IPEvery push to main branch automatically:
- β Runs comprehensive tests
- β Builds optimized Docker images
- β Deploys to production server
- β Performs health checks
- β Sends deployment notifications
mini-quant/
βββ π¨ frontend/ # React Dashboard
β βββ src/
β β βββ App.js # Main component with charts
β β βββ App.css # Responsive styles
β β βββ App.test.js # Component tests
β βββ package.json # Dependencies & scripts
β βββ Dockerfile # Frontend container
βββ π backend/ # FastAPI Backend
β βββ app.py # Main API application
β βββ models.py # Database models
β βββ database.py # Database configuration
β βββ requirements.txt # Python dependencies
β βββ test_app.py # API tests
β βββ Dockerfile # Backend container
βββ π deployment/ # Infrastructure as Code
β βββ ansible/ # Deployment automation
β β βββ playbook.yml # Main deployment playbook
β β βββ inventory.yml # Server configuration
β β βββ templates/ # Service templates
β βββ nginx/ # Web server configuration
βββ π .github/workflows/ # CI/CD Pipelines
β βββ deploy.yml # Main deployment workflow
β βββ pr-check.yml # Pull request checks
βββ π³ docker-compose.yml # Development environment
βββ π README.md # This file
βββ π« .gitignore # Git ignore rules
βββ βοΈ Makefile # Development commands
Interactive stock dashboard with real-time charts and analytics
Automatic OpenAPI documentation with try-it-now functionality
We welcome contributions! Here's how to get started:
# Fork and clone
git clone https://github.com/sanketyelave/mini-quant.git
cd mini-quant
# Create feature branch
git checkout -b feature/amazing-feature
# Make changes and test
make test
make lint
# Commit and push
git commit -m "Add amazing feature"
git push origin feature/amazing-feature
# Create Pull Request- Follow existing code style and conventions
- Add tests for new features
- Update documentation as needed
- Ensure all CI checks pass
- Check existing issues
- Create detailed bug report with reproduction steps
- Include system information and error logs
- API Response Time: < 100ms average
- Dashboard Load Time: < 2 seconds
- Data Processing: 1000+ stock symbols supported
- Concurrent Users: 100+ simultaneous connections
- Horizontal scaling with Docker Swarm/Kubernetes
- Database connection pooling
- Caching layer support (Redis integration ready)
- Load balancer configuration included
- CORS protection for API endpoints
- Input validation and sanitization
- SQL injection prevention with SQLAlchemy ORM
- Environment variable security for secrets
- Regular security updates via automated CI/CD
- Enable HTTPS with SSL certificates
- Configure firewall rules
- Set up database authentication
- Enable API rate limiting
- Monitor security logs
- Real-time WebSocket Updates: Live price streaming
- Advanced Analytics: Technical indicators (RSI, MACD, Bollinger Bands)
- User Authentication: JWT-based login system
- Portfolio Management: Track multiple investments
- Mobile App: React Native companion app
- Machine Learning: Price prediction algorithms
- News Integration: Real-time financial news
- Social Features: Community insights and discussions
- Enterprise SSO: LDAP/SAML integration
- Multi-market Support: International stock exchanges
Common Issues and Solutions
Problem: ModuleNotFoundError: No module named 'fastapi'
# Solution: Activate virtual environment
cd backend
source venv/bin/activate # macOS/Linux
pip install -r requirements.txtProblem: Database connection error
# Solution: Check database URL
echo $DATABASE_URL
# Ensure PostgreSQL is running (Docker: docker-compose up -d postgres)Problem: Cannot connect to backend API
# Solution: Verify backend is running
curl http://localhost:8000/api/health
# Check REACT_APP_API_URL in .envProblem: Chart not displaying
# Solution: Clear npm cache and reinstall
rm -rf node_modules package-lock.json
npm install- π Bug Reports: GitHub Issues
- π‘ Feature Requests: GitHub Discussions
- π§ Email: your-email@example.com
- πΌ LinkedIn: Your LinkedIn Profile
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License - Feel free to use this project for learning, portfolio, or commercial purposes!
- Yahoo Finance API for providing reliable stock market data
- FastAPI Team for the incredible Python web framework
- React Community for the powerful frontend ecosystem
- Ansible Community for Infrastructure as Code tools
- Open Source Contributors who make projects like this possible
- Financial data providers and market data APIs
- DevOps and cloud infrastructure communities
- Beta testers and early feedback providers
Built with β€οΈ by Sanket Yelave
Showcasing modern full-stack development with Python, React, and DevOps best practices
π Ready to deploy your own financial dashboard?
Fork this repository and start building!