A production-grade, minimal-UI algorithmic trading web application inspired by managersalgo.com with a cleaner, faster, and more modular architecture.
- 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
- 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
- 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
- Docker - Containerization
- Docker Compose - Multi-container orchestration
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
- Docker and Docker Compose
- Node.js 18+ (for local development)
- Python 3.11+ (for local development)
-
Clone the repository
git clone <repository-url> cd 369algo
-
Copy environment file
cp env.example .env
-
Start all services
docker-compose up -d
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
-
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
-
Frontend Setup
cd frontend npm install npm run dev
-
Database Setup
# Start PostgreSQL and Redis docker-compose up postgres redis -d # Run database migrations alembic upgrade head
- Visual interface for creating trading strategies
- Support for common strategies: SMA Crossover, RSI, Bollinger Bands
- Parameter configuration and validation
- Real-time strategy preview
- Historical data import and management
- Asynchronous backtesting with Celery
- Comprehensive performance metrics
- Export results as PDF/CSV
- Paper trading for strategy testing
- Live trading with broker integration
- Real-time trade execution and monitoring
- Risk management and position sizing
- Real-time portfolio tracking
- Performance analytics and reporting
- Risk metrics and diversification analysis
- Position management
- Real-time price feeds
- Historical data management
- Market news and analysis
- Symbol management
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
# Create a new migration
alembic revision --autogenerate -m "Description"
# Apply migrations
alembic upgrade head
# Rollback migration
alembic downgrade -1
# Backend tests
cd backend
pytest
# Frontend tests
cd frontend
npm test
- 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
- JWT-based authentication
- Password hashing with bcrypt
- CORS configuration
- Input validation with Pydantic
- SQL injection prevention with SQLAlchemy ORM
- Update environment variables for production
- Configure reverse proxy (Nginx)
- Set up SSL certificates
- Configure monitoring and logging
- Set up backup strategies
# Build production images
docker-compose -f docker-compose.prod.yml build
# Deploy to production
docker-compose -f docker-compose.prod.yml up -d
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Contact the development team
- Check the documentation
- 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.