This project was created with Better-T-Stack, a modern TypeScript stack that combines Next.js, Hono, and more.
- TypeScript - For type safety and improved developer experience
- Next.js - Full-stack React framework for the web application
- TailwindCSS - Utility-first CSS for rapid UI development
- shadcn/ui - Reusable UI components
- Hono - Lightweight, performant server framework
- Bun - Runtime environment
- Drizzle - TypeScript-first ORM
- PostgreSQL - Database engine
- Inngest - Background job processing and task scheduling
- Redis Streams - Task queuing system
- Authentication - Better-Auth
- Biome - Linting and formatting
- PWA - Progressive Web App support
- Husky - Git hooks for code quality
First, install the dependencies:
pnpm installThis project uses PostgreSQL with Drizzle ORM.
-
Make sure you have a PostgreSQL database set up.
-
Update your
apps/server/.envfile with your PostgreSQL connection details. -
Apply the schema to your database:
pnpm run db:pushThen, run the development server:
pnpm run devOpen http://localhost:3001 in your browser to see the web application. The API is running at http://localhost:3000.
better-uptime/
├── apps/
│ ├── web/ # Frontend application (Next.js)
│ └── server/ # Backend API (Hono) - Handles all monitor operations and background tasks via Inngest
├── packages/
│ ├── shared-types # Shared TypeScript types
│ ├── auth/ # Authentication configuration & logic
│ ├── db/ # Database schema & queries
│ └── queues/ # Redis streams configuration for task queuing
pnpm run dev: Start all applications in development modepnpm run build: Build all applicationspnpm run dev:web: Start only the web applicationpnpm run dev:server: Start only the API serverpnpm run check-types: Check TypeScript types across all appspnpm run db:push: Push schema changes to databasepnpm run db:studio: Open database studio UIpnpm run db:generate: Generate database migrationspnpm run db:migrate: Run database migrationspnpm run format: Format code with Biomecd apps/web && pnpm run generate-pwa-assets: Generate PWA assets
Better Uptime uses a simplified, modern architecture:
- Web Application (Next.js) - Client-side web application for managing monitors and viewing status
- Server (Hono) - Unified backend API that handles:
- Monitor CRUD operations
- Background task scheduling via Inngest
- Monitor health checks and status updates
- All business logic in a single service
- Inngest - Handles all scheduled tasks and background jobs:
- Cron-based scheduler that runs every 5 minutes
- Monitor check execution
- Status evaluation and updates
- Redis Streams - Used for queuing monitor checks between scheduler and checker functions
- PostgreSQL database
- Redis instance (for streams)
- Inngest account and API key
- Environment variables configured (see
apps/server/.env.example)
# Install dependencies
pnpm install
# Set up database schema
pnpm db:push
# Start the application
pnpm run dev # Starts both web and server
# OR separately:
pnpm dev:web # Start web app only
pnpm dev:server # Start server onlyThe server integrates with Inngest for background task processing. Make sure your Inngest configuration is set up in your environment variables.