Skip to content

GMU-ASRC/create-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CREATE Lab Website

Svelte 5 Tailwind CSS TypeScript Vercel Bun

Public website for the GMU CREATE Lab. Content is managed in the sibling CMS and fetched at runtime.

Tech Stack

  • SvelteKit with Svelte 5 runes
  • TailwindCSS v4 (theme tokens in src/lib/css/app.css)
  • @sveltejs/adapter-vercel on Vercel, @sveltejs/adapter-static everywhere else (see Deployment)
  • @iconify/svelte for icons
  • Bun for installing and running

Getting Started

bun install
bun run dev      # start the dev server
bun run build    # production build
bun run preview  # preview the build

Configuration

Set PUBLIC_CMS_URL in .env to the CMS URL. The client in src/lib/ts/cms.ts fetches all content from it; uploaded assets are referenced as /api/files/<id> and resolved against that URL.

Deployment

vite.config.ts picks the adapter automatically:

  • On Vercel, the VERCEL env var is set by their build system, so bun run build uses @sveltejs/adapter-vercel. No extra setup needed.
  • Anywhere else (e.g. your machine, CI), bun run build uses @sveltejs/adapter-static and produces a plain static/SPA build in build/, with index.html as the entry point and all routing handled client-side. A postbuild step copies index.html to 404.html so a static host without rewrite rules still serves the app for direct links like /events/some-talk.

Before building for a static host, make sure PUBLIC_CMS_URL points at the real production CMS (e.g. via a .env.production file), since it gets baked into the build at build time. Upload the contents of build/ to the host.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors