The city of the future
- Frontend: Svelte
- Frontend Framework: SvelteKit
- Database: SurrealDB
- Database Host: Railway
- AI: OpenAI
- Content Management System: builder.io
- Analytics: Mixpanel
- Payments: Stripe
- Hosting: Vercel
- CI/CD: GitHub Actions
- Emails: SendGrid
- Download and install SurrealDB
- MacOS Command:
brew install surrealdb/tap/surreal
- MacOS Command:
- Download and install Surrealist
- This is a open sourced graphical user interface for SurrealDB
- Open surrealist
- Click the
Settings Cog
icon on the sidebar - Go to
Database Serving
tab in the settings dialog - Set storage mode to
File Storage
instead of memory (this will make your local database persist on disk) - Set the file storage path to
/Users/<your-username>/dev-surreal-db
- Set the surrealist executable path to file path returned by
which surreal
in your terminal - Ensure the root user and password are set to
root
androot
respectively
- Click the
- Press the
Play
button to start the local database with that connection - Create a connection to your database in the top left
- Set the endpoint to
HTTP
with addresslocalhost:8000
- Set the namespace to
development
- Set the database to
lumina
- Use
Root
authentication mode - Set the root user to
root
- Set the root password to
root
- Set the endpoint to
- Generate a random secret key with the following command:
openssl rand -hex 32
- Run the following SurrealQL code in the
Query
editor sidebar tab, replacingRANDOM_SECRET_KEY_HEX
with the random secret key you generated:
DEFINE SCOPE lumina_scope;
DEFINE TOKEN lumina_token on SCOPE lumina_scope type HS256 VALUE "RANDOM_SECRET_KEY_HEX";
- Run the following command to import the database schema from
schema.surql
from this project directory
bun sync
- You're ready to start the development server
- Install Bun
- MacOS:
curl -fsSL https://bun.sh/install | bash
- MacOS:
- Make sure you have installed the dependencies with
bun i
- Run
bun run dev
# ==============
# Stripe Secrets
# ==============
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
PUBLIC_STRIPE_PUBLISHABLE_KEY=
# ==============
# Builder.io
# ==============
PUBLIC_BUILDERIO_KEY=
# ==============
# Mixpanel
# ==============
PUBLIC_MIXPANEL_TOKEN=
# =========
# SurrealDB
# =========
SURREAL_USER=root
SURREAL_PASS=root
PUBLIC_SURREAL_HOST=http://localhost:8000
# =========
# General Secrets
# =========
# Generate using `openssl rand -hex 32`
# This auth secret must match the lumina_token secret in the database as used above
AUTH_SECRET=
SENDGRID_KEY=
LANGFUSE_SECRET_KEY=
LANGFUSE_PUBLIC_KEY=
# required for builder.io for some reason
NODE_OPTIONS=--no-node-snapshot
openssl rand -hex 32