···11+atcute-statusphere-app is a repository reimplementing atproto's Statusphere demo with atcute and SvelteKit.
22+33+## development notes
44+55+### project management
66+77+- tools like Node.js, Bun and pnpm are managed by mise, to run them, use `mise exec -- pnpm ...`
88+99+### code writing
1010+1111+- new files should be in kebab-case
1212+- use tabs for indentation, spaces allowed for diagrams in comments
1313+- use single quotes and add trailing commas
1414+- prefer arrow functions
1515+- use braces for control statements, even single-line bodies
1616+- use bare blocks `{ }` to group related code and limit variable scope
1717+- use template literals for user-facing strings and error messages
1818+1919+### documentation
2020+2121+- documentations include README, code comments, commit messages, changesets
2222+- any writing should be in lowercase, except for proper nouns, acronyms and 'I'
2323+- only comment non-trivial code, focusing on _why_ rather than _what_
2424+- write comments and JSDoc in lowercase (except proper nouns, acronyms, and 'I')
2525+- add JSDoc comments to newly exported functions, methods, classes, fields, and enums
2626+- JSDoc should include proper annotations:
2727+ - use `@param` for parameters (no dashes after param names)
2828+ - use `@returns` for return values
2929+ - use `@throws` for exceptions when applicable
3030+ - keep descriptions concise but informative
3131+3232+### misc
3333+3434+- Claude Code's Bash tool persists directory changes (`cd`) across calls
3535+- the `.research/` directory serves as a workspace for temporary experiments, analysis, and planning
3636+ materials. create it if necessary (it's gitignored). this directory may contain cloned
3737+ repositories or other reference materials that can help inform implementation decisions
3838+- don't make assumptions or speculate about code, plans, or requirements without exploring first;
3939+ pause and ask for clarification when you're still unsure after looking into it
4040+- during plan mode, discuss the plans before finalizing/exiting plan mode to allow for additional
4141+ context or follow-up questions to be provided
+40
README.md
···11+# sv
22+33+Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
44+55+## Creating a project
66+77+If you're seeing this, you've probably already done this step. Congrats!
88+99+```sh
1010+# create a new project in the current directory
1111+npx sv create
1212+1313+# create a new project in my-app
1414+npx sv create my-app
1515+```
1616+1717+## Developing
1818+1919+Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or
2020+`yarn`), start a development server:
2121+2222+```sh
2323+npm run dev
2424+2525+# or start the server and open the app in a new browser tab
2626+npm run dev -- --open
2727+```
2828+2929+## Building
3030+3131+To create a production version of your app:
3232+3333+```sh
3434+npm run build
3535+```
3636+3737+You can preview the production build with `npm run preview`.
3838+3939+> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for
4040+> your target environment.
+13
drizzle.config.ts
···11+import { defineConfig } from 'drizzle-kit';
22+33+if (!process.env.DATABASE_URL) {
44+ throw new Error('DATABASE_URL is not set');
55+}
66+77+export default defineConfig({
88+ schema: './src/lib/server/db/schema.ts',
99+ dialect: 'sqlite',
1010+ dbCredentials: { url: process.env.DATABASE_URL },
1111+ verbose: true,
1212+ strict: true
1313+});
···11+// place files you want to import through the `$lib` alias in this folder.
+10
src/lib/server/db/index.ts
···11+import { drizzle } from 'drizzle-orm/libsql';
22+import { createClient } from '@libsql/client';
33+import * as schema from './schema';
44+import { env } from '$env/dynamic/private';
55+66+if (!env.DATABASE_URL) throw new Error('DATABASE_URL is not set');
77+88+const client = createClient({ url: env.DATABASE_URL });
99+1010+export const db = drizzle(client, { schema });
+8
src/lib/server/db/schema.ts
···11+import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core';
22+33+export const user = sqliteTable('user', {
44+ id: text('id')
55+ .primaryKey()
66+ .$defaultFn(() => crypto.randomUUID()),
77+ age: integer('age'),
88+});
+11
src/routes/+layout.svelte
···11+<script lang="ts">
22+ import favicon from '$lib/assets/favicon.svg';
33+44+ let { children } = $props();
55+</script>
66+77+<svelte:head>
88+ <link rel="icon" href={favicon} />
99+</svelte:head>
1010+1111+{@render children()}
+2
src/routes/+page.svelte
···11+<h1>Welcome to SvelteKit</h1>
22+<p>Visit <a href="https://svelte.dev/docs/kit">svelte.dev/docs/kit</a> to read the documentation</p>
+3
static/robots.txt
···11+# allow crawling everything by default
22+User-agent: *
33+Disallow:
+18
svelte.config.js
···11+import adapter from '@sveltejs/adapter-auto';
22+import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
33+44+/** @type {import('@sveltejs/kit').Config} */
55+const config = {
66+ // Consult https://svelte.dev/docs/kit/integrations
77+ // for more information about preprocessors
88+ preprocess: vitePreprocess(),
99+1010+ kit: {
1111+ // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
1212+ // If your environment is not supported, or you settled on a specific environment, switch out the adapter.
1313+ // See https://svelte.dev/docs/kit/adapters for more information about adapters.
1414+ adapter: adapter(),
1515+ },
1616+};
1717+1818+export default config;
+20
tsconfig.json
···11+{
22+ "extends": "./.svelte-kit/tsconfig.json",
33+ "compilerOptions": {
44+ "rewriteRelativeImportExtensions": true,
55+ "allowJs": true,
66+ "checkJs": true,
77+ "esModuleInterop": true,
88+ "forceConsistentCasingInFileNames": true,
99+ "resolveJsonModule": true,
1010+ "skipLibCheck": true,
1111+ "sourceMap": true,
1212+ "strict": true,
1313+ "moduleResolution": "bundler",
1414+ },
1515+ // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
1616+ // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
1717+ //
1818+ // To make changes to top-level options such as include and exclude, we recommend extending
1919+ // the generated config; see https://svelte.dev/docs/kit/configuration#typescript
2020+}
+6
vite.config.ts
···11+import { sveltekit } from '@sveltejs/kit/vite';
22+import { defineConfig } from 'vite';
33+44+export default defineConfig({
55+ plugins: [sveltekit()],
66+});