A comprehensive swing-trade journaling web application built with vanilla JavaScript and powered by Supabase. Track, analyze, and improve your trading performance with detailed trade logging, performance analytics, reviews, and rule management.
- User Authentication: Secure login and registration with email/password
- Trade Management: Create, edit, delete, and view all your trades
- Advanced Filtering: Filter trades by date, strategy, market, direction, profit/loss, and rule compliance
- Search: Quick search by symbol or notes
- Live Calculations: Automatic P/L and R-Multiple calculations
- Screenshot Uploads: Document your trades with chart screenshots
- Dashboard KPIs: Total trades, win rate, profit factor, average R, net P/L
- Equity Curve: Visual representation of your trading performance over time
- Recent Trades: Quick access to your latest 5 trades
- Weekly/Monthly Reviews: Document your trading performance and learnings
- Key Insights: Track top trades, mistakes, learnings, and next focus areas
- Trading Rules: Maintain your personal trading rules
- Pre-Trade Checklist: Items to check before entering a trade
- Post-Trade Checklist: Items to review after closing a trade
- CSV Export: Export your trades to CSV for external analysis
- User Profile: View account information and logout
- Frontend: HTML5, CSS3, Vanilla JavaScript (ES6 Modules)
- Backend: Supabase
- PostgreSQL Database
- Authentication (Auth)
- File Storage
- Row Level Security (RLS)
- No Build Tools: Runs directly in the browser
/
βββ index.html # Login/Register landing page
βββ dashboard.html # Dashboard with KPIs and equity curve
βββ trades.html # Trades list with filters
βββ trade-new.html # Create new trade
βββ trade-edit.html # Edit existing trade
βββ reviews.html # Weekly/Monthly reviews
βββ rules.html # Trading rules and checklists
βββ settings.html # User profile and logout
βββ assets/
β βββ css/
β β βββ styles.css # Complete application styling
β βββ js/
β βββ supabaseClient.js # Supabase configuration
β βββ auth.js # Authentication functions
β βββ guard.js # Route protection
β βββ dashboard.js # Dashboard logic
β βββ trades.js # Trades list logic
β βββ tradeForm.js # Trade create/edit logic
β βββ reviews.js # Reviews CRUD logic
β βββ rules.js # Rules CRUD logic
β βββ settings.js # Settings page logic
β βββ utils.js # Helper functions
βββ sql/
β βββ schema.sql # Database schema and RLS policies
βββ README.md # This file
- Go to supabase.com and create a free account
- Click "New Project"
- Fill in your project details:
- Project Name:
trading-journal(or your choice) - Database Password: Create a strong password
- Region: Choose closest to you
- Project Name:
- Click "Create new project" and wait for setup to complete
- In your Supabase dashboard, go to SQL Editor
- Open the file
/sql/schema.sqlfrom this repository - Copy the entire SQL content
- Paste it into the SQL Editor in Supabase
- Click "Run" to execute the SQL
- This will create:
tradestable with all trade fieldsreviewstable for weekly/monthly reviewsrulestable for trading rules and checklists- Row Level Security (RLS) policies for all tables
- Indexes for better performance
- Triggers for automatic timestamp updates
- In your Supabase dashboard, go to Storage
- Click "Create a new bucket"
- Configure the bucket:
- Name:
trade-screenshots - Public: Uncheck (keep it private)
- File size limit: 5242880 (5MB)
- Allowed MIME types:
image/jpeg,image/png,image/gif,image/webp
- Name:
- Click "Create bucket"
- Click on the
trade-screenshotsbucket - Go to "Policies" tab
- Add the following policies:
Policy 1: Users can upload their own screenshots
- Policy name:
Users can upload their own screenshots - Target roles:
authenticated - Policy command:
INSERT - Policy definition:
bucket_id = 'trade-screenshots' AND auth.uid()::text = (storage.foldername(name))[1]
Policy 2: Users can view their own screenshots
- Policy name:
Users can view their own screenshots - Target roles:
authenticated - Policy command:
SELECT - Policy definition:
bucket_id = 'trade-screenshots' AND auth.uid()::text = (storage.foldername(name))[1]
Policy 3: Users can update their own screenshots
- Policy name:
Users can update their own screenshots - Target roles:
authenticated - Policy command:
UPDATE - Policy definition:
bucket_id = 'trade-screenshots' AND auth.uid()::text = (storage.foldername(name))[1]
Policy 4: Users can delete their own screenshots
- Policy name:
Users can delete their own screenshots - Target roles:
authenticated - Policy command:
DELETE - Policy definition:
bucket_id = 'trade-screenshots' AND auth.uid()::text = (storage.foldername(name))[1]
- In your Supabase dashboard, go to Settings β API
- Copy your credentials:
- Project URL (looks like:
https://xxxxx.supabase.co) - anon public key (looks like:
eyJhbGc...)
- Project URL (looks like:
- Open the file
/assets/js/supabaseClient.jsin your code editor - Replace the placeholder values with your actual credentials:
const SUPABASE_URL = 'YOUR_SUPABASE_URL'; // Replace with your Project URL const SUPABASE_ANON_KEY = 'YOUR_SUPABASE_ANON_KEY'; // Replace with your anon public key
- Save the file
Since this is a pure HTML/CSS/JS application with no build process, you can run it in several ways:
- Install the "Live Server" extension in VS Code
- Right-click on
index.html - Select "Open with Live Server"
- The app will open in your default browser at
http://127.0.0.1:5500
# Python 3
python -m http.server 8000
# Then open http://localhost:8000 in your browser# Install http-server globally
npm install -g http-server
# Run in project directory
http-server
# Then open http://localhost:8080 in your browserYou can deploy this to any static hosting service:
- Netlify
- Vercel
- GitHub Pages
- Cloudflare Pages
Just deploy the entire project folder and it will work!
- Open the application in your browser
- Click on the "Register" tab
- Enter your email and password (minimum 6 characters)
- Click "Register"
- Check your email for verification (depending on Supabase settings)
- Log in with your credentials
- After logging in, you'll be on the Dashboard
- Click "New Trade" or navigate to "Trades" β "New Trade"
- Fill in the trade details:
- Required: Symbol, Direction
- Recommended: Entry/Exit prices, dates, position size, risk amount
- Optional: Strategy, psychology fields, notes, screenshot
- Watch the live P/L and R-Multiple calculations update as you type
- Click "Save Trade"
- Go to the "Trades" page
- Use the filter bar to:
- Search by symbol or notes
- Filter by date range
- Filter by strategy, market, direction
- Filter by profit/loss
- Filter by rules followed
- Click "Reset Filters" to clear all filters
- On the "Trades" page, apply any filters you want
- Click "Export CSV"
- Your filtered trades will download as a CSV file
- Open in Excel, Google Sheets, or any spreadsheet software
- Navigate to the "Reviews" page
- Click "+ New Review"
- Select review type (Weekly or Monthly)
- Set the period start and end dates
- Fill in your insights:
- Summary of the period
- Top trades and why they worked
- Mistakes and lessons learned
- Key learnings
- What to focus on next
- Click "Save Review"
- Navigate to the "Rules" page
- Add rules in three categories:
- Trading Rules: Your core trading principles
- Pre-Trade Checklist: What to check before entering
- Post-Trade Checklist: What to review after exiting
- Use these as reference when trading and journaling
- Row Level Security (RLS): All database operations are user-scoped
- Authentication Required: All pages except login are protected
- Secure Storage: Screenshots are stored with user-specific paths
- No Direct DB Access: All operations go through Supabase's secure API
Edit /assets/css/styles.css and modify the CSS variables in the :root selector:
:root {
--primary-color: #2563eb; /* Main brand color */
--success-color: #10b981; /* Profit/success color */
--danger-color: #ef4444; /* Loss/danger color */
/* etc. */
}Edit trade-new.html and trade-edit.html, find the strategy <select> element and add your options.
Edit /assets/js/utils.js and modify the calculation functions like calculateWinRate, calculateProfitFactor, etc.
- Make sure you've replaced the Supabase credentials in
supabaseClient.js - Check that the Supabase CDN is loading (check browser console)
- Verify the storage bucket is created with the name
trade-screenshots - Check that all 4 storage policies are configured correctly
- Ensure file size is under 5MB
- Check browser console for errors
- Verify RLS policies are active on all tables
- Make sure you're logged in with the correct user
- Clear browser cache and cookies
- Check Supabase Auth settings in dashboard
- Verify email confirmation settings
- Stores all trade information including entry/exit, risk management, psychology, and performance data
- Contains 30+ fields for comprehensive trade journaling
- Stores weekly and monthly trading reviews
- Includes summary, top trades, mistakes, learnings, and focus areas
- Stores user's trading rules and checklists
- Categorized into: rules, pretrade, posttrade
All tables have:
- User ID foreign key to auth.users
- Created/Updated timestamps
- RLS policies for data isolation
This is a personal trading journal application. Feel free to fork and customize for your own needs!
MIT License - Feel free to use and modify as needed.
- Built with Supabase
- Icons: Unicode Emoji
- Inspired by professional trading journals
If you encounter issues:
- Check the Troubleshooting section above
- Review Supabase documentation
- Check browser console for error messages
- Verify all setup steps were completed
Happy Trading! ππ°
Remember: Consistent journaling leads to consistent improvement. Track every trade, review regularly, and stick to your rules!