π»π³ TiαΊΏng Viα»t
Mα»t hα» thα»ng giΓ‘m sΓ‘t uptime vΓ performance mαΊ‘nh mαΊ½ Δược xΓ’y dα»±ng vα»i Nuxt 3, MongoDB Time Series vΓ AWS S3. Headless Sentry cung cαΊ₯p giαΊ£i phΓ‘p monitoring toΓ n diα»n cho websites vΓ APIs cα»§a bαΊ‘n vα»i khαΊ£ nΔng cαΊ£nh bΓ‘o realtime vΓ status page cΓ΄ng khai.
- π Monitoring Δa dαΊ‘ng: HTTP/HTTPS endpoints, SSL certificates, error rates
- π Time Series Database: Sα» dα»₯ng MongoDB Time Series Δα» lΖ°u trα»― dα»― liα»u hiα»u quαΊ£
- π CαΊ£nh bΓ‘o realtime: ThΓ΄ng bΓ‘o ngay khi cΓ³ sα»± cα»
- π Status Page: Trang trαΊ‘ng thΓ‘i cΓ΄ng khai cho khΓ‘ch hΓ ng
- π₯ QuαΊ£n lΓ½ team: Hα» trợ nhiα»u thΓ nh viΓͺn vα»i phΓ’n quyα»n
- π Dashboard trα»±c quan: Biα»u Δα» vΓ metrics chi tiαΊΏt
- π BαΊ£o mαΊt: Authentication vα»i nuxt-auth-utils
- β‘ Cron Jobs: Tα»± Δα»ng kiα»m tra theo lα»ch Δα»nh sαΊ΅n
- Frontend: Nuxt 3, Vue 3, TypeScript
- UI Framework: Nuxt UI, TailwindCSS
- Backend: Nuxt Server API
- Database: MongoDB vα»i Time Series collections
- Authentication: nuxt-auth-utils
- Storage: AWS S3 (presigned URLs)
- Cron Jobs: nuxt-cron
- Charts: Unovis
- Validation: Zod
- Node.js 18+
- pnpm (khuyαΊΏn nghα»)
- MongoDB 5.0+ (hỠtrợ Time Series)
- AWS S3 bucket (cho upload files)
git clone https://github.com/pin705/headless-sentry.git
cd headless-sentrypnpm installTαΊ‘o file .env tα»« template:
cp .env.example .envCαΊp nhαΊt cΓ‘c biαΊΏn mΓ΄i trΖ°α»ng:
# Database
MONGODB_URI=mongodb://localhost:27017/headless-sentry
# Authentication (generate random strings)
NUXT_SESSION_PASSWORD=your-32-char-session-password
NUXT_OAUTH_GITHUB_CLIENT_ID=your-github-oauth-client-id
NUXT_OAUTH_GITHUB_CLIENT_SECRET=your-github-oauth-client-secret
# AWS S3 (for file uploads)
AWS_ACCESS_KEY_ID=your-aws-access-key
AWS_SECRET_ACCESS_KEY=your-aws-secret-key
AWS_REGION=us-east-1
AWS_S3_BUCKET=your-s3-bucket-name
# Application
NUXT_PUBLIC_APP_URL=http://localhost:3000results vα»i Time Series mα»t lαΊ§n duy nhαΊ₯t.
KαΊΏt nα»i vΓ o MongoDB vΓ chαΊ‘y lα»nh sau:
// Chuyα»n sang database cα»§a bαΊ‘n
use headless-sentry
// TαΊ‘o Time Series collection
db.createCollection("results", {
timeseries: {
timeField: "timestamp",
metaField: "meta",
granularity: "minutes"
}
})Chi tiαΊΏt xem trong file NOTES.md.
pnpm devServer sαΊ½ chαΊ‘y tαΊ‘i http://localhost:3000
# Lint code
pnpm lint
# Type checking
pnpm typecheck
# Build production
pnpm build
# Preview production build
pnpm previewβββ app/
β βββ components/ # Vue components
β βββ pages/ # Nuxt pages & routing
β βββ composables/ # Vue composables
β βββ middleware/ # Route middleware
β βββ layouts/ # Layout components
βββ server/
β βββ api/ # Server API endpoints
β βββ cron/ # Cron job definitions
β βββ models/ # MongoDB models
β βββ utils/ # Server utilities
βββ public/ # Static assets
βββ ecosystem.config.cjs # PM2 configuration
Hα» thα»ng sα» dα»₯ng cΓ‘c cron job Δα» monitoring tα»± Δα»ng:
- monitorCheck.cron.ts: Kiα»m tra uptime endpoints
- sslCheck.cron.ts: Kiα»m tra SSL certificates
- errorRateCheck.cron.ts: GiΓ‘m sΓ‘t error rates
Cron jobs chαΊ‘y theo timezone Asia/Ho_Chi_Minh vΓ cΓ³ thα» cαΊ₯u hΓ¬nh trong nuxt.config.ts.
# Build application
pnpm build
# Start vα»i PM2
pm2 start ecosystem.config.cjs
# Monitor
pm2 monit
# Stop
pm2 stop headless-sentryFROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY .output .output
EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]Mα»i project cΓ³ thα» tαΊ‘o status page cΓ΄ng khai vα»i:
- Custom slug (vd:
/status/my-service) - Custom domain support
- Logo vΓ branding tΓΉy chα»nh
- Hiα»n thα» uptime realtime
Hα» trợ nhiα»u phΖ°Ζ‘ng thα»©c ΔΔng nhαΊp:
- GitHub OAuth
- Email/Password (tΓΉy chα»n)
- Session management vα»i nuxt-auth-utils
- Fork repository
- TαΊ‘o feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - TαΊ‘o Pull Request
Dα»± Γ‘n nΓ y Δược phΓ’n phα»i dΖ°α»i MIT License.
Vui lΓ²ng tαΊ‘o GitHub Issue Δα» bΓ‘o cΓ‘o lα»i hoαΊ·c Δα» xuαΊ₯t tΓnh nΔng mα»i.
- π§ Email: [your-email@domain.com]
- π¬ Discussions: GitHub Discussions
- π Documentation: Wiki
β NαΊΏu dα»± Γ‘n hα»―u Γch, hΓ£y cho chΓΊng tΓ΄i mα»t star trΓͺn GitHub!
πΊπΈ English
A powerful uptime and performance monitoring system built with Nuxt 3, MongoDB Time Series, and AWS S3. Headless Sentry provides comprehensive monitoring solutions for your websites and APIs with real-time alerts and public status pages.
- π Multi-type Monitoring: HTTP/HTTPS endpoints, SSL certificates, error rates
- π Time Series Database: Uses MongoDB Time Series for efficient data storage
- π Real-time Alerts: Instant notifications when issues occur
- π Status Pages: Public status pages for your customers
- π₯ Team Management: Multi-member support with role-based permissions
- π Visual Dashboard: Detailed charts and metrics
- π Security: Authentication with nuxt-auth-utils
- β‘ Cron Jobs: Automated scheduled monitoring
- Frontend: Nuxt 3, Vue 3, TypeScript
- UI Framework: Nuxt UI, TailwindCSS
- Backend: Nuxt Server API
- Database: MongoDB with Time Series collections
- Authentication: nuxt-auth-utils
- Storage: AWS S3 (presigned URLs)
- Cron Jobs: nuxt-cron
- Charts: Unovis
- Validation: Zod
- Node.js 18+
- pnpm (recommended)
- MongoDB 5.0+ (Time Series support)
- AWS S3 bucket (for file uploads)
git clone https://github.com/pin705/headless-sentry.git
cd headless-sentrypnpm installCreate .env file from template:
cp .env.example .envUpdate environment variables:
# Database
MONGODB_URI=mongodb://localhost:27017/headless-sentry
# Authentication (generate random strings)
NUXT_SESSION_PASSWORD=your-32-char-session-password
NUXT_OAUTH_GITHUB_CLIENT_ID=your-github-oauth-client-id
NUXT_OAUTH_GITHUB_CLIENT_SECRET=your-github-oauth-client-secret
# AWS S3 (for file uploads)
AWS_ACCESS_KEY_ID=your-aws-access-key
AWS_SECRET_ACCESS_KEY=your-aws-secret-key
AWS_REGION=us-east-1
AWS_S3_BUCKET=your-s3-bucket-name
# Application
NUXT_PUBLIC_APP_URL=http://localhost:3000results collection with Time Series once.
Connect to MongoDB and run:
// Switch to your database
use headless-sentry
// Create Time Series collection
db.createCollection("results", {
timeseries: {
timeField: "timestamp",
metaField: "meta",
granularity: "minutes"
}
})See NOTES.md for details.
pnpm devServer will run at http://localhost:3000
# Lint code
pnpm lint
# Type checking
pnpm typecheck
# Build production
pnpm build
# Preview production build
pnpm previewβββ app/
β βββ components/ # Vue components
β βββ pages/ # Nuxt pages & routing
β βββ composables/ # Vue composables
β βββ middleware/ # Route middleware
β βββ layouts/ # Layout components
βββ server/
β βββ api/ # Server API endpoints
β βββ cron/ # Cron job definitions
β βββ models/ # MongoDB models
β βββ utils/ # Server utilities
βββ public/ # Static assets
βββ ecosystem.config.cjs # PM2 configuration
The system uses cron jobs for automated monitoring:
- monitorCheck.cron.ts: Check endpoint uptime
- sslCheck.cron.ts: Check SSL certificates
- errorRateCheck.cron.ts: Monitor error rates
Cron jobs run in Asia/Ho_Chi_Minh timezone and can be configured in nuxt.config.ts.
# Build application
pnpm build
# Start with PM2
pm2 start ecosystem.config.cjs
# Monitor
pm2 monit
# Stop
pm2 stop headless-sentryFROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY .output .output
EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]Each project can create public status pages with:
- Custom slug (e.g.,
/status/my-service) - Custom domain support
- Logo and custom branding
- Real-time uptime display
Supports multiple login methods:
- GitHub OAuth
- Email/Password (optional)
- Session management with nuxt-auth-utils
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Create Pull Request
This project is distributed under MIT License.
Please create GitHub Issues to report bugs or request new features.
- π§ Email: [your-email@domain.com]
- π¬ Discussions: GitHub Discussions
- π Documentation: Wiki
β If this project is helpful, please give us a star on GitHub!