Welcome! This guide will get you up and running in 5 minutes.
This repository stores additional ExoQuery code examples that can be loaded dynamically by the main website without requiring a site rebuild.
Think of it as a CDN for code examples.
cd ~/git
git clone https://github.com/YOUR_USERNAME/exoquery-examples-web.git
cd exoquery-examples-web
npm installnpm run buildThis creates:
dist/manifest.json- Index of all examplesdist/examples/*.json- Individual example files
cat dist/manifest.json
cat dist/examples/window-functions.jsonThat's it! You've built the examples.
vim examples/my-first-example.md## My First Example
**Icon:** ✨
**Category:** Basics
**Description:** A simple example
### Code
\`\`\`kotlin
import io.exoquery.*
val myQuery = sql { Table<User>() }
fun main() = myQuery.buildFor.Postgres().runSample()
\`\`\`
### Output
\`\`\`sql
SELECT * FROM "User"
\`\`\`
### Try
- Try adding a WHERE clause
- Try joining another tablenpm run build
cat dist/examples/my-first-example.jsonSuccess! Your example is now ready.
- Push your repo to GitHub:
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/YOUR_USERNAME/exoquery-examples-web.git
git push -u origin main-
Enable GitHub Pages:
- Go to repo Settings → Pages
- Source: "GitHub Actions"
- Save
-
Wait ~2 minutes for deployment
Check these URLs (replace YOUR_USERNAME):
# Manifest
curl https://YOUR_USERNAME.github.io/exoquery-examples-web/manifest.json
# Example
curl https://YOUR_USERNAME.github.io/exoquery-examples-web/examples/window-functions.jsonThat's it! Your examples are live.
Once deployed, examples are accessible at:
https://exoquery.io/#home?example=my-first-example
./setup-local-dev.shThis creates a symlink so the main site can load your local examples.
# Terminal 1: Build examples when you make changes
cd exoquery-examples-web
npm run build
# Terminal 2: Run the main site
cd ../exoquery-site
npm run devVisit: http://localhost:4321/#home?example=my-first-example
Every example needs:
| Section | Required | Description |
|---|---|---|
| Title | ✅ Yes | ## Example Title |
| Icon | ✅ Yes | **Icon:** 🎯 |
| Category | ✅ Yes | **Category:** Advanced |
| Description | ✅ Yes | **Description:** What it does |
| Code | ✅ Yes | Kotlin code in ```kotlin block |
| Output | ✅ Yes | SQL output in ```sql block |
| Schema | ❌ No | Database setup (optional) |
| Try | ❌ No | Suggestions for users (optional) |
- README.md - Full documentation
- QUICKSTART.md - Detailed quick start
- INTEGRATION.md - Integration with main site
- PROJECT_SUMMARY.md - Architecture overview
npm run build # Build all examples
npm run dev # Watch TypeScript files
npm run typecheck # Type check without building
npm run clean # Remove dist/ directoryA: Edit the .md file, run npm run build, commit and push.
A: ~2 minutes after pushing to GitHub.
A: Yes! Run npm run build and check dist/ directory.
A: Just revert the Git commit. The previous version will deploy.
A: In the main site at exoquery-site/src/content/examples.md
A: Built-in examples are part of the site code. External examples (this repo) load dynamically.
Next Steps:
- ✅ Add your first example
- ✅ Build and test locally
- ✅ Push to GitHub
- ✅ See it live on the site
Need Help?
- Check the other docs in this repo
- Open an issue on GitHub
- Review existing examples for guidance
Happy coding! 🚀