Skip to content

Repository files navigation

Reverse Proxy Auth Gateway

A secure, offline-first reverse proxy gateway that protects backend applications using JWT authentication, SQLite user management, and dynamic routing. It features a modern, responsive web dashboard with dark/light themes.


Features

  • JWT Authentication: User sessions are secured using cryptographically signed JSON Web Tokens.
  • SQLite Database Storage: User accounts and backend services are persisted in a local, single-file SQLite database.
  • Initial Setup Wizard: On a fresh database start, redirects to an initialization wizard to secure the gateway with a primary administrator account.
  • Dynamic Service Grid: Users are presented with a clean launcher dashboard displaying available services with localized vector icons.
  • Flexible Path Slug Routing: Proxies multiple backend applications dynamically under clean sub-paths (e.g. /s/main-app/).
  • Asset Fallback Routing: Keeps active service state in cookies, allowing absolute asset paths (like scripts or styles) to load seamlessly.
  • Light & Dark Theme Switcher: Features a high-performance toggle that persists preferences in localStorage without screen-flash on load.
  • Windows Service Wrapping: Includes pre-configured scripts to deploy the gateway as a background Windows Service.

Folder Layout

reverse-proxy-auth/
├── public/
│   ├── fonts/           <-- Local font files (offline Inter font)
│   ├── icons/           <-- Vector icons for services
│   ├── style.css        <-- Glassmorphic dark/light styles
│   └── theme.js         <-- Non-flash theme switcher script
├── views/
│   ├── setup.html       <-- Initial admin setup view
│   ├── login.html       <-- Gateway sign-in view
│   ├── dashboard.html   <-- Service launcher dashboard
│   ├── users.html       <-- User management panel (Admins only)
│   └── error.html       <-- 502 connection failure template
├── scripts/
│   ├── gateway-service.xml
│   ├── install-service.ps1
│   ├── uninstall-service.ps1
│   └── DEPLOY_GUIDE.md  <-- Offline Windows Server setup guide
├── .env                 <-- Server configuration
├── gateway.db           <-- SQLite Database file (generated on start)
├── proxy.js             <-- Main Express gateway application
└── package.json         <-- Node.js dependencies

Quick Start (Development)

1. Install Dependencies

npm install

2. Configure Environment

Create a .env file in the project root:

PORT=3000
SECRET_KEY=your_development_jwt_secret_key_here
COOKIE_SECURE=false
DB_PATH=./gateway.db

3. Run the App

# Start in development mode (with nodemon)
npm run dev

# Start in production mode
npm start

4. Setup Gateway

Open http://localhost:3000 in your browser. Since the database is new, you will be redirected to create the administrator account. Once created, log in to access the dashboard.


Production Deployment

For details on hosting this gateway as a Windows Service in an offline environment, see the scripts/DEPLOY_GUIDE.md guide.

About

A secure, offline-first reverse proxy gateway that protects backend applications using JWT authentication, SQLite user management, and dynamic routing. It features a modern, responsive web dashboard with dark/light themes.

Topics

Resources

Stars

Watchers

Forks

Releases

Contributors

Languages