369 Algo is a comprehensive trading platform built with React TypeScript frontend and Python FastAPI backend, featuring multi-broker support, real-time market data, and portfolio management.
- User Authentication & Authorization - Secure JWT-based authentication system
- Portfolio Management - Create, manage, and track multiple investment portfolios
- Trading Platform - Connect to brokers and place orders
- Market Data - Real-time stock quotes and market information
- Watchlist - Track stocks of interest
- Responsive Dashboard - Modern UI with dark/light theme support
- FastAPI Backend - High-performance Python web framework
- React Frontend - Modern TypeScript-based user interface
- Database Integration - SQLAlchemy with PostgreSQL support
- Real-time Updates - WebSocket support for live market data
- Caching System - Redis-based caching for improved performance
- Type Safety - Full TypeScript implementation
trading-web-app/
โโโ backend/ # Python FastAPI backend
โ โโโ models/ # Database models
โ โ โโโ broker.py # Broker connection models
โ โ โโโ market_data.py # Market data models
โ โ โโโ portfolio.py # Portfolio models
โ โ โโโ trade.py # Trading models
โ โ โโโ user.py # User models
โ โ โโโ watchlist.py # Watchlist models
โ โโโ routers/ # API route handlers
โ โ โโโ auth.py # Authentication routes
โ โ โโโ broker.py # Broker management routes
โ โ โโโ market_data.py # Market data routes
โ โ โโโ portfolio.py # Portfolio routes
โ โ โโโ settings.py # User settings routes
โ โ โโโ trading.py # Trading routes
โ โ โโโ watchlist.py # Watchlist routes
โ โโโ schemas/ # Pydantic data models
โ โโโ services/ # Business logic services
โ โ โโโ broker_service.py # Broker integration
โ โ โโโ cache_service.py # Caching service
โ โ โโโ market_data_service.py # Market data handling
โ โ โโโ portfolio_service.py # Portfolio management
โ โ โโโ timeseries_service.py # Time series data
โ โโโ config.py # Configuration management
โ โโโ database.py # Database connection
โ โโโ main.py # FastAPI application entry point
โ โโโ realtime_updater.py # Real-time data updates
โ โโโ requirements.txt # Python dependencies
โ โโโ docker-compose.yml # Database services
โโโ frontend/ # React TypeScript frontend
โ โโโ src/
โ โ โโโ components/ # Reusable UI components
โ โ โ โโโ common/ # Common components
โ โ โ โ โโโ BrokerConnection.tsx
โ โ โ โ โโโ ErrorBoundary.tsx
โ โ โ โ โโโ ThemeToggle.tsx
โ โ โ โ โโโ TradingViewChart.tsx
โ โ โ โโโ layout/ # Layout components
โ โ โ โโโ Navbar.tsx
โ โ โ โโโ Sidebar.tsx
โ โ โโโ contexts/ # React contexts
โ โ โ โโโ AuthContext.tsx
โ โ โโโ hooks/ # Custom hooks
โ โ โ โโโ useTheme.ts
โ โ โโโ pages/ # Application pages
โ โ โ โโโ Dashboard.tsx
โ โ โ โโโ Login.tsx
โ โ โ โโโ MarketData.tsx
โ โ โ โโโ Portfolio.tsx
โ โ โ โโโ Register.tsx
โ โ โ โโโ Settings.tsx
โ โ โ โโโ Trading.tsx
โ โ โ โโโ Watchlist.tsx
โ โ โโโ services/ # API services
โ โ โ โโโ api.ts
โ โ โโโ styles/ # Styling and themes
โ โ โ โโโ GlobalStyles.ts
โ โ โ โโโ theme.ts
โ โ โโโ types/ # TypeScript type definitions
โ โโโ package.json # Node.js dependencies
โ โโโ tsconfig.json # TypeScript configuration
โโโ README.md # Project documentation
- React - Modern React with latest features
- TypeScript - Type-safe development
- Styled Components - CSS-in-JS styling
- React Router - Client-side routing
- React Icons - Icon library
- Axios - HTTP client for API calls
- FastAPI - Modern, fast web framework
- SQLAlchemy - Database ORM
- PostgreSQL - Primary database
- Redis - Caching and sessions
- JWT - Authentication tokens
- Pydantic - Data validation
- WebSockets - Real-time communication
- Node.js 16+ and npm
- Python 3.8+
- Docker and Docker Compose
- PostgreSQL and Redis
-
Clone the repository
git clone https://github.com/r4r00t-sh/369Algo.git cd 369Algo
-
Set up databases using Docker
cd backend docker-compose up -d
-
Install backend dependencies
cd backend pip install -r requirements.txt
-
Install frontend dependencies
cd frontend npm install
-
Configure environment variables
# Create .env file in backend directory cp .env.example .env # Edit .env with your configuration
-
Start the backend
cd backend python main.py
-
Start the frontend
cd frontend npm start
Create a .env
file in the backend directory:
# Security
SECRET_KEY=your-secret-key-here
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
# Database Configuration
DATABASE_URL=postgresql://user:password@localhost/trading_app
REDIS_URL=redis://localhost:6379
# Broker API Keys (configure as needed)
ZERODHA_API_KEY=your-zerodha-api-key
ZERODHA_API_SECRET=your-zerodha-api-secret
# Market Data APIs (configure as needed)
ALPHA_VANTAGE_API_KEY=your-alpha-vantage-api-key
- Navigate to
/register
to create a new account - Use
/login
to authenticate - JWT tokens are automatically managed by the application
- Create portfolios from the Portfolio page
- Add holdings with current market prices
- Track portfolio performance and P&L
- Connect broker accounts
- Place buy/sell orders
- View trade history and order status
- Global Markets: Search for stocks and companies worldwide
- Indian Markets: Real-time NSE and BSE data with popular stocks
- Real-time Quotes: Live stock quotes and market information
- Market Indices: NIFTY 50, SENSEX, and other major indices
- Market Status: Indian market open/close status with IST timing
- Live News Feed: Real-time financial and business news
- News Categories: Business, Markets, Economy, Technology, Crypto, etc.
- Stock-Specific News: Company and stock-related news
- Breaking News: High-priority market updates
- News Search: Search through financial news articles
- Trending News: Most relevant and popular news
- Add stocks to your personal watchlist
- Monitor real-time price changes
- Customize stock names and descriptions
- Custom Strategy Management: Create, edit, and manage personalized trading strategies
- Strategy Templates: Pre-built strategy templates for quick implementation
- Automated Execution: Schedule and automate strategy execution
- Performance Tracking: Monitor strategy performance with detailed analytics
- Risk Management: Built-in risk management parameters and stop-loss controls
- Backtesting: Test strategies against historical data
- Fyers API Integration: Connect to Fyers trading platform for order execution
- Custom Order Buttons: Pre-configured Buy, Sell, and Basket order buttons
- Strategy Engine: Core strategy execution and management system
- Condition Builder: Visual interface for defining trading conditions
- Risk Calculator: Automated risk assessment and position sizing
- Performance Analytics: Comprehensive strategy performance metrics
- Fyers Service: Backend service for Fyers API integration
- Order Management: Automated order placement and tracking
- OAuth2 Authentication: Secure broker account connection
- Real-time Market Data: Live quotes, charts, and market information
- Order Placement: Buy, Sell, and Basket order execution
- Account Management: Holdings, positions, and order history
- Custom Buttons: Pre-configured order buttons for quick trading
- Token Management: Automatic token refresh and session handling
POST /api/strategy/create
- Create new trading strategyGET /api/strategy/list
- List user strategiesPUT /api/strategy/{id}
- Update strategyDELETE /api/strategy/{id}
- Delete strategyPOST /api/strategy/{id}/toggle
- Toggle strategy statusPOST /api/strategy/{id}/execute
- Execute strategyGET /api/strategy/templates
- Get strategy templatesGET /api/strategy/categories
- Get strategy categories
Backend:
cd backend
python main.py
Frontend:
cd frontend
npm start
The project includes a docker-compose.yml
file for easy database setup:
cd backend
docker-compose up -d
This will start:
- PostgreSQL database
- Redis cache
- Any other required services
POST /api/auth/register
- User registrationPOST /api/auth/login
- User loginGET /api/auth/me
- Get current user
POST /api/trading/broker/connect
- Connect brokerGET /api/trading/broker/connections
- List broker connectionsPOST /api/trading/order
- Place orderGET /api/trading/orders
- Get trade history
POST /api/portfolio/create
- Create portfolioGET /api/portfolio/list
- List portfoliosPOST /api/portfolio/{id}/holdings
- Add holdingGET /api/portfolio/{id}/holdings
- Get holdings
GET /api/market/quote/{symbol}
- Get global stock quoteGET /api/market/search
- Search global stocksGET /api/market/news/{symbol}
- Get stock news
GET /api/news/latest
- Get latest financial news by categoryGET /api/news/categories
- Get available news categoriesGET /api/news/stock/{symbol}
- Get stock-specific newsGET /api/news/search
- Search news articlesGET /api/news/trending
- Get trending financial newsGET /api/news/market-updates
- Get market-specific updatesGET /api/news/breaking
- Get breaking financial news
GET /api/market/indian/quote/{symbol}
- Get Indian stock quote (NSE/BSE)GET /api/market/indian/indices/nse
- Get NSE indices (NIFTY 50, etc.)GET /api/market/indian/indices/bse
- Get BSE indices (SENSEX, etc.)GET /api/market/indian/search
- Search Indian stocksGET /api/market/indian/market-status
- Get Indian market statusGET /api/market/indian/popular-stocks
- Get popular Indian stocks
POST /api/watchlist/add
- Add to watchlistGET /api/watchlist/list
- Get watchlistPUT /api/watchlist/{id}
- Update watchlist itemDELETE /api/watchlist/{id}
- Remove from watchlist
cd backend
docker-compose up -d
-
Build Docker images
docker build -t trading-backend ./backend docker build -t trading-frontend ./frontend
-
Deploy with Docker Compose
docker-compose -f docker-compose.prod.yml up -d
- JWT-based authentication
- Password hashing
- CORS middleware configuration
- Input validation with Pydantic
- SQL injection protection with SQLAlchemy
- Redis caching for frequently accessed data
- Database connection pooling
- Asynchronous API endpoints
- Optimized database queries
cd backend
pytest
cd frontend
npm test
- Get Repository Access - Contact your team lead for access
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request for team review
This project is proprietary software owned by 369 Algo.
- Internal Use Only - For authorized team members and collaborators
- Confidential - Contains proprietary trading algorithms and business logic
- No Public Distribution - Not intended for open source or public use
See the LICENSE file for complete terms and restrictions.
For support and questions:
- Create an issue in the GitHub repository
- Check the documentation
- Contact your team lead or project manager
- Use your team's communication channels (Slack, Teams, etc.)
- Enhanced real-time WebSocket market data
- Advanced charting with TradingView integration
- Mobile app (React Native)
- Algorithmic trading strategies
- Social trading features
- Advanced portfolio analytics
- Multi-currency support
- Tax reporting and compliance
- GraphQL API implementation
- Microservices architecture
- Kubernetes deployment
- CDN integration
- Advanced caching strategies
Built with โค๏ธ using modern web technologies
App Name: 369 Algo
Repository: https://github.com/r4r00t-sh/369Algo.git