Something went wrong. Try again.
Atproto cohost clone/tribute
Something went wrong. Try again.
Files
- TypeScript 92%
- CSS 8%
- Docker <1%
- JavaScript <1%
README.md
posting #
Atproto cohost clone/tribute
contributing #
- current development status: it works. tons of room for improvement, but i'm kinda done with this.
- pnpm project
- use semantic commits (
feat:,fix:,chore:, etc) - no rate limiting yet
- search functionality is explicitly out of scope to match cohost itself
- for development, set
OAUTH_PUBLIC_CLIENTto true- if you want to test our confedential oauth clients, you need a publicly accessible url, so tunnel it with a service like ngrok or cloudflare tunnel
- e.g.
ngrok http --url=my-cool-url.ngrok-free.dev 3000
quick start #
-
edit env
- copy example.env to .env
- edit .env
- run
node scripts/generate-key.mjs
-
start app
docker compose up- for developmentdocker compose -f compose.yaml up- for production
running without docker #
-
start postgres
- e.g.
docker run -d --name posting-db -e POSTGRES_DB=posting -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 -v /home/idk/posting/pg-database/:/var/lib/postgresql/data --replace postgres:16
- e.g.
-
start tap
git clone https://github.com/bluesky-social/indigo && cd indigoTAP_SIGNAL_COLLECTION=pub.nya.posting.profile go run ./cmd/tap run- see tap documentation
-
start app
- e.g.
pnpm dev
- e.g.
commands #
pnpm dev
pnpm build
pnpm start
# db
pnpm db:migrate
pnpm db:reset # DANGER: destorys everything!
# lexicons
pnpm lex:gen
# quality
pnpm check # biome linting
pnpm check:write # apply fixes
pnpm knip # unused files/exports/deps
pnpm jscpd # duplicate code
# e2e test (kinda ugly rn as it runs docker/podman depending on what you have)
pnpm test:e2e
notable file and folders #
-
/lexicons - atproto schemas (com/, pub/)
-
/scripts - dev setup helpers (OAuth key generation, tap build)
-
/src - SolidStart app
- /routes - uses server/services/
- /u/[handle] - profile and posts
- /tags/[tag]
- /components
- /post - composer, post display, tag/box selectors
- /profile - sidebar, box list
- /shared - topbar, notifications, logo, mascot, etc.
- /lib - shared helpers (preferences, hooks, sanitization, markdown, tags)
- /lexicon - generated lexicon types (see
pnpm lex:gen) - /assets
- /server - server-only code, never imported by client
- /auth
- oauth.ts - @atproto/oauth-client-node setup
- session.ts - session restoration
- database-store.ts - oauth state/session storage
- /db
- client.ts
- migrate.ts
- reset.ts
- schema.ts
- /backend
- consumer.ts - tap consumer, handles writes to db
- server.ts - starts the consumer, imported by entry-server
- /services - reads from db, writes through atproto (not the db directly!)
- post.ts, profile.ts, box.ts, tag.ts, like.ts, repost.ts
- blob.ts - image/blob uploads
- notification.ts
- types.ts - shared view types
- /auth
- app.tsx - root component
- entry-client.tsx
- entry-server.tsx
- /routes - uses server/services/
-
app.config.ts - SolidStart/vite config
-
tsconfig.json
-
package.json
-
/e2e - Playwright end-to-end tests
-
/docs
agent specific #
- do not touch styling unless user explicitly requests, it should be handled by the user