A powerful trading platform that allows you to create, test, and manage trading rules using natural language.
- Next.js 15 (App Router)
- TypeScript
- Supabase (Authentication & Database)
- TailwindCSS
- React Icons
- ✅ Email & OAuth authentication (Google, GitHub)
- ✅ Protected routes with middleware
- ✅ User dashboard with trading rules management
- ✅ PostgreSQL database with Row Level Security
- ✅ RESTful API routes for rules CRUD operations
- ✅ Beautiful, animated UI
npm installYour .env.local file is already configured with:
NEXT_PUBLIC_SUPABASE_URL=https://jtzoprtqyihyqybqkakx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key- Go to your Supabase SQL Editor
- Run the SQL in
supabase-schema.sql
This creates the rules table with proper RLS policies.
In your Supabase Dashboard → Authentication → Providers:
- Enable Google and/or GitHub
- Add OAuth credentials from respective platforms
npm run devsrc/
├── app/
│ ├── api/rules/ # API routes for rules CRUD
│ ├── auth/callback/ # OAuth callback
│ ├── dashboard/ # Protected dashboard
│ ├── login/ # Login page
│ ├── signup/ # Signup page
│ └── layout.tsx
├── components/
│ └── Navbar.tsx
├── lib/
│ ├── supabase.ts # Original Supabase client
│ ├── supabase-client.ts # Browser client (SSR)
│ └── supabase-server.ts # Server client (SSR)
└── middleware.ts # Route protection
- Sign up at
/signupwith email or OAuth - Confirm email (if using email auth)
- Sign in at
/login - Access dashboard at
/dashboard
| Column | Type | Description |
|---|---|---|
id |
UUID | Primary key |
user_id |
UUID | Foreign key to auth.users |
rule |
JSONB | Trading rule data |
status |
TEXT | 'active' or 'inactive' |
created_at |
TIMESTAMP | Creation time |
GET /api/rules - Get all user's rules
POST /api/rules - Create a new rule
PATCH /api/rules/[id] - Update a rule
DELETE /api/rules/[id] - Delete a rule
// Create a rule
const response = await fetch("/api/rules", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
rule: {
condition: "If RSI < 30",
action: "Buy",
parameters: { indicator: "RSI", threshold: 30 },
},
status: "active",
}),
});- View all trading rules
- Create demo rules
- See statistics (total, active, inactive)
- Sign out
Middleware automatically:
- Redirects unauthenticated users from
/dashboard→/login - Redirects authenticated users from
/login,/signup→/dashboard
- ✅ Run the database schema SQL
- ✅ Test authentication flow
- 🔜 Build natural language rule parser
- 🔜 Add backtesting engine
- 🔜 Connect to trading APIs
- 🔜 Add real-time data feeds
The easiest way to deploy:
vercelMake sure to add your environment variables in Vercel dashboard!
Built with ❤️ for HackTX 2025