Skip to content

Repository files navigation

Up-Site

A website uptime monitoring platform built with Turborepo, Next.js, Express, Prisma, and Redis streams. Monitor your websites, APIs, and endpoints with real-time status checks, alerts, and dashboards.

Getting Started

Prerequisites

  • Node.js >=18
  • Bun (recommended package manager)
  • Docker & Docker Compose (for containerized setup)
  • PostgreSQL and Redis (for local development, or use Docker)

1. Clone and Run Locally

  1. Clone the repository:

    git clone https://github.com/your-org/up-site-ts.git
    cd up-site-ts
  2. Create a .env file in the root directory with all required environment variables. Example:

    DATABASE_URL=postgresql://postgres:yourpassword@localhost:5432/upsite
    JWT_SECRET=your-secret-key
    REDIS_URL=redis://localhost:6379
    NEXT_PUBLIC_API_URL=http://localhost:8000
    POSTGRES_PASSWORD=yourpassword
    
    # All 4 can be anything for local deployment purpose
    WORKER_ID=your-worker-id
    ALERT_WORKER_ID=your-alert-worker-id
    
    RESEND_API=your-resend-api-key
    FROM_MAIL=your-email@example.com
  3. Set up the database:

    • Ensure PostgreSQL and Redis are running locally, or start them with Docker:
      docker run -d --name postgres -e POSTGRES_PASSWORD=yourpassword -e POSTGRES_DB=upsite -p 5432:5432 postgres:16
      docker run -d --name redis -p 6379:6379 redis:7
    • Run Prisma migrations:
      cd packages/db
      npx prisma migrate dev
      cd ../..
  4. Install dependencies:

    bun install
  5. Start development servers:

    bun run dev

    This will start all apps and packages in development mode.

  6. Access the application:

2. Start with Docker & Docker Compose

  1. Ensure Docker and Docker Compose are installed and running.

  2. Create a .env file in the root directory with all required environment variables. For Docker setup, use service names for database and Redis:

     DATABASE_URL=postgresql://postgres:yourpassword@localhost:5432/upsite
     JWT_SECRET=your-secret-key
     REDIS_URL=redis://localhost:6379
     NEXT_PUBLIC_API_URL=http://localhost:8000
     POSTGRES_PASSWORD=yourpassword
    
     # All 4 can be anything for local deployment purpose
     WORKER_ID=your-worker-id
     ALERT_WORKER_ID=your-alert-worker-id
    
     RESEND_API=your-resend-api-key
     FROM_MAIL=your-email@example.com
  3. Build and start the stack:

    bun docker

    Or manually:

    docker compose build
    docker compose up -d
  4. Service startup order:

    • Infrastructure (postgres, redis)
    • Migrator (runs Prisma migrations)
    • Backend services (server, producer, consumer, notifier, alert-worker)
    • Frontend (web)
  5. Access services:

  6. View logs:

    docker compose logs -f
  7. Stop services:

    docker compose down

For advanced Docker usage, troubleshooting, and production deployment tips, see docker/README.md.

Project Structure

This Turborepo monorepo includes the following apps and packages:

Apps

  • web: Next.js frontend with dashboard and authentication
  • server: Express.js backend API with user management and website monitoring
  • producer: Redis stream producer for uptime checks
  • consumer: Redis stream consumer for processing checks
  • notifier: Email notification service using Resend
  • alert-worker: Alert processing and notification worker
  • tests: Test suite for the application

Packages

  • db: Prisma database client and schema
  • redis-streams: Redis streams utilities
  • ui: Shared React UI components
  • eslint-config: ESLint configurations
  • typescript-config: TypeScript configurations

Each package/app is 100% TypeScript.

Utilities

This Turborepo has some additional tools already setup for you:

Testing

Run the test suite:

cd apps/tests
bun run test

Development

Build

bun run build

Lint

bun run lint

Type Checking

bun run check-types

Format Code

bun run format

Remote Caching

Turborepo supports remote caching with Vercel. To enable:

turbo login
turbo link

Useful Links

About

A website uptime monitoring platform built with Turborepo, Next.js, Express, Prisma, and Redis streams. Monitor your websites, APIs, and endpoints with real-time status checks, email alerts, and dashboards.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages