A comprehensive web analytics platform for tracking and analyzing customer behavior across multiple websites.
- Real-time Tracking: Monitor user behavior in real-time
- Session Analytics: Track user sessions, duration, and engagement
- Event Tracking: Capture clicks, form submissions, scroll events, and custom events
- Page Analytics: Monitor page views, bounce rates, and conversion rates
- Device Analytics: Track device types, screen resolutions, and user agents
- Website Management: Add and manage multiple websites
- Website Verification: Secure ownership verification system
- API Key Management: Generate and manage API keys per website
- Cross-Domain Tracking: Track analytics across different domains
- Admin Dashboard: Full access to all features and data
- Analyst Dashboard: Advanced analytics and reporting capabilities
- Customer Dashboard: Basic analytics for website owners
- Easy Integration: Simple JavaScript snippet for website integration
- CORS Support: Cross-origin request support for external websites
- Batch Processing: Efficient event batching for better performance
- Error Handling: Robust error handling and retry mechanisms
- Frontend: Next.js 15, React, TypeScript
- Styling: Tailwind CSS, shadcn/ui components
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth
- Deployment: Vercel-ready
- Real-time: Supabase real-time subscriptions
- Node.js 18+
- Supabase account
- Git
git clone https://github.com/MayorChristopher/CBMS.git
cd CBMSnpm installCreate a .env.local file in the root directory:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_keyRun the SQL scripts in the scripts/ directory in order:
01-create-tables.sql- Core tables02-rls-policies.sql- Row Level Security03-seed-data.sql- Initial data04-create-demo-user.sql- Demo user05-create-profiles-table.sql- User profiles06-admin-functions.sql- Admin functions07-create-websites-table.sql- Websites table08-create-tracking-events-table.sql- Tracking events09-create-api-keys-table.sql- API keys
npm run devVisit http://localhost:3000 to see the application.
- Complete system overview
- User management
- System settings
- All analytics data
- Advanced analytics
- Data export capabilities
- Detailed reporting
- Trend analysis
- Basic website analytics
- Integration management
- API key management
- Website verification
- Go to Integration page
- Add your website URL
- Verify website ownership
- Select your verified website
- Generate an API key
- Copy the key securely
Add this script to your website's <head> section:
<script src="https://your-cbms-domain.com/tracking.js?key=YOUR_API_KEY&api=https://your-cbms-domain.com/api/track"></script>View your analytics in the dashboard!
CBMS/
βββ app/ # Next.js app directory
β βββ api/ # API routes
β βββ dashboard/ # Dashboard pages
β βββ login/ # Authentication pages
β βββ signup/
βββ components/ # React components
β βββ dashboard/ # Dashboard components
β βββ ui/ # UI components
β βββ auth/ # Authentication components
βββ lib/ # Utility libraries
βββ public/ # Static files
βββ scripts/ # Database scripts
βββ supabase/ # Supabase configuration
- Row Level Security: Database-level access control
- API Key Authentication: Secure API key validation
- CORS Protection: Cross-origin request security
- Input Validation: Comprehensive input sanitization
- Rate Limiting: Built-in rate limiting for API endpoints
- Page views
- Click events
- Form submissions
- Scroll events
- Session tracking
- Device information
// Track custom events
window.CBMS.track('custom_event', {
category: 'user_action',
value: 100,
metadata: { custom: 'data' }
});- Push your code to GitHub
- Connect your repository to Vercel
- Set environment variables in Vercel
- Deploy!
NEXT_PUBLIC_SUPABASE_URL=your_production_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_production_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_production_service_role_key- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
For support, please open an issue on GitHub or contact the development team.
Stay updated with the latest features and improvements by watching this repository.
Built with β€οΈ for better customer insights "# CBMS"