Skip to content

Latest commit

 

History

History
88 lines (59 loc) · 2.8 KB

File metadata and controls

88 lines (59 loc) · 2.8 KB

pm2.web - Dashboard

The Dashboard is a Next.js application built on the t3 stack, utilizing trpc for API calls and next-auth for authentication. It offers a range of actions, including real-time monitoring, process control, log viewing, and user access management. Additionally, it uses multiple charts for better data visualization.

On Premise

Prerequisites

  • Node v18
  • MongoDB Cluster (required for Restart/Shutdown/Delete functionality) / MongoDB Atlas
  • Open Port 3000 or 80,443 (if you use a reverse proxy)

Configuration

NEXTAUTH_SECRET=Generate using openssl rand -base64 32 or https://generate-secret.vercel.app/32
DB_URI=mongodb+srv://connecturi
NEXTAUTH_URL=http://localhost:3000

Installation

  1. Install the dependencies

    # from project root
    npm install
  2. Create a .env file in the dashboard directory and add the following env variables

     DB_URI=mongodb+srv://connecturi
     NEXTAUTH_SECRET=Generate using openssl rand -base64 32 or https://generate-secret.vercel.app/32
     NEXTAUTH_URL=<Index URL of the dashboard eg. http://ip:3000>
  3. Build the frontend

     npm run build:apps:dashboard

Setup

You can start it using the following npm command:

# run from the project root
npm run start:apps:dashboard

To run the process in the background, you can use several tools such as PM2.

Run using PM2

This will start it using pm2. Furthermore, you can hide it from the process list through the dashboard.

# run from the project root
pm2 start npm --name "pm2.web-dashboard" -- run "start:apps:dashboard"

Vercel & MongoDB Atlas

  • MongoDB Atlas
  • Vercel Account (free tier is sufficient)

Configuration

NEXTAUTH_SECRET=Generate using openssl rand -base64 32 or https://generate-secret.vercel.app/32
DB_URI=mongodb+srv://connecturi
NEXTAUTH_URL=http://localhost:3000

MongoDB Atlas

  1. Create a MongoDB Atlas account and create a new project.
  2. Create a new cluster and select the free tier.
  3. Create a new database user and save the username and password.
  4. Add your IP address to the IP Access List or through a CIDR block.

Setup

Deploy with Vercel

  1. Click the deploy button above and follow the instructions.