A modern full-stack web application built with Bun runtime, Svelte 5 frontend, and Hono backend framework. Features a beautiful dark-themed UI with shadcn-svelte components, real-time health monitoring, and a fully typed TypeScript codebase.
This project is a modern full-stack application that combines:
.
├── client/ # Svelte 5 client application
│ ├── src/
│ │ ├── App.svelte # Main application component
│ │ ├── app.css # Global styles with dark theme
│ │ └── lib/
│ │ ├── components/ # Reusable components
│ │ │ ├── ui/ # shadcn-svelte components
│ │ │ ├── HeaderCard.svelte
│ │ │ ├── TechStackSection.svelte
│ │ │ ├── FeaturesCard.svelte
│ │ │ ├── ProjectStructureCard.svelte
│ │ │ ├── QuickStartCard.svelte
│ │ │ └── HealthStatus.svelte
│ │ ├── Counter.svelte
│ │ └── utils.ts # Utility functions
│ ├── vite.config.ts # Vite configuration with API proxy
│ └── package.json
├── server/ # Hono backend server
│ ├── api/ # API route handlers
│ │ └── setup.ts # Setup-related endpoints
│ ├── server.ts # Main server file with CORS and routing
│ └── package.json
├── shared/ # Shared TypeScript types
│ ├── src/
│ │ ├── api/ # API type definitions
│ │ │ └── setup.ts # Setup API types
│ │ └── index.ts # Main exports
│ └── package.json
├── index.ts # Bun server entry point
└── package.json # Root package with workspace scripts
/api/health with detailed health informationClone the repository
Install all dependencies (workspaces are automatically handled):
bun install
This will automatically install dependencies for the root, client, and server workspaces.
Set up environment variables:
cp .env.example .env
Edit .env and configure the variables as needed (see Environment Variables section below).
Run both client and server together:
bun run dev
Or run them separately:
Run the client development server:
bun run dev:client
Run the backend server:
bun run dev:server
http://localhost:5173 (Vite dev server)http://localhost:3000/api/* requests to the backendBuild the client:
bun run build:client
Start the production server (serves the built frontend):
bun run start
The production server will serve the built frontend from dist (at the project root) and handle API routes.
dev - Start both client and server development servers togetherdev:client - Start client development server onlydev:server - Start backend development server onlybuild:client - Build client for productionbuild - Alias for build:clientstart - Start production serverGET /api/healthHealth check endpoint that returns server status and information.
Response:
{
"status": "ok",
"timestamp": "2024-01-01T00:00:00.000Z",
"runtime": "Bun",
"framework": "Hono"
}
The frontend includes a HealthStatus component that automatically fetches and displays this information using typed API client functions.
Type Safety: Both server and client use shared TypeScript types from the shared workspace for type-safe API communication.
The API endpoints are protected with CORS middleware that:
localhost on any port for flexibilityCLIENT_URL specified in .envThe application uses a modular component architecture with the following main components:
All components use shadcn-svelte for consistent styling and accessibility.
bun install to install all dependencies (workspaces are handled automatically)bun run dev to start both servers simultaneouslybun run build:client, then start with bun run startThe project uses a root .env file for environment configuration. Copy .env.example to .env and configure as needed:
# Server Configuration
PORT=3000
BUN_ENV=development
# Client Configuration (Vite only exposes VITE_ prefixed variables)
VITE_API_URL=http://localhost:3000
CLIENT_URL=http://localhost:5173
PORT - Server port (default: 3000)BUN_ENV - Environment mode (development or production)VITE_API_URL - API URL for client-side requests (default: http://localhost:3000)CLIENT_URL - Client application URLNote: Variables prefixed with VITE_ are exposed to the client. Never put sensitive data in VITE_ prefixed variables.
The application features a modern dark theme with:
This project is private and for personal/educational use.