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