Mutable.ai logoAuto Wiki by Mutable.ai

mastodon

Auto-generated from mastodon/mastodon by Mutable.ai Auto WikiRevise

mastodon
GitHub Repository
Developermastodon
Written inRuby
Stars46k
Watchers709
Created02/22/2016
Last updated04/04/2024
LicenseGNU Affero General Public License v3.0
Homepagejoinmastodon.org
Repositorymastodon/mastodon
Auto Wiki
Revision
Software Version0.0.8Basic
Generated fromCommit 4045c0
Generated at04/04/2024

The Mastodon repository is a comprehensive open-source social networking platform that provides a self-hosted, globally interconnected microblogging community. The repository contains the core functionality of the Mastodon application, including a wide range of controllers, models, services, and workers that handle user accounts, statuses (posts), content moderation, ActivityPub integration, and various administrative tasks.

The app directory is the heart of the Mastodon application, containing over 200 files that define the core business logic. This includes controllers that handle user authentication, account management, API interactions, and ActivityPub protocol implementation. The …/models directory defines the central data structures and entities, such as Account, Status, and User, along with a variety of supporting models that handle file attachments, caching, and other cross-cutting concerns.

The Mastodon application heavily leverages the ActivityPub protocol, an open and decentralized social networking protocol, to enable federated communication between different Mastodon instances. The …/activitypub directory contains the controllers responsible for handling incoming ActivityPub requests, generating appropriate responses, and synchronizing data between the local instance and remote actors.

In addition to the core application functionality, the Mastodon repository also includes a comprehensive set of administrative features, accessible through the …/admin directory. These controllers handle tasks such as managing user accounts, moderating content, reviewing trends, and configuring instance-level settings.

The …/services and …/workers directories contain a wide range of service classes and Sidekiq workers that handle asynchronous tasks, such as ActivityPub distribution, user account management, notification delivery, and scheduled maintenance operations. These components leverage the database infrastructure defined in the db directory, which includes migration scripts, seed data, and database views.

The client-side functionality of the Mastodon web application is implemented in the …/mastodon directory, which includes components, actions, reducers, and utility functions that handle various features and behaviors, such as accounts, announcements, bookmarks, compose, notifications, and more. The application also utilizes a comprehensive set of serializers and presenters, located in the …/serializers and …/presenters directories, to convert internal data structures into different formats, including ActivityPub, NodeInfo, and the REST API.

Overall, the Mastodon repository provides a robust and flexible social networking platform that enables users to create self-hosted, interconnected communities, while also offering a rich set of administrative and moderation tools to ensure the health and safety of the network.

Application Controllers
Revise

References: app/controllers

The …/controllers directory contains a comprehensive set of controllers that handle various aspects of the Mastodon application's functionality. These controllers are responsible for processing incoming requests, managing user accounts, handling administrative tasks, and interacting with the ActivityPub protocol.

Read more

API Controllers
Revise

The …/api directory contains a comprehensive set of controllers that handle various API endpoints in the Mastodon application. These controllers provide functionality for managing user accounts, announcements, applications, crypto-related operations, emails, featured tags, instances, lists, notifications, polls, profiles, push subscriptions, statuses, timelines, and trends.

Read more

Administrative Controllers
Revise

The …/admin directory contains the administrative functionality for the Mastodon application. This includes managing user accounts, reports, trends, settings, and various other administrative tasks.

Read more

ActivityPub Controllers
Revise

The …/activitypub directory contains a set of controllers that handle various aspects of the ActivityPub protocol implementation in the Mastodon application. These controllers are responsible for processing incoming ActivityPub requests, generating appropriate responses, and interacting with other components of the Mastodon system.

Read more

Authentication Controllers
Revise

The Auth::ChallengesController is responsible for handling the challenge functionality in the Mastodon application. It includes the ChallengableConcern module and uses the auth layout.

Read more

Settings Controllers
Revise

The key functionality in the …/settings directory is as follows:

Read more

Web API Controllers
Revise

The Api::Web::EmbedsController class is responsible for handling the display of embedded content (such as posts or statuses) in the Mastodon web application. The main functionality provided by this controller includes:

Read more

Account-related Controllers
Revise

The Api::V1::Accounts::LookupController class is responsible for handling the API endpoint for looking up account information. It has a single action, show, which retrieves an account based on the provided account identifier (params[:acct]) and renders the account information as JSON using the REST::AccountSerializer.

Read more

Status-related Controllers
Revise

The …/statuses directory contains a set of controllers that handle various API endpoints related to statuses (posts) in the Mastodon application. These controllers provide functionality for managing the creation, deletion, and interaction with statuses, such as bookmarking, favoriting, reblogging, translating, and managing the edit history and muting of statuses.

Read more

Instance-related Controllers
Revise

The Api::V1::Instances::DomainBlocksController is responsible for handling the API endpoints related to domain blocks in the Mastodon application. It provides functionality to retrieve a list of domain blocks, with the ability to control the visibility and rationale of the response based on the user's authentication status and the application's settings.

Read more

Admin API Controllers
Revise

The Api::V1::Admin::AccountsController is responsible for managing user accounts in the Mastodon application's administrative API. It provides functionality for listing, showing, enabling, approving, rejecting, deleting, unsensitizing, unsilencing, and unsuspending user accounts. The controller uses the AccountFilter class to apply various filters to the account list, such as by local/remote status, activity status, and search parameters.

Read more

Crypto-related Controllers
Revise

The …/crypto directory contains the controllers responsible for handling various cryptographic-related API endpoints in the Mastodon application.

Read more

Application Models
Revise

References: app/models

The …/models directory contains the core models and classes that define the business logic of the Mastodon application. This directory covers a wide range of functionality, including user accounts, statuses (posts), trends, administrative tasks, form handling, and various other cross-cutting concerns.

Read more

Account-related Models
Revise

References: app/models/account

The …/account directory contains the models and classes related to user accounts in the Mastodon application. These models and classes handle various aspects of account functionality, including account associations, avatars, headers, interactions, merging, searching, and status indexing.

Read more

Status-related Models
Revise

References: mastodon

The …/models directory contains the models that manage the functionality around user statuses (posts) in the Mastodon application. These models handle various aspects of status management, such as safe reblog insertion, search indexing, status snapshots, and threading.

Read more

User-related Models
Revise

References: mastodon

The …/models directory contains the models that handle user-specific functionality in the Mastodon application, such as settings management, LDAP authentication, and third-party OAuth integration.

Read more

General Functionality Models
Revise

The …/concerns directory contains a collection of modules that provide various cross-cutting functionality to the models in the Mastodon application. These modules handle a wide range of responsibilities, including:

Read more

Form-related Models
Revise

References: app/models/form

The …/form directory contains a collection of classes that handle various form-related functionality in the Mastodon application. These classes are responsible for managing user account actions, administrative settings, custom emojis, domain blocks, email domain blocks, CSV imports, IP blocks, account redirections, status filters, and two-factor authentication confirmations.

Read more

Trends-related Models
Revise

References: app/models/trends

The Trends::Tags class is responsible for managing and calculating trends for hashtags (tags) on the Mastodon social network platform. It provides the following key functionality:

Read more

User Settings Models
Revise

The …/user_settings directory in the Mastodon application contains the core functionality for managing user settings. This subsection covers the models that provide a flexible and extensible system for managing user settings in the Mastodon application.

Read more

Web-related Models
Revise

References: app/models/web

The …/web directory in the Mastodon application contains two important models: Web::PushSubscription and Web::Setting.

Read more

Other Models
Revise

References: app/models

The AccountAlias model allows users to associate an alternative account identifier (acct) with their main account, providing a way to manage multiple identities.

Read more

Application Services and Workers
Revise

The …/services directory contains a collection of service classes that handle various aspects of the Mastodon application's functionality. These services are responsible for tasks such as fetching and processing remote ActivityPub data, managing user accounts and relationships, handling notifications, and performing various administrative and moderation tasks.

Read more

ActivityPub Integration
Revise

The …/activitypub directory contains a set of service classes that are responsible for handling various aspects of the ActivityPub protocol in the Mastodon application. These services are responsible for fetching and processing remote actors, statuses, polls, and collections, as well as synchronizing followers and managing featured content.

Read more

User Account Management
Revise

The …/services directory contains a collection of service classes that handle various aspects of user account management in the Mastodon application. These services are responsible for tasks such as signing up new users, deleting accounts, suspending and unsuspending accounts, and handling account imports and exports.

Read more

Notifications
Revise

The …/services directory contains a collection of service classes that handle various aspects of the Mastodon application's functionality, including the delivery of push notifications to subscribed clients.

Read more

Administrative Tasks
Revise

The …/services directory contains a collection of service classes that handle various administrative and moderation tasks in the Mastodon application. These services are responsible for performing tasks such as purging domains, cleaning up old user accounts and statuses, maintaining the search index, and capturing PostgreSQL space statistics.

Read more

Miscellaneous
Revise

The …/concerns directory contains a set of modules that provide common functionality to Sidekiq workers in the Mastodon application. These modules are "concerns" that can be included in worker classes to add specific behaviors or retry strategies.

Read more

Database Management
Revise

References: db

The db directory contains the database-related components of the Mastodon application, including database migration scripts, post-migration scripts, seed data, and database views. This directory is crucial for the proper functioning and evolution of the Mastodon application's data infrastructure.

Read more

Database Migrations
Revise

References: db/migrate

The …/migrate directory contains a set of database migration scripts that are responsible for creating and modifying the database schema as the Mastodon application evolves. These migrations cover a wide range of functionality, including:

Read more

Post-Migration Scripts
Revise

References: db/post_migrate

The …/post_migrate directory contains a collection of database migration scripts for the Mastodon application. These migrations are designed to be executed after the main database schema changes have been applied, and they perform various tasks such as:

Read more

Seed Data
Revise

References: db/seeds

The …/seeds directory contains several files that are responsible for setting up the initial state of the Mastodon application's database. These files create various entities, such as the instance actor account, user roles, and an administrative user account, which are necessary for the proper functioning of the Mastodon platform.

Read more

Database Views
Revise

References: db/views

The …/views directory contains several SQL view definitions that provide summarized and aggregated information about various aspects of the Mastodon application. These views are designed to simplify and optimize common data retrieval tasks.

Read more

Client-side Functionality
Revise

References: app/javascript

The Mastodon web application's client-side functionality is implemented in the …/javascript directory, which contains a wide range of components, actions, reducers, and utility functions that handle various features and behaviors of the application.

Read more

Actions
Revise

The …/actions directory contains a comprehensive set of actions and action creators that manage the state of various features in the Mastodon application. These actions handle functionality related to accounts, announcements, bookmarks, columns, compose, conversations, custom emojis, directory, domain blocks, dropdown menus, favorites, featured tags, filters, height cache, history, interactions, languages, lists, markers, modals, mutes, notifications, onboarding, and picture-in-picture.

Read more

API Types
Revise

The …/api_types directory defines TypeScript interfaces and types for the various JSON objects used in the Mastodon API, including accounts, custom emojis, markers, media attachments, polls, relationships, and statuses.

Read more

Components
Revise

The …/components directory contains a variety of React components that are used throughout the Mastodon application. These components provide functionality for rendering user avatars, displaying account information, handling dropdown menus, rendering hashtags, and more.

Read more

Containers
Revise

The …/containers directory contains the main entry points for various features and functionalities of the Mastodon application, including account management, compose, domain blocking, dropdown menus, media handling, polls, scrolling, and status rendering.

Read more

Features
Revise

The …/list_adder directory contains the implementation of the "List Adder" feature in the Mastodon application. This feature allows users to manage the lists they have created and add or remove accounts to those lists.

Read more

Locales
Revise

The …/locales directory manages the internationalization and localization functionality of the Mastodon application, including loading and setting the appropriate locale data.

Read more

Models
Revise

The …/models directory defines data models and utility functions for various entities in the Mastodon application, such as accounts, custom emojis, relationships, and statuses.

Read more

Reducers
Revise

The …/reducers directory contains a collection of Redux reducers that manage the state of various features and components in the Mastodon application.

Read more

Selectors
Revise

The …/selectors directory contains utility functions and data structures that are used to retrieve and manipulate data from the Redux store in the Mastodon application.

Read more

Service Worker
Revise

The …/service_worker directory contains the code responsible for the service worker functionality in the Mastodon web application. The key features implemented in this directory include:

Read more

Store
Revise

The …/store directory provides the core state management functionality for the Mastodon application. This includes the configuration of the Redux store, middleware functions for handling cross-cutting concerns, and utility functions for working with the store in a type-safe manner.

Read more

Utilities
Revise

The …/utils directory contains a collection of utility functions and types that are used throughout the Mastodon project, covering a wide range of functionality.

Read more

Serializers and Presenters
Revise

The Serializers and Presenters section covers the serializers and presenters responsible for converting Mastodon's internal data structures into different formats, including ActivityPub, NodeInfo, and the application's REST API responses.

Read more

ActivityPub Serializers
Revise

The …/activitypub directory contains a collection of serializers responsible for converting various Mastodon objects into ActivityPub-compliant JSON format. These serializers handle the serialization of different types of ActivityPub entities, such as actors (users), notes (statuses), collections, and various activities (like, follow, delete, etc.).

Read more

NodeInfo Serializers
Revise

The …/node_info directory contains two important files that are responsible for serializing the discovery information and the overall Mastodon instance information, following the NodeInfo 2.0 specification.

Read more

REST API Serializers
Revise

The …/rest directory contains a collection of serializers responsible for converting various Mastodon data structures into a format suitable for the REST API. The key functionality of this directory includes:

Read more

Web Serializers
Revise

The …/notification_serializer.rb file contains the Web::NotificationSerializer class, which is responsible for formatting notification data for web-based clients in the Mastodon application.

Read more

Other Serializers
Revise

References: app/serializers

The …/initial_state_serializer.rb file contains the InitialStateSerializer class, which is responsible for serializing the initial state of the Mastodon application. This includes various user-specific settings and preferences, as well as instance-level information.

Read more

Presenters
Revise

References: app/presenters

The …/presenters directory contains various presenter classes that are responsible for managing and presenting data in the Mastodon application. These presenters serve as intermediaries between the models and the views, providing a consistent and organized way to work with the data.

Read more

Utility Libraries
Revise

References: app/lib

The …/lib directory contains a wide range of utility functionality that is crucial to the Mastodon application. This includes:

Read more

ActivityPub Integration
Revise

The …/activitypub directory contains the core functionality for handling ActivityPub-related activities and data within the Mastodon application. This includes classes and modules responsible for parsing, processing, and serializing ActivityPub payloads, as well as managing the various entities and relationships involved in the ActivityPub protocol.

Read more

Administrative Features
Revise

The …/admin directory contains the core functionality for the administrative features of the Mastodon application. This directory is divided into several sub-directories, each focusing on a specific aspect of the admin interface.

Read more

Connection Pool Management
Revise

The ConnectionPool::SharedConnectionPool class is responsible for managing a shared connection pool that can be used by multiple threads in the Mastodon application. This class is a subclass of the ConnectionPool class from the connection_pool gem and provides methods for checking out, checking in, and flushing connections.

Read more

Data Importing
Revise

References: app/lib/importer

The …/importer directory contains a set of classes responsible for importing various types of data into Elasticsearch indices used by the Mastodon application. These classes handle tasks such as batching, parallelism, progress tracking, and index optimization to efficiently import data into the various Elasticsearch indices.

Read more

RSS Feed Generation
Revise

References: app/lib/rss

The Mastodon application provides core functionality for handling RSS feeds within the …/rss directory. The main components in this directory are:

Read more

Translation Services
Revise

The …/translation_service directory contains the implementation of the translation functionality in the Mastodon application, including support for the DeepL and LibreTranslate APIs.

Read more

Other Utility Functionality
Revise

The …/vacuum directory contains several classes that are responsible for cleaning up and maintaining various aspects of the Mastodon application. These classes perform tasks such as:

Read more