1# Fanfics on AtProto 2 3Links: 4- [Background](#background) 5- [Infrastructure](#infrastructure) 6 - [Notes](#notes) 7 - [Structure](#structure) 8- [Contributing](#contributing) 9 10> [!WARNING] 11> This is alpha software, there's no guarantee that this will work on your system. But if you'd like to try hacking at this, take a look at the [Contributing](#contributing) section once instructions are written up. 12 13## Background 14 15This was an idea that sparked off a great discussion around decentralizing archives for fanfics and fan works. What if we could have archives that: 16 171. ... are censorship resistant, 182. ... are easy (and CHEAP) to host, 193. ... are easy to configure and extend, 204. ... have moderation tools built-in, 215. ... give users on both sides (authors AND readers) more ownership over their data, 226. ... AND have a cool sixth thing here! 23 24I'm setting out to explore these questions by building a prototype of a fanfic archive on Astro and AtProto. 25 26## Infrastructure 27 28### Notes 29 30AtProto, to my understanding, is made of multiple layers. There's: 31 321. The client (the actual site that displays data) 332. The PDS (the server that stores user's data) 343. The AppView (the thing that grabs only relevant data and serves as an API) 354. The Lexicon (the blueprint for data to be used in AppViews and clients) 36 37... And probably more, and there's a lot of discussion around how user data ownership / censorship / etc gets handled on those layers. 38 39In our case, we'll only worry about making the client and then get drafts of the lexicons from the community later. 40 41Currently, I'm using these technologies: 42 43- Astro 44- Drizzle ORM (via Astro DB) 45 - Turso (LibSQL under the hood) 46- Unstorage (via [@fujocoded/authproto](https://github.com/FujoWebDev/fujocoded-plugins/tree/main/astro-authproto)) 47 48Mainly 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. 49 50### Structure 51 52#### Database: `db` 53 54This holds all the relevant database code. This also contains the structure and types for database tables. 55 56#### Actions: `src/actions` 57 58These hold actions that run every time a user wants to publish a new work or signs up for the archive. Basically the backend functionality for this project. 59 60#### Assets: `src/assets` 61 62This has images / libre font / `.css` files to be used stylistically throughout the site. 63 64#### Components: `src/components` 65 66These hold components that are reused throughout `src/pages`. Like PHP includes but in HTML and JavaScript (well, technically it's JSX). 67 68#### Pages: `src/pages` 69 70These are the actual routes that are available to end-users. Under the pages are nested pages grouped under folders, namely: 71 72##### Users: `src/pages/users` 73 74These are pages where users can view all user profiles, find a specific user profile, or update their account settings. 75 76##### Works: `src/pages/works` 77 78These only hold pages that are relevant to adding, editing, deleting, or viewing works. 79 80## Contributing 81 82To be added, but feel free to open an issue in the meantime!