This document provides a complete overview of the pgSentinel project.
Location: backend/
Tech: FastAPI, Python 3.12, asyncpg
Purpose: REST API + WebSocket + Prometheus metrics
Key Files:
main.py(612 lines) - Main application with 25+ endpointspg_stat_insights.py(300+ lines) - PostgreSQL insights moduleinit.sql- Database initializationDockerfile- Production container
Location: frontend/
Tech: Next.js 14, React 18, TypeScript, Tailwind CSS
Purpose: Real-time monitoring dashboard
Key Directories:
app/- Pages (dashboard, insights)components/- 15+ reusable componentshooks/- 12+ custom hooksservices/- API client layertypes/- TypeScript definitions
Location: website/
Tech: Next.js 14, Framer Motion, TypeScript
Purpose: Product marketing and demos
Pages:
/- Landing page/features- Feature showcase/demo- Interactive demo/docs- Documentation/pricing- Pricing plans
Location: monitoring/
Tech: Prometheus, Grafana, Alertmanager
Purpose: Metrics collection and visualization
Components:
- Prometheus (30+ metrics)
- Grafana (2 dashboards, 21 panels)
- Alertmanager (12 alert rules)
Location: docs/ and root .md files
Purpose: Comprehensive guides and reference
Documents:
README.md- Main documentationQUICK_START.md- 5-minute guidePG_STAT_INSIGHTS.md- Insights guideAPI_REFERENCE.md- API documentationARCHITECTURE.md- System architecturePROJECT_SUMMARY.md- Project overviewCOMPLETE_FEATURES.md- Feature listWEBSITE_COMPLETE.md- Website summary
# Option 1: Automated setup
./setup.sh
# Option 2: Docker Compose
docker-compose up -d
# Option 3: Makefile
make start| Service | URL | Credentials |
|---|---|---|
| Website | http://localhost:3002 | - |
| Dashboard | http://localhost:3000 | - |
| Insights | http://localhost:3000/insights | - |
| API Docs | http://localhost:8000/docs | - |
| Prometheus | http://localhost:9090 | - |
| Grafana | http://localhost:3001 | admin/admin |
| Metric | Count |
|---|---|
| Total Files | 70+ |
| Lines of Code | 7,000+ |
| API Endpoints | 25+ |
| Prometheus Metrics | 30+ |
| React Components | 20+ |
| Custom Hooks | 12+ |
| Pages | 12 (7 app + 5 website) |
| Documentation Files | 8 |
| Docker Services | 9 |
- ✅ Real-time monitoring via WebSocket
- ✅ System metrics (CPU, Memory, Network)
- ✅ Connection pool statistics
- ✅ Backend node management
- ✅ Configuration management
- ✅ pg_stat_insights integration:
- Query performance analysis
- Table health monitoring
- Index efficiency
- Lock analysis
- Replication tracking
- AI recommendations
- ✅ Beautiful landing page
- ✅ Feature showcase
- ✅ Interactive demos
- ✅ Complete documentation
- ✅ Pricing page
- ✅ SEO optimized
- ✅ 30+ Prometheus metrics
- ✅ 2 Grafana dashboards
- ✅ 12 alert rules
- ✅ Alertmanager integration
pgSentinel/
├── backend/ # FastAPI backend (5 files)
├── frontend/ # Dashboard app (40+ files)
├── website/ # Marketing site (15+ files) ⭐ NEW
├── monitoring/ # Prometheus, Grafana (6 files)
├── docker/ # Docker configurations
├── docs/ # Documentation (4 files)
├── docker-compose.yml # 9-service orchestration
├── Makefile # 40+ commands
├── setup.sh # Automated setup
└── *.md # Documentation files (8 files)
Backend: FastAPI, Python 3.12, asyncpg, WebSocket, Prometheus Client
Frontend: Next.js 14, React 18, TypeScript, Tailwind CSS, Recharts
Website: Next.js 14, Framer Motion, React Syntax Highlighter
Monitoring: Prometheus 2.x, Grafana 10.x, Alertmanager 0.26
Infrastructure: Docker 24+, PostgreSQL 17, Redis 7
| Document | Purpose | Location |
|---|---|---|
| README.md | Main project documentation | Root |
| QUICK_START.md | 5-minute setup guide | docs/ |
| API_REFERENCE.md | Complete API documentation | docs/ |
| PG_STAT_INSIGHTS.md | PostgreSQL insights guide | docs/ |
| ARCHITECTURE.md | System architecture | docs/ |
| PROJECT_SUMMARY.md | Project overview | Root |
| COMPLETE_FEATURES.md | Feature list | Root |
| WEBSITE_COMPLETE.md | Website summary | Root |
# Start everything
docker-compose up -d
# Start website only
cd website && npm run dev
# Start dashboard only
cd frontend && npm run dev
# View logs
docker-compose logs -f
# Stop everything
docker-compose down
# See all commands
make help- Start Here:
README.md - Quick Setup:
docs/QUICK_START.md - Use the App: http://localhost:3000
- Explore Insights: http://localhost:3000/insights
- Check API: http://localhost:8000/docs
- Learn Architecture:
docs/ARCHITECTURE.md - Deep Dive:
docs/PG_STAT_INSIGHTS.md
✨ Comprehensive: Everything from monitoring to marketing
✨ Professional: Enterprise-grade design and architecture
✨ Modular: Clean, maintainable code structure
✨ Beautiful: Modern UI with animations
✨ Complete: 70+ files, 7,000+ lines of code
✨ Documented: 1,500+ lines of documentation
✨ Ready: Production-ready, one-command deploy
A COMPLETE, PROFESSIONAL, ENTERPRISE-GRADE system:
✅ Monitoring application with real-time updates
✅ Deep PostgreSQL insights with pg_stat_insights
✅ Beautiful marketing website with demos
✅ Full monitoring stack (Prometheus + Grafana)
✅ Complete documentation
✅ Docker infrastructure
✅ Production ready
Project Root: /Users/pgedge/pge/pgSentinel/
cd /Users/pgedge/pge/pgSentinel
docker-compose up -d
# Then visit:
# Website: http://localhost:3002
# Dashboard: http://localhost:3000Built with ❤️ and meticulous attention to detail
This is a complete, production-ready, enterprise-grade monitoring system with a beautiful marketing website - ready to use immediately!