mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 06:12:09 +01:00
0e526641ce9a78f4b900acdd5301ea9c17d739e2
🎯 SESSION POOLING PERFORMANCE BREAKTHROUGH! ✅ Critical Issues Fixed: - Eliminated multiple PrismaClient instances across schedulers - Fixed connection pool exhaustion risk in processing modules - Implemented singleton pattern for all database connections - Added graceful shutdown and connection cleanup 🚀 Enhanced Pooling Features: - Dual-mode connection pooling (standard + enhanced) - PostgreSQL native pooling with @prisma/adapter-pg - Advanced connection monitoring and health checks - Configurable pool limits and timeouts via environment variables - Real-time connection statistics and metrics 📊 Performance Optimizations: - Single shared connection pool across all schedulers - Configurable connection limits (DATABASE_CONNECTION_LIMIT=20) - Idle timeout management (DATABASE_POOL_TIMEOUT=10) - Connection cycling and health validation - Process termination signal handling 🛠️ New Infrastructure: - lib/database-pool.ts - Advanced pooling configuration - app/api/admin/database-health/route.ts - Connection monitoring - Enhanced lib/prisma.ts with dual-mode support - Comprehensive documentation in docs/database-connection-pooling.md - Graceful shutdown handling in lib/schedulers.ts 🎛️ Environment Configuration: - USE_ENHANCED_POOLING=true for production optimization - DATABASE_CONNECTION_LIMIT for pool size control - DATABASE_POOL_TIMEOUT for idle connection management - Automatic enhanced pooling in production environments 📈 Expected Impact: - Eliminates connection pool exhaustion under load - Reduces memory footprint from idle connections - Improves scheduler performance and reliability - Enables better resource monitoring and debugging - Supports horizontal scaling with proper connection management Production-ready connection pooling with monitoring and health checks!
LiveDash-Node
A real-time analytics dashboard for monitoring user sessions and interactions with interactive data visualizations and detailed metrics.
Features
- Real-time Session Monitoring: Track and analyze user sessions as they happen
- Interactive Visualizations: Geographic maps, response time distributions, and more
- Advanced Analytics: Detailed metrics and insights about user behavior
- User Management: Secure authentication with role-based access control
- Customizable Dashboard: Filter and sort data based on your specific needs
- Session Details: In-depth analysis of individual user sessions
Tech Stack
- Frontend: React 19, Next.js 15, TailwindCSS 4
- Backend: Next.js API Routes, Node.js
- Database: Prisma ORM with SQLite (default), compatible with PostgreSQL
- Authentication: NextAuth.js
- Visualization: Chart.js, D3.js, React Leaflet
- Data Processing: Node-cron for scheduled tasks
Getting Started
Prerequisites
- Node.js (LTS version recommended)
- pnpm (recommended package manager)
Installation
- Clone this repository:
git clone https://github.com/kjanat/livedash-node.git
cd livedash-node
- Install dependencies:
pnpm install
- Set up the database:
pnpm run prisma:generate
pnpm run prisma:migrate
pnpm run prisma:seed
- Start the development server:
pnpm run dev
- Open your browser and navigate to http://localhost:3000
Environment Setup
Create a .env file in the root directory with the following variables:
DATABASE_URL="file:./dev.db"
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-here
Project Structure
app/: Next.js App Router components and pagescomponents/: Reusable React componentslib/: Utility functions and shared codepages/: API routes and server-side codeprisma/: Database schema and migrationspublic/: Static assetsdocs/: Project documentation
Available Scripts
pnpm run dev: Start the development serverpnpm run build: Build the application for productionpnpm run start: Run the production buildpnpm run lint: Run ESLintpnpm run format: Format code with Prettierpnpm run prisma:studio: Open Prisma Studio to view database
Contributing
- Fork the repository
- Create your feature branch:
git checkout -b feature/my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin feature/my-new-feature - Submit a pull request
License
This project is not licensed for commercial use without explicit permission. Free to use for educational or personal projects.
Acknowledgments
Description
LiveDash-Node: A real-time analytics dashboard for monitoring user sessions and interactions with interactive data visualizations and detailed metrics.
https://test123.kjanat.com
Readme
4.5 MiB
Languages
TypeScript
98.5%
CSS
0.8%
JavaScript
0.7%