Professional AdminLTE-based web interface for LoopTrader Pro bot management.
- π€ Bot Management: Pause/resume, enable/disable bots with real-time controls
- π Position Monitoring: Track active and closed positions across all accounts
- π Trailing Stop Management: Configure and monitor trailing stop orders
- π Strategy Overview: View and manage trading strategies
- β‘ Real-time Dashboard: Live statistics and system status monitoring
- π¨ Professional UI: AdminLTE-based responsive design
- π Secure Authentication: Login system with session management
- π Database Integration: Direct connection to existing LoopTrader Pro PostgreSQL
The interface provides a professional admin dashboard with:
- Real-time bot status monitoring
- Interactive controls for bot management
- Position tracking with filtering capabilities
- Trailing stop configuration interface
- System health monitoring
cd /Users/objectis/Documents/Trader/looptrader-web
./start.shThe application will be available at: http://localhost:3000
# Install dependencies
poetry install --no-root
# Run the application
PORT=3000 poetry run python src/looptrader_web/app.py# Build and run with Docker
docker-compose up -d
# Or build manually
docker build -t looptrader-web .
docker run -p 3000:5000 looptrader-web- Username:
admin - Password:
configureinyourenv
The application uses environment variables for configuration:
DATABASE_URL=postgresql://admin:yourlooptraderpassword@localhost:5432/looptrader
FLASK_DEBUG=True
SECRET_KEY=dev-secret-key-change-in-production
ADMIN_USERNAME=Admin login username
ADMIN_PASSWORD=Plain admin password (development only) OR
ADMIN_PASSWORD_HASH=Hashed password generated via `from werkzeug.security import generate_password_hash` (prefer in production). If hash is set it takes precedence over `ADMIN_PASSWORD`.
ADMIN_NAME=Admin
ADMIN_EMAIL=[email protected]
PORT=3000
ADMIN_NAME=Admin
ADMIN_EMAIL=[email protected]
PORT=3000The web interface connects directly to your existing LoopTrader Pro PostgreSQL database:
- Host: localhost
- Port: 5432
- Database: looptrader
- Username: admin
- Password: yourlooptraderpassword
Make sure the LoopTrader Pro PostgreSQL container is running before starting the web interface.
GET /- Dashboard with statisticsGET /bots- Bot management interfaceGET /positions- Position monitoringGET /trailing-stops- Trailing stop managementGET /strategies- Strategy overviewPOST /bots/{id}/toggle_pause- Pause/resume botPOST /bots/{id}/toggle_enabled- Enable/disable botGET /api/health- System health checkGET /api/stats- Dashboard statistics
looptrader-web/
βββ src/looptrader_web/
β βββ app.py # Main Flask application
β βββ models/
β β βββ __init__.py
β β βββ database.py # Database models and connections
β βββ templates/ # Jinja2 templates
β β βββ base.html # Base AdminLTE template
β β βββ dashboard.html # Main dashboard
β β βββ auth/ # Authentication templates
β β βββ bots/ # Bot management templates
β β βββ positions/ # Position monitoring templates
β β βββ trailing_stops/ # Trailing stop templates
β βββ static/ # Static assets (CSS, JS, images)
βββ pyproject.toml # Poetry dependencies
βββ Dockerfile # Docker configuration
βββ docker-compose.yml # Docker Compose setup
βββ start.sh # Easy startup script
βββ README.md # This file
- Add routes to
src/looptrader_web/app.py - Create corresponding templates in
src/looptrader_web/templates/ - Update database models in
src/looptrader_web/models/database.pyif needed - Add any new dependencies to
pyproject.toml
poetry run pytest- Update environment variables in
.env - Set
FLASK_DEBUG=False - Use a production WSGI server like Gunicorn:
poetry run gunicorn -w 4 -b 0.0.0.0:5000 src.looptrader_web.app:app# Build for production
docker build -t looptrader-web:latest .
# Run with production settings
docker run -d \
-p 3000:5000 \
-e FLASK_DEBUG=False \
-e SECRET_KEY=your-production-secret \
looptrader-web:latest- Port 5000 already in use: Use
PORT=3000or disable AirPlay Receiver in macOS System Preferences - Database connection failed: Ensure LoopTrader Pro PostgreSQL container is running
- Permission denied: Make sure
start.shis executable:chmod +x start.sh
Application logs are displayed in the terminal when running in development mode. For production, configure proper logging.
- Change the default SECRET_KEY in production
- Use proper authentication system (current is demo only)
- Configure HTTPS for production deployment
- Restrict database access to authorized hosts only
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is part of the LoopTrader Pro ecosystem.
For issues and questions:
- Check the troubleshooting section
- Review application logs
- Ensure all dependencies are properly installed
- Verify database connectivity
Note: This web interface is designed to work alongside your existing LoopTrader Pro installation and connects to the same PostgreSQL database for real-time data access.