Intro To Mastohacking
Up to: Tech WG, Mastodon/Docs
Where to get started when looking at the mastodon's underbelly
Here's what i'll go ahead and do is make some skeleton of the different subsystems and how to get started understanding what they do and then make this page publicly editable. Go nuts and add whatever links or writing you want. -jonny 2023-12-04
- Main repo: https://github.com/mastodon/mastodon/
- Our parent fork: https://github.com/glitch-soc/mastodon
- Our fork (what actually runs on neuromatch.social): https://github.com/NeuromatchAcademy/mastodon
- See also the rest of the wiki which describes what we gone and done, particularly Tech WG, Mastodon/Hacking, and Mastodon/Docs.
Overview
What are the main parts of a Mastodon
Environment
What do you need to look at the code and understand it?
Vagrant
Doing a development environment
Frontend
React
- Description: The stuff on the website you look at and click on
- Paths:
/app/javascript
/app/javascript/flavours/glitch
- clone of/app/javascript/mastodon
for glitch-soc
resources for getting started with react, major components and how they are composed/loaded, entrypoints, etc.
Redux
- Description: Data provider for React Components
- Paths:
- Parallel to React paths...
./containers
Design of redux components, how they get data, mapStateToProps, mapDispatchToProps...
HAML
- Description: HTML Templating
- Paths:
/app/views
i know this is technically serverside but hey
Rails
general rails resources, overview of rails apps
Config
API
Overview of how MVC works in Rails and how it is exposed via the API
routes, auth, etc.
Controllers
how do controllers interact between the web interface, API, and models?
Models
what is a a model, what should it do vs. a controller do, etc.
Workers & Services
examples of workers, examples of services, how they interact and are called by the other things
ActivityPub
How does mastodon implement activitypub?
Serializers
Presenters
Infrastructure
the stuff that runs underneath masto, idk what else to call this
Sidekiq
job scheduling machine
Redis
short term queue
PgHero
i actually dont know what this does
Database
Postgres
config, optimization, idk what else
Schema
what is actually in the database?? how does that relate to the rails models?
Migrations
how do we change the db when models are changed?
Masto Systems
How the different things in masto actually work, all the above components put together
Feeds
home feeds, local feeds, hashtag feeds, lists...
Settings
Posting
What actually happens when I post? what happens when someone else on another server posts?
Media
Transcoding, link previews, image storage, etc.
Moderation
What can the admins see, what options do they have to deal with content, etc.
RSS
How do all these dang RSS feeds get made?
Onboarding
- Paths:
/app/javascript/mastodon/features/onboarding
How does the onboarding flow work?