Skip to content

Professional Trading Web Application with React + FastAPI | Real-time Market Data | Portfolio Management | Financial News | Team Collaboration Platform

Notifications You must be signed in to change notification settings

r4r00t-sh/369Algo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

369 Algo - Algorithmic Trading Platform

A production-grade, minimal-UI algorithmic trading web application inspired by managersalgo.com with a cleaner, faster, and more modular architecture.

๐Ÿš€ Features

  • Zero-Code Strategy Builder: Visual drag-and-drop interface for creating trading strategies
  • Advanced Backtesting: Test strategies against historical data with detailed performance metrics
  • Live Trading: Execute strategies in paper and live trading modes
  • Real-time Charts: Integrated TradingView widgets for market analysis
  • Portfolio Management: Track performance, positions, and risk metrics
  • Multi-Broker Support: Integration with Zerodha, Angel One, and other brokers
  • WebSocket Updates: Real-time trade and market data streaming
  • User Management: Secure authentication and profile management

๐Ÿ›  Tech Stack

Backend

  • FastAPI - Modern, fast web framework for building APIs
  • PostgreSQL - Primary database for data persistence
  • Redis - Caching and message broker
  • Celery - Distributed task queue for backtesting
  • SQLAlchemy - ORM for database operations
  • JWT - Authentication and authorization

Frontend

  • React 18 - Modern UI library
  • Vite - Fast build tool and dev server
  • TailwindCSS - Utility-first CSS framework
  • Framer Motion - Animation library
  • Recharts - Charting library
  • Socket.IO - Real-time communication

Infrastructure

  • Docker - Containerization
  • Docker Compose - Multi-container orchestration

๐Ÿ“ Project Structure

369algo/
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ main.py                 # FastAPI application entry point
โ”‚   โ”œโ”€โ”€ routers/                # API route handlers
โ”‚   โ”œโ”€โ”€ models/                 # Database models
โ”‚   โ”œโ”€โ”€ schemas/                # Pydantic schemas
โ”‚   โ”œโ”€โ”€ database/               # Database configuration
โ”‚   โ”œโ”€โ”€ websocket/              # WebSocket management
โ”‚   โ”œโ”€โ”€ workers/                # Celery workers
โ”‚   โ”œโ”€โ”€ utils/                  # Utility functions
โ”‚   โ””โ”€โ”€ requirements.txt        # Python dependencies
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/         # React components
โ”‚   โ”‚   โ”œโ”€โ”€ pages/              # Page components
โ”‚   โ”‚   โ”œโ”€โ”€ contexts/           # React contexts
โ”‚   โ”‚   โ”œโ”€โ”€ hooks/              # Custom hooks
โ”‚   โ”‚   โ””โ”€โ”€ assets/             # Static assets
โ”‚   โ”œโ”€โ”€ package.json            # Node.js dependencies
โ”‚   โ””โ”€โ”€ tailwind.config.js      # TailwindCSS configuration
โ”œโ”€โ”€ docker-compose.yml          # Docker Compose configuration
โ””โ”€โ”€ README.md                   # This file

๐Ÿš€ Quick Start

Prerequisites

  • Docker and Docker Compose
  • Node.js 18+ (for local development)
  • Python 3.11+ (for local development)

Using Docker (Recommended)

  1. Clone the repository

    git clone <repository-url>
    cd 369algo
  2. Copy environment file

    cp env.example .env
  3. Start all services

    docker-compose up -d
  4. Access the application

Local Development

  1. Backend Setup

    cd backend
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    pip install -r requirements.txt
    uvicorn main:app --reload
  2. Frontend Setup

    cd frontend
    npm install
    npm run dev
  3. Database Setup

    # Start PostgreSQL and Redis
    docker-compose up postgres redis -d
    
    # Run database migrations
    alembic upgrade head

๐Ÿ“Š Core Modules

1. Strategy Builder

  • Visual interface for creating trading strategies
  • Support for common strategies: SMA Crossover, RSI, Bollinger Bands
  • Parameter configuration and validation
  • Real-time strategy preview

2. Backtesting Engine

  • Historical data import and management
  • Asynchronous backtesting with Celery
  • Comprehensive performance metrics
  • Export results as PDF/CSV

3. Live Trading

  • Paper trading for strategy testing
  • Live trading with broker integration
  • Real-time trade execution and monitoring
  • Risk management and position sizing

4. Portfolio Management

  • Real-time portfolio tracking
  • Performance analytics and reporting
  • Risk metrics and diversification analysis
  • Position management

5. Market Data

  • Real-time price feeds
  • Historical data management
  • Market news and analysis
  • Symbol management

๐Ÿ”ง Configuration

Environment Variables

Create a .env file in the root directory with the following variables:

# Database
DATABASE_URL=postgresql://postgres:password@localhost:5432/369algo
ASYNC_DATABASE_URL=postgresql+asyncpg://postgres:password@localhost:5432/369algo

# Redis
REDIS_URL=redis://localhost:6379/0

# JWT
SECRET_KEY=your-secret-key-change-in-production
ACCESS_TOKEN_EXPIRE_MINUTES=30

# Broker APIs (Optional)
ZERODHA_API_KEY=your-zerodha-api-key
ZERODHA_API_SECRET=your-zerodha-api-secret

Database Migrations

# Create a new migration
alembic revision --autogenerate -m "Description"

# Apply migrations
alembic upgrade head

# Rollback migration
alembic downgrade -1

๐Ÿงช Testing

# Backend tests
cd backend
pytest

# Frontend tests
cd frontend
npm test

๐Ÿ“ˆ Performance

  • Backend: FastAPI with async support for high concurrency
  • Database: PostgreSQL with optimized queries and indexing
  • Caching: Redis for session management and data caching
  • Frontend: React with code splitting and lazy loading
  • Real-time: WebSocket connections for live updates

๐Ÿ”’ Security

  • JWT-based authentication
  • Password hashing with bcrypt
  • CORS configuration
  • Input validation with Pydantic
  • SQL injection prevention with SQLAlchemy ORM

๐Ÿš€ Deployment

Production Deployment

  1. Update environment variables for production
  2. Configure reverse proxy (Nginx)
  3. Set up SSL certificates
  4. Configure monitoring and logging
  5. Set up backup strategies

Docker Production

# Build production images
docker-compose -f docker-compose.prod.yml build

# Deploy to production
docker-compose -f docker-compose.prod.yml up -d

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ†˜ Support

For support and questions:

  • Create an issue in the repository
  • Contact the development team
  • Check the documentation

๐Ÿ”ฎ Roadmap

  • Advanced strategy builder with visual flow editor
  • Machine learning strategy suggestions
  • Mobile app (React Native)
  • Advanced risk management tools
  • Social trading features
  • More broker integrations
  • Advanced charting tools
  • Strategy marketplace

Note: This is a demo application. For production use, ensure proper security measures, testing, and compliance with financial regulations.

About

Professional Trading Web Application with React + FastAPI | Real-time Market Data | Portfolio Management | Financial News | Team Collaboration Platform

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published