SolidJS Guide
This guide walks you through building a reactive app with SolidJS and Sp00ky.
1. Installation
Install the required dependencies:
Bash
2. Generate Schema Types
First, create your schema file and generate TypeScript types:
Bash
This generates a schema.gen.ts file with your schema definition and types.
3. Initialize Database
Create a db.ts file to configure and export your database instance:
src/db.ts
TypeScript
4. App Entry Point
Initialize the database in your root component before rendering the app:
src/App.tsx
tsx
5. Querying Data with useQuery
Use the useQuery hook to create reactive queries that automatically update:
src/components/ThreadList.tsx
tsx
6. Authentication with Auth Context
Create an auth context to manage user authentication state:
src/lib/auth.tsx
tsx
7. Creating and Updating Data
Use the database methods to create and update records:
TypeScript