No description
  • JavaScript 97.1%
  • Handlebars 2.9%
Find a file
2026-04-15 09:42:39 +00:00
db-migration Initial scaffold from moostash-template 2026-04-15 09:42:39 +00:00
docs Initial scaffold from moostash-template 2026-04-15 09:42:39 +00:00
public Initial scaffold from moostash-template 2026-04-15 09:42:39 +00:00
scripts Initial scaffold from moostash-template 2026-04-15 09:42:39 +00:00
src Initial scaffold from moostash-template 2026-04-15 09:42:39 +00:00
.env.example Initial scaffold from moostash-template 2026-04-15 09:42:39 +00:00
.gitignore Initial scaffold from moostash-template 2026-04-15 09:42:39 +00:00
.npmrc Initial scaffold from moostash-template 2026-04-15 09:42:39 +00:00
AGENTS.md Initial scaffold from moostash-template 2026-04-15 09:42:39 +00:00
jsconfig.json Initial scaffold from moostash-template 2026-04-15 09:42:39 +00:00
package-lock.json Initial scaffold from moostash-template 2026-04-15 09:42:39 +00:00
package.json Initial scaffold from moostash-template 2026-04-15 09:42:39 +00:00
README.md Initial scaffold from moostash-template 2026-04-15 09:42:39 +00:00

Moostash Template

Basic Keycloak-protected Moostash app template showing auth, OPA authorization, shared partials, and starter page structure.

Features

  • Keycloak login with existing Moostash auth flow
  • OPA-protected /protected route example
  • Home page showing authenticated user info
  • Reusable partials and page layout conventions
  • Mobile-friendly responsive layout

Prerequisites

  • Node.js 18+
  • npm
  • Keycloak realm + client
  • OPA endpoint configured for your policy

Getting Started

cp .env.example .env
npm install
npm run dev

The app runs on http://localhost:4500 by default.

Project Structure

src/
├── app/
│   ├── pages/          # Application pages
│   │   ├── home/       # Home page
│   │   └── protected/  # Protected route example
│   └── partials/       # Reusable Handlebars components
│       └── core/       # Core UI components
├── auth/               # Authentication modules
│   ├── keycloak.js     # Keycloak integration
│   └── opa.js          # OPA policy enforcement
└── index.js            # Application entry point

public/
├── scripts/            # Client-side JavaScript
│   ├── core/          # Core functionality
│   └── libs/          # Third-party libraries
└── styles/            # CSS stylesheets
    ├── core/          # Component styles
    └── libs/          # Third-party styles

Configuration

Configure your environment variables as needed:

# Server configuration
PORT=3000

# Keycloak configuration
KEYCLOAK_URL=http://localhost:8080/realms/ypur-realm
KEYCLOAK_REALM=your-realm
KEYCLOAK_CLIENT_ID=your-client-id

# OPA configuration
OPA_URL=http://localhost:8181

Available Pages

  • / - Home page
  • /protected - Protected route example

Next steps

  1. Add new pages in src/app/pages/<name>/.
  2. Create route handlers and wire them in src/index.js.
  3. Extend auth/OPA checks for your app-specific resources.

License

MIT