1# Fanfics on AtProto 2 3Links: 4- [Background](#background) 5- [Infrastructure](#infrastructure) 6 - [Notes](#notes) 7 - [Structure](#structure) 8 9## Background 10 11This was an idea that sparked off a great discussion around decentralizing archives for fanfics and fan works. What if we could have archives that: 12 131. ... are censorship resistant, 142. ... are easy (and CHEAP) to host, 153. ... are easy to configure and extend, 164. ... have moderation tools built-in, 175. ... give users on both sides (authors AND readers) more ownership over their data, 186. ... AND have a cool sixth thing here! 19 20I'm setting out to explore these questions by building a prototype of a fanfic archive on Astro and AtProto. 21 22## Infrastructure 23 24### Notes 25 26AtProto, to my understanding, is made of multiple layers. There's: 27 281. The client (the actual site that displays data) 292. The PDS (the server that stores user's data) 303. The AppView (the thing that grabs only relevant data) 314. The Lexicon (the blueprint for data to be used in AppViews and clients) 32 33... And probably more, and there's a lot of discussion around how user data ownership / censorship / etc gets handled on those layers. 34 35In our case, we'll only worry about making the client and then get drafts of the lexicons from the community later. 36 37Currently, I'm using these technologies: 38 39- Astro 40- Drizzle ORM 41- Turso 42- Unstorage 43 44Mainly because: 1, Astro is a really well-documented web framework that's pretty approachable as someone who used to handwrite HTML pages; 2, SQLite / LibSQL are (to my knowledge) fairly cheap databases to run; and 3, Unstorage is pretty dead simple for setting up auth sessions from scratch. 45 46### Structure 47 48#### `src/actions` 49 50These hold actions that run every time a user wants to publish a new work or signs up for the archive. 51 52#### `src/assets` 53 54This has images / libre font / `.css` files to be used stylistically throughout the site. 55 56#### `src/components` 57 58These hold components that are reused throughout `src/pages`. Like PHP includes but in HTML and JavaScript (well, technically it's JSX). 59 60#### `src/lib/db` 61 62This holds all the relevant database connecting code. This also contains the types for database tables. 63 64#### `src/pages` 65 66These are the actual pages where data, user interactions, etc happen. So this would be more HTML/CSS/JavaScript-oriented.