SignalCraft is a sophisticated algorithmic strategy building and backtesting platform. Built with a focus on speed, reliability, and precision, it empowers users to design, test, and refine strategies using real-time and historical market data.
- ⚡ Real-time Market Data: Direct integration with Dhan WebSocket for sub-second quote updates.
- 📊 Advanced Charting: Integrated TradingView Lightweight Charts for high-performance visualization.
- 🤖 Strategy Engine: Multi-threaded backend for defining, evaluating, and backtesting algorithmic strategies.
- 🛡️ Risk Management: Configurable risk parameters, position sizing, and drawdown controls for strategy evaluation.
- 📈 Global Screeners: 12+ pre-configured screeners, including Minervini Trend Template and custom RSI indicators.
- 🗄️ Historical Data: Optimized Parquet-based storage for lightning-fast backtesting on years of stock data.
- 📱 Responsive Dashboard: Premium React-based UI for a seamless experience across desktop and mobile.
- Frontend: Next.js, React, Tailwind CSS
- Backend: FastAPI, Uvicorn
- Data Layer: Pandas, PyArrow (Parquet), Redis
- Infrastructure: Docker, PostgreSQL
- Data Providers: Dhan API, YFinance
- Docker and Docker Compose
- Dhan API Credentials (Client ID, Access Token)
-
Clone the repository:
git clone https://github.com/sanprat/Signalcraft.git cd Signalcraft -
Set up Environment Variables: Create a
.envfile in the root directory (refer to.env.local.examplein frontend/backend):DHAN_CLIENT_ID=your_id DHAN_ACCESS_TOKEN=your_token
-
Run with Docker:
docker-compose up --build
-
Access the Application:
- Frontend:
http://localhost:3000 - Backend API:
http://localhost:8000/docs
- Frontend:
Set these in your root .env file. See .env.db.example for database-specific variables.
| Variable | Required | Description |
|---|---|---|
JWT_SECRET_KEY |
Yes | Secret key for signing JWT tokens. Must be set in production. Use a long random string (openssl rand -hex 32). The app will refuse to start without it. |
DB_TYPE |
No | Database engine: postgres (default) or sqlite. |
SQLITE_DB_PATH |
No | Path to SQLite file (default: data/users.db). Only used when DB_TYPE=sqlite. |
DB_HOST |
No | PostgreSQL host (default: localhost). |
DB_PORT |
No | PostgreSQL port (default: 5432). |
DB_USER |
No | PostgreSQL user (default: signalcraft). |
DB_PASSWORD |
No | PostgreSQL password. Required when using DB_TYPE=postgres. |
DB_NAME |
No | PostgreSQL database name (default: signalcraft). |
BACKEND_CORS_ORIGINS |
No | Comma-separated allowed origins (default: http://localhost:3000,http://127.0.0.1:3000). |
COOKIE_SECURE |
No | Set to true to require HTTPS for cookies (default: false). |
NTFY_URL |
No | ntfy server URL for push notifications (e.g. https://ntfy.sh). |
NTFY_TOPIC |
No | ntfy topic to publish notifications to. |
NTFY_USERNAME |
No | ntfy authentication username (optional, for private topics). |
NTFY_PASSWORD |
No | ntfy authentication password. |
NTFY_ALLOWED_HOSTS |
No | Comma-separated allowed ntfy hostnames for SSRF protection (default: ntfy.sh). Add your self-hosted ntfy host if using one. |
DHAN_CLIENT_ID |
Yes | Dhan broker client ID. |
DHAN_ACCESS_TOKEN |
Yes | Dhan broker access token. |
├── backend/ # FastAPI application logic
│ ├── app/ # Core modules, routers, and models
│ └── strategies/ # Stored algorithmic strategies
├── frontend/ # Next.js application
│ ├── app/ # Pages and layouts
│ └── components/ # UI components
├── data-scripts/ # Utilities for data download and management
└── docker-compose.yml # Orchestration for the full stack
- Never commit
.envfiles to version control. They are already in.gitignore, but double-check before pushing. - Production deployments must set
JWT_SECRET_KEYto a strong, unique value. The application will refuse to start without it. - Configure
NTFY_ALLOWED_HOSTSexplicitly if you use a self-hosted ntfy instance. The default only allowsntfy.sh. - Set
COOKIE_SECURE=truein production when serving over HTTPS. - Report vulnerabilities responsibly — see SECURITY.md.
This project is licensed under the MIT License.
See LICENSE for full details.
Contributions are welcome! Please feel free to submit a Pull Request.
Built with ❤️ by sanprat
