No description
- JavaScript 97.1%
- Handlebars 2.9%
| db-migration | ||
| docs | ||
| public | ||
| scripts | ||
| src | ||
| .env.example | ||
| .gitignore | ||
| .npmrc | ||
| AGENTS.md | ||
| jsconfig.json | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
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
/protectedroute 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
- Add new pages in
src/app/pages/<name>/. - Create route handlers and wire them in
src/index.js. - Extend auth/OPA checks for your app-specific resources.
License
MIT