Laura is a TypeScript + React single-page app that showcases a cosmic-inspired UI for an AI companion brand. It is optimized for fast iteration with Vite, SCSS styling, and modern routing.
- Audience: Designers and developers who want a polished, themed front-end.
- Core flows: Home overview, About narrative, and Contact form submission.
- Runtime: Static SPA (deployable on any static host).
- React 18 + TypeScript with strict checks
- Vite for fast dev/build pipelines
- SCSS-based design system (
src/styles/) - Client-side routing with React Router
- Contact form with configurable delivery endpoint
- Error boundary + structured logging for safer UX
- Node.js 18+ (see
.nvmrc) - npm 9+ (or compatible)
npm installnpm run devnpm run build
npm run previewEnvironment variables are loaded via Vite. Copy .env.example and adjust as needed:
cp .env.example .env| Variable | Required | Purpose |
|---|---|---|
VITE_APP_NAME |
No | App name displayed in the footer |
VITE_CONTACT_ENDPOINT |
No | API endpoint for contact form submissions |
VITE_CONTACT_TIMEOUT_MS |
No | Timeout (ms) for contact form requests |
If VITE_CONTACT_ENDPOINT is not set, the contact form runs in local-only simulation mode.
npm run dev # start Vite dev server
npm run lint # run ESLint
npm run test # run Vitest suite
npm run build # typecheck + build production assets
npm run serve # serve the built assets via sirvConfigure an API endpoint that accepts JSON:
curl -X POST https://api.example.com/contact \
-H "Content-Type: application/json" \
-d '{"name":"Astra","email":"astra@example.com","message":"Hello"}'.
├── .github/workflows/ci.yml # CI pipeline
├── src/
│ ├── components/ # Layout + error boundary
│ ├── config/ # Typed env config
│ ├── pages/ # Home/About/Contact/NotFound routes
│ ├── services/ # Contact form service
│ ├── styles/ # SCSS design system
│ ├── utils/ # Logger + error helpers
│ ├── App.tsx # App routes
│ └── main.tsx # Entry point
├── index.html
└── vite.config.ts
- Blank page: Ensure
npm run devis running and check the console for errors. - Contact form fails: Verify
VITE_CONTACT_ENDPOINTis reachable and accepts JSON. - Unexpected crashes: The error boundary will surface the error; review console logs for details.
- Do not commit real API keys to
.envfiles. - Use HTTPS endpoints for
VITE_CONTACT_ENDPOINTin production. - Review
SECURITY.mdfor coordinated disclosure guidance.
- Fork the repo and create a feature branch.
- Run
npm run lintandnpm run testbefore submitting. - Open a PR with a clear summary and screenshots (if UI changes).
See CONTRIBUTING.md for details.
Apache-2.0. See LICENSE.