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:
.env file 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 serve
This 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:
../../../styles → styles/design-system/theme.scss (compressed)app.scss with PostCSS/Tailwind for @apply supportGET / - 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@apply directivesThis app uses Approach 1: Full Build from the styling workflow:
@apply supportTo 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.