A standalone chat application with Monaco editor support and Groq API integration. Uses the Full Build approach with SCSS and chunked CSS for Val Town deployment.
-
Install dependencies: This app uses Deno with npm imports for build tools.
-
Configure Groq API:
- Get your API key from https://console.groq.com/
- Create a
.envfile in this directory:GROQ_API_KEY=your_groq_api_key_here
-
Build styles (first time or after changes):
deno task build:styles -
Run the server:
deno task serveThis will automatically build styles before starting the server.
The app will be available at
http://localhost:8001
chat-app/
├── styles/
│ ├── build.ts # Build script (compiles SCSS + chunks CSS)
│ ├── app.scss # App-specific SCSS with @apply support
│ ├── tailwind.config.js # Tailwind configuration
│ ├── postcss.config.js # PostCSS configuration
│ ├── design-system/ # Copied design system (gitignored)
│ └── chat-app-*.css # Generated CSS chunks
├── src/
│ └── monaco-utils.js # Monaco editor utilities
├── index.html # Main HTML file
├── main.tsx # Hono server with Groq endpoint
└── README.md # This file
The build script (styles/build.ts) does the following:
- Copies design system from
../../../styles→styles/design-system/ - Compiles design system from
theme.scss(compressed) - Compiles app styles from
app.scsswith PostCSS/Tailwind for@applysupport - Combines both into a single CSS file
- Chunks if total size > 60KB (for Val Town deployment)
GET /- Main chat interfacePOST /api/chat- Chat completion endpoint (uses Groq API)GET /styles.css- Combined CSS (stitches chunks together)GET /src/monaco-utils.js- Monaco editor utilitiesGET /health- Health check
- Real-time chat with Groq API
- Monaco editor for code blocks
- Markdown rendering
- Responsive design
- Full design system integration
- SCSS with
@applydirectives - Chunked CSS for Val Town deployment
This app uses Approach 1: Full Build from the styling workflow:
- ✅ Complete design system copied and compiled
- ✅ SCSS files with
@applysupport - ✅ PostCSS + Tailwind processing
- ✅ Chunked CSS output (< 60KB per chunk)
- ✅ Server-side CSS stitching
To rebuild styles after making changes to styles/app.scss:
deno task build:styles
Or just run deno task serve which will build automatically.
The chunked CSS files (chat-app-1.css, chat-app-2.css, etc.) should be committed to your repo. The server automatically stitches them together when serving /styles.css.
