PrePulse is a lightweight tool designed for day traders who want a fast and intuitive summary of the market's pulse before the opening bell. Built using Next.js, Supabase, and Resend.
- Daily Market Pulse: Comprehensive premarket analysis with SPY/IWM rotation tracking
- Market Strength Indicator: Visual gauge showing Bullish/Neutral/Bearish market conditions
- Breadth Score: Real-time market breadth analysis (0-100 scale)
- Sector Analysis: Leading and lagging sector identification
- Email Alerts: Automated daily alerts sent by 8:30am EST
- Admin Panel: Easy-to-use interface for daily pulse entry
- Authentication: Secure user management with Supabase Auth
- Frontend: Next.js 15 + TypeScript + Tailwind CSS
- Backend: Supabase (Authentication + Database)
- Email: Resend API
- Deployment: Vercel-ready
- Icons: Lucide React
Before you begin, ensure you have:
- Node.js 18+ installed
- A Supabase account and project
- A Resend account and API key
- Git installed
git clone <repository-url>
cd prepulsenpm installCreate a .env.local file in the root directory:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
# Resend Email Configuration
RESEND_API_KEY=your_resend_api_key- Go to your Supabase project dashboard
- Navigate to the SQL Editor
- Run the SQL commands from
src/utils/database.sqlto create the required tables and policies
npm run devOpen http://localhost:3000 to view the application.
PrePulse includes n8n workflow automation for:
- Daily market summary emails
- Price movement alerts
- Data pipeline automation
- External system integrations
-
Start n8n services:
npm run n8n:start
-
Access n8n interface:
- URL: http://localhost:5678
- Username: admin
- Password: (set in .env.n8n file)
-
Import workflow templates from
n8n-workflows/templates/ -
Configure Supabase credentials in n8n settings
The application uses two main tables:
- Extends Supabase auth.users
- Tracks admin privileges
- Automatically created via trigger
- Stores daily market analysis
- Includes SPY/IWM rotation, breadth score, sector data
- Row-level security enabled
- Email/password authentication via Supabase
- Admin users can access the
/adminpanel - Row-level security policies protect data access
Daily email alerts are sent via the Resend API:
- Triggered from the admin panel
- Sent to all registered users
- Rich HTML formatting with market data visualization
- Scheduled for 8:30am EST delivery
- Dashboard: Main market pulse display
- Auth Pages: Sign in/up with form validation
- Admin Panel: Market data entry interface
- Email Templates: Rich HTML email formatting
For immediate testing without external services:
-
Clone and Install:
git clone <repository-url> cd prepulse npm install
-
Run in Demo Mode:
npm run dev
The app will automatically use mock authentication when placeholder credentials are detected.
-
Supabase Configuration:
- Create a new project at supabase.com
- Go to Settings > API to get your URL and anon key
- Run the SQL schema from
src/utils/database.sqlin your Supabase SQL editor
-
Environment Configuration: Update
.env.localwith your real credentials:# Replace placeholder values with real Supabase credentials NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=your_actual_anon_key SUPABASE_SERVICE_ROLE_KEY=your_service_role_key # Add your Resend API key for email functionality RESEND_API_KEY=your_resend_api_key
-
Email Setup (Optional):
- Sign up at resend.com
- Get your API key and add it to
.env.local
- Connect your GitHub repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push to main branch
Ensure all environment variables are set in your deployment platform:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEYRESEND_API_KEY
- When: Placeholder credentials are detected in
.env.local - Features: Mock authentication using localStorage
- Usage: Perfect for development and testing
- Sign-in: Any email/password combination works
- When: Real Supabase credentials are configured
- Features: Full Supabase authentication with email verification
- Usage: Live deployment with real user accounts
- Sign-in: Requires valid user registration
- "Failed to fetch": Check if you're using placeholder Supabase credentials (demo mode should activate automatically)
- "Connection error": Verify your Supabase URL and API key are correct
- Email not working: Ensure Resend API key is configured for email alerts
- Build errors: Run
npm run buildto check for TypeScript errors - Styling issues: Ensure Tailwind CSS is properly configured
- Database errors: Verify the SQL schema has been applied to your Supabase project
- Sign up for an account
- Receive daily email alerts at 8:30am EST
- View market pulse on the dashboard
- Track SPY/IWM rotation and market strength
- Access the
/adminpanel - Enter daily market analysis
- Save pulse data to database
- Send email alerts to all users
npm run buildnpm run lintprepulse/
βββ src/
β βββ app/ # Next.js app router pages
β β βββ admin/ # Admin panel
β β βββ api/ # API routes
β β βββ auth/ # Authentication pages
β β βββ page.tsx # Main dashboard
β βββ components/ # Reusable components (future)
β βββ supabase/ # Supabase client configuration
β βββ types/ # TypeScript type definitions
β βββ utils/ # Utility functions and SQL schema
βββ public/ # Static assets
βββ package.json # Dependencies and scripts
- Retail day traders focused on SPY, IWM, and index components
- Traders who scalp or position intraday using TA and flow confirmation
- Users who want quick actionable insights, not long reports
The application tracks:
- SPY/IWM Rotation: Which index is leading the market
- Breadth Score: Market participation strength (0-100)
- Market Strength: Overall market sentiment (Bullish/Neutral/Bearish)
- Sector Analysis: Leading and lagging sectors
- Daily Summary: Comprehensive market analysis
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is private and proprietary.
Built with β€οΈ by a trader, for traders.
For support or questions, please contact the development team.