Deltalytix
Trading journal with AI agents and dashboard with statistics
Install / Use
/learn @hugodemenez/DeltalytixREADME
Deltalytix
<div align="center"> <img src="public/apple-icon.png" alt="Deltalytix Logo" width="120" height="120"> <h3>Open-source trading analytics platform for professional traders</h3><a href="https://trustmrr.com/startup/deltalytix" target="_blank"><img src="https://trustmrr.com/api/embed/deltalytix?format=svg" alt="TrustMRR verified revenue badge" width="220" height="90" /></a>
🚀 Live Demo • 💬 Discord Community • 🐛 Report Bug
</div>✨ Key Features
<div align="center"> <img src="public/dashboard-overview.gif" alt="Dashboard overview GIF" width="650" style="margin-bottom: 1.5rem;" /> </div>📊 Advanced Trading Analytics
- Real-time PnL tracking with customizable performance metrics
- Interactive dashboards with drag-and-drop widget layouts
- Comprehensive trade analysis with decile statistics and pattern recognition
- Customizable chart views supporting multiple timeframes and indicators
🔗 Multi-Broker Integration
- Tradovate sync for real-time trade data synchronization
- Rithmic sync via proprietary service integration
- Built-in integrations for FTMO, ProjectX, ATAS, and Interactive Brokers (IBKR)
- AI-powered file parsing for any broker format when specific integration doesn't exist yet
🤖 AI-Powered Insights
- Intelligent field mapping for seamless data imports
- Sentiment analysis of trading patterns and market conditions
- Automated trade journal with AI-generated insights
- Pattern recognition for identifying trading opportunities
- Rich text editor with image resizing and table support for structured journaling
🌍 Internationalization
- Full i18n support with English and French translations
- Extensible translation system using next-international
- Locale-aware formatting for dates, numbers, and currencies
- RTL language support ready for future expansion
⚡ Modern Technology Stack
- Next.js 15 with App Router for optimal performance
- React 19 with latest concurrent features
- TypeScript for type-safe development
- Prisma ORM for database operations
- Supabase for authentication and real-time features
🛠️ Tech Stack & Architecture
Frontend
- Framework: Next.js 15 (App Router)
- UI Library: React 19 with TypeScript
- Styling: Tailwind CSS with custom design system
- Animations: Framer Motion with performance optimizations
- State Management: Zustand stores + React Context
- Internationalization: next-international
Backend
- API: Next.js API Routes + Server Actions
- Database: PostgreSQL via Supabase
- ORM: Prisma with type-safe queries
- Authentication: Supabase Auth (Discord OAuth, Email)
- Real-time: WebSocket connections for live data
External Services
- Payments: Stripe integration with webhooks
- AI/ML: OpenAI API for analysis and field mapping
- Storage: Supabase Storage for file uploads
- Broker Syncs: Tradovate API, Rithmic proprietary service
- Platform Integrations: FTMO, ProjectX, ATAS, Interactive Brokers (IBKR)
- Deployment: Vercel-optimized with edge functions
Development Tools
- Package Manager: Bun (recommended) or npm
- Linting: ESLint with Next.js config
- Type Checking: TypeScript strict mode
- Database Migrations: Prisma migrations
📋 Prerequisites
Before you begin, ensure you have the following:
Required Software
- Node.js 20+ or Bun (latest version recommended)
- Git for version control
- PostgreSQL database (or use Supabase free tier)
Required Accounts
- Supabase account (free tier available)
- Stripe account (for payment processing)
- OpenAI API key (for AI features)
- Discord application (for OAuth authentication)
🚀 Installation & Setup
Step 1: Clone and Install
git clone https://github.com/hugodemenez/deltalytix.git
cd deltalytix
npm install # or bun install
Step 2: Environment Variables
Create a .env.local file in the root directory with the following variables:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
# Database
DATABASE_URL=your_postgresql_connection_string
# OpenAI
OPENAI_API_KEY=your_openai_api_key
# Stripe
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
# Discord OAuth
DISCORD_CLIENT_ID=your_discord_client_id
DISCORD_CLIENT_SECRET=your_discord_client_secret
# Application
NEXT_PUBLIC_APP_URL=http://localhost:3000
Step 3: Database Setup
# Generate Prisma client
npx prisma generate
# Push schema to database (for development)
npx prisma db push
# Or run migrations (for production)
npx prisma migrate dev
# Seed the database (optional)
npx prisma db seed
Step 4: Run Development Server
npm run dev
# or
bun dev
Open http://localhost:3000 to view the application.
⚙️ Configuration Guide
Supabase Setup
- Create a new Supabase project
- Enable Discord OAuth provider in Authentication settings
- Configure Row Level Security (RLS) policies
- Set up storage buckets for file uploads
- Configure real-time subscriptions for live data
Stripe Configuration
- Create a Stripe account and get API keys
- Set up webhook endpoints for payment processing
- Configure products and pricing plans
- Test webhook integration in development
Discord OAuth Setup
- Create a Discord application in the Discord Developer Portal
- Navigate to OAuth2 settings and add redirect URI:
http://localhost:3000/api/auth/callback/discord - Copy Client ID and Client Secret to environment variables
- Enable the
identifyandemailscopes for user authentication
OpenAI Integration
- Get an API key from OpenAI
- Configure usage limits and billing
- Test API connectivity with the field mapping feature
📁 Project Structure
deltalytix/
├── app/ # Next.js App Router
│ ├── [locale]/ # Internationalized routes
│ │ ├── dashboard/ # Main dashboard pages
│ │ ├── admin/ # Admin panel
│ │ ├── business/ # Business features
│ │ └── (landing)/ # Marketing pages
│ └── api/ # API routes
│ ├── ai/ # AI-powered endpoints
│ ├── auth/ # Authentication
│ ├── stripe/ # Payment processing
│ └── cron/ # Scheduled tasks
├── components/ # Reusable React components
│ ├── ui/ # Base UI components (Radix UI)
│ ├── ai-elements/ # AI-powered components
│ ├── emails/ # Email templates
│ ├── tiptap/ # TipTap editor components
│ └── magicui/ # Custom UI components
├── server/ # Server-side business logic
├── store/ # Zustand state management
├── prisma/ # Database schema and migrations
├── locales/ # Internationalization files (EN/FR)
├── lib/ # Utility functions
├── hooks/ # Custom React hooks
├── context/ # React Context providers
├── docs/ # Feature documentation
│ └── JOURNAL_EDITOR.md # Journal editor feature guide
└── content/ # MDX content for updates
🧑💻 Development Guidelines
Code Style
- Use TypeScript strict mode
- Follow Next.js best practices
- Implement proper error handling
- Write self-documenting code
Translation System
Use the useI18n hook for all user-facing text:
import { useI18n } from "@/locales/client"
const t = useI18n()
// Basic translation
<CardTitle>{t('propFirm.title')}</CardTitle>
// Translation with variables
<DialogTitle>{t('propFirm.configurator.title', { accountNumber: account.accountNumber })}</DialogTitle>
State Management
- Use Zustand stores for client-side state
- Use React Context for complex mutations
- Prefer Server Actions for data mutations
- Use API routes for public data with caching
API Design
- API Routes: For public data that benefits from caching
- Server Actions: For mutations and private operations
- Real-time: Use Supabase subscriptions for live updates
🤝 Contributing
We welcome contributions to Deltalytix! Here's how you can help:
Getting Started
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and test thoroughly
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Development Workflow
- Follow the existing code style and conventions
- Add tests for
