docs: Update README with setup instructions for Keycloak and CMS
This commit is contained in:
85
README.md
85
README.md
@@ -1,15 +1,86 @@
|
||||
# Elysia with Bun runtime
|
||||
# Modern SSR CV Website with ElysiaJS
|
||||
|
||||
A fast, server-side rendered (SSR) CV/Portfolio website built with [ElysiaJS](https://elysiajs.com/), SQLite, and TailwindCSS. Features a custom CMS with Keycloak authentication for managing multi-language content.
|
||||
|
||||
## Features
|
||||
|
||||
* **Fast SSR:** Built on the Bun runtime and ElysiaJS for high performance.
|
||||
* **Multi-language Support:** Built-in i18n (English/German) with clean URL routing (`/en`, `/de`).
|
||||
* **CMS Dashboard:** Admin panel to manage Profile, Experience, Education, and Skills without touching code.
|
||||
* **Secure Auth:** OpenID Connect (OIDC) authentication via **Keycloak** (using Arctic).
|
||||
* **Dark Mode:** Automatic and manual theme switching.
|
||||
* **Portable DB:** SQLite database for easy deployment and zero setup.
|
||||
* **Minimalist Design:** Clean UI with TailwindCSS and subtle animations.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* [Bun](https://bun.sh/) (Runtime)
|
||||
* [Docker](https://www.docker.com/) (For Keycloak)
|
||||
|
||||
## Getting Started
|
||||
To get started with this template, simply paste this command into your terminal:
|
||||
|
||||
### 1. Install Dependencies
|
||||
|
||||
```bash
|
||||
bun create elysia ./elysia-example
|
||||
bun install
|
||||
```
|
||||
|
||||
## Development
|
||||
To start the development server run:
|
||||
### 2. Setup Database
|
||||
|
||||
Initialize and seed the SQLite database with default data:
|
||||
|
||||
```bash
|
||||
bun run dev
|
||||
bun run src/db/seed.ts
|
||||
```
|
||||
|
||||
Open http://localhost:3000/ with your browser to see the result.
|
||||
### 3. Setup Keycloak (Auth)
|
||||
|
||||
Start Keycloak and Postgres using Docker:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
* **Admin Console:** `http://localhost:8080`
|
||||
* **User:** `admin`
|
||||
* **Password:** `admin`
|
||||
|
||||
**Configuration Steps:**
|
||||
1. Log in to Keycloak.
|
||||
2. Create a **Realm** (e.g., `myrealm`).
|
||||
3. Create a **Client** (e.g., `cv-app`):
|
||||
* **Client authentication:** On
|
||||
* **Valid Redirect URIs:** `http://localhost:3000/admin/callback`
|
||||
4. Copy the **Client Secret** from the *Credentials* tab.
|
||||
5. Update your `.env` file:
|
||||
|
||||
```env
|
||||
KEYCLOAK_REALM_URL="http://localhost:8080/realms/myrealm"
|
||||
KEYCLOAK_CLIENT_ID="cv-app"
|
||||
KEYCLOAK_CLIENT_SECRET="your-secret-here"
|
||||
KEYCLOAK_REDIRECT_URI="http://localhost:3000/admin/callback"
|
||||
```
|
||||
|
||||
### 4. Run the Server
|
||||
|
||||
```bash
|
||||
bun run src/index.tsx
|
||||
```
|
||||
|
||||
* **Public Site:** `http://localhost:3000`
|
||||
* **Admin Dashboard:** `http://localhost:3000/admin/login`
|
||||
|
||||
## Testing
|
||||
|
||||
Run the unit tests for the database layer:
|
||||
|
||||
```bash
|
||||
bun test
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
||||
* `src/components`: Reusable UI components (Layout, Sections).
|
||||
* `src/db`: Database schema, seed script, and query/mutation logic.
|
||||
* `src/routes`: Route handlers (`admin.tsx`, `public.tsx`).
|
||||
* `src/index.tsx`: Application entry point.
|
||||
|
||||
Reference in New Issue
Block a user