Open Terminal is a Flask-based application for traders that provides a secure login system using AngelOne API, registration, and a protected dashboard. The app utilizes SQLite for database management, Flask-SQLAlchemy for ORM, and Redis for caching.
- User Registration: Users can register by providing their username, client ID, and API key
- Login Authentication: Secure login using AngelOne's API, with session management and access token storage
- Protected Dashboard: Accessible only to authenticated users
- Watchlists: Create, update, and delete watchlists (up to 5 per user)
- Watchlist Items: Add, remove, and manage items in watchlists
- Real-time Data: Display of real-time market data for watchlist items
- Market Depth: Level 2 order book display
- Search Functionality: Search for symbols to add to watchlists
- Market Indices: Display of NIFTY and SENSEX indices
- Customizable Settings: Users can customize their watchlist display settings
- Secure Logout: Removes the access token from the database and logs the user out
- Modern UI: Uses Tailwind CSS and DaisyUI for a consistent, modern interface
- Framework: Flask, Flask-SQLAlchemy, Flask-Login, Flask-WTF
- Database: SQLite
- Caching: Redis
- API Integration: AngelOne API for user authentication and market data
- Task Scheduling: APScheduler
- Timezone: pytz for timezone handling
- CSS Framework: Tailwind CSS
- UI Components: DaisyUI
- JavaScript: Modern ES6+ with modular architecture
- Real-time Updates: WebSocket integration
openterminal/
├── app.py # Application entry point
├── config.py # Flask configuration
├── extensions.py # Database and extensions
├── master_contract.py # Market data handling
├── models.py # Database models
├── triggerdb.py # Database triggers
├── README.md # Project documentation
├── requirements.txt # Dependencies
├── vercel.json # Vercel deployment configuration
├── instance/ # Instance-specific data
├── routes/
│ ├── __init__.py
│ ├── auth.py # Authentication routes
│ ├── funds.py # Funds routes
│ ├── home.py # Home routes
│ ├── orders.py # Order management
│ └── dashboard/
│ ├── __init__.py
│ ├── market_data_service.py
│ ├── routes.py
│ ├── settings_service.py
│ ├── utils.py
│ └── watchlist_service.py
├── static/
│ └── js/
│ ├── dashboard.js # Main dashboard logic
│ └── modules/
│ ├── marketDataDecoder.js # Real-time Websocket decoder
│ ├── marketDataUpdater.js # Real-time updates
│ ├── watchlistCore.js # Core watchlist functionality
│ ├── watchlistEvents.js # Watchlist event handlers
│ ├── watchlistManager.js # Watchlist management
│ ├── watchlistOperations.js # Watchlist operations
│ └── templates/
│ ├── emptyWatchlist.html
│ ├── marketDepth.html
│ └── symbolListItem.html
└── templates/ # HTML templates
├── about.html
├── dashboard.html
├── funds.html
├── holdings.html
├── index.html
├── layout.html
├── login.html
├── orderbook.html
├── positions.html
├── register.html
└── tradebook.html
- Python 3.9+
- Redis Server
- Git
- Clone the repository:
git clone https://github.com/marketcalls/OpenTerminal.git
cd OpenTerminal
- Create virtual environment:
python -m venv venv
- Activate virtual environment:
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Configure Redis:
- Install Redis on your system if not already installed
- Ensure Redis server is running
- Run application:
python app.py
- Access at
http://127.0.0.1:5000
Note: The SQLite database will be created automatically when you first run the application.
Create a .env
file with:
SECRET_KEY=your-secret-key
SQLALCHEMY_DATABASE_URI=sqlite:///open_terminal.db
REDIS_URL=redis://localhost:6379/0
-
Registration
- Visit
/register
- Provide required credentials
- Visit
-
Login
- Use client ID, PIN, and TOTP
- Access granted to dashboard
-
Dashboard Features
- Manage watchlists (up to 5)
- Add/remove symbols
- View real-time data
- Customize settings
- Monitor market indices
-
Additional Features
- Access funds information
- View holdings
- Check order book
- Monitor positions
- Review trade book
-
Logout
- Secure session termination
- Token cleanup
Open Terminal is under active development with regular updates and improvements. Users should expect ongoing enhancements and potential changes as the platform evolves.
- Comprehensive trading functionality
- Advanced charting capabilities
- Multi-broker integration
- Backtesting tools
- Strategy building features
We welcome contributions! For major changes:
- Fork the repository
- Create a feature branch
- Submit a pull request
- Open an issue for discussion
GNU Affero General Public License v3.0 (AGPL-3.0)
Key requirements:
- Source code availability for modifications
- Network use considered as distribution
- Modifications must maintain AGPL-3.0 license
- See LICENSE file for complete terms
Developed with passion for the trading community