Both incoming and outgoing ActivityPub request are handled through queues, to e.g. allow for retrying a request when it fails, or spikes of many incoming requests.
#### Incoming Activities
Remote ActivityPub implementations will HTTP POST to the resource `/user/:userId/inbox` or `/inbox` (the latter is also known as the "shared inbox").
The behaviour for these routes is exactly the same: They add all the received data into the inbox queue.
This is defined in `/packages/backend/src/server/activitypub.ts`.
The inbox processor will do some basic things like verify signatures.
If code for handling a task seems to big to e.g. do directly in an API endpoint or should be reused, it is probably placed in `/packages/backend/src/services/`.
### Queues
Code regarding queues is in `/packages/backend/src/queue/`.
Misskey defines several queues for processing things that might take longer in the background.
The queues themselves are defined in `index.ts`.
How the different queues are then processed is defined by the code in the `processors/` directory.
## client
All the client code is in `/packages/client/src/`.
The client uses Vue 3 and its Composition API, but there are also some older Options API components that have yet to be refactored (see CONTRIBUTING.md).
### Pages
If it is something you can navigate to, it is most likely a page.
These are defined in `/packages/client/src/pages/` and should be organized by the path you use to see them.
### Components
If it is not a page, it is probably a component.
Components can be things like the emoji picker, a tooltip, a widget.
Components can be combined to make bigger components or also pages.
They are defined in `/packages/client/src/components/`.
### Directives
Vue has "directives", e.g. you can add an attribute to a component like `v-tooltip`.
There are some built in directives like e.g. `v-if` and `v-for`.
Other custom directives are defined in `/packages/client/src/directives/`.
They are added to the Vue app in `index.ts` and their behavior is defined in separate files in the directory.