# Standard Notes

Summarizing my attempts to understand StandardNotes codebase.

* How does it sync?
* How does it encrypt?
* How does it deal with conflicts?
* Overall front-end code structure?
* How does it store on user disk?
* How does it store on the server?

## Code

* Web client (also core for desktop): <https://github.com/standardnotes/web>
* Desktop client: <https://github.com/standardnotes/desktop>
  * JS/TS: <https://github.com/standardnotes/web/tree/develop/app/assets/javascripts>
  * Angular.
* Syncing server: <https://github.com/standardnotes/syncing-server-js>
* Core js logic: <https://github.com/standardnotes/snjs>

## Thoughts & Observations

* Web
  * I love how easy it is to start it locally. `yarn install && yarn start`. Done.
  * What is the rails server doing inside the client app?
  * Are there any tests?
* Sync server
  * DI with inversify.
  * Specs are located right next to the code under test.&#x20;
  * Bindings are helpful to understand where everything is <https://github.com/standardnotes/syncing-server-js/blob/develop/src/Bootstrap/Container.ts>
  * What is extensions server?
    * I thought all extensions were client-side? If so, why do anything about them when syncing items?
  * Are notes just rows in MySQL?
    * <https://github.com/standardnotes/syncing-server-js/blob/5114b03c273ca99aacc40f1c2f6b29a0c998d48c/src/Domain/Item/Item.ts>
    * I expected them to be blobs in some blobstore or something.
    * Is there a limit on the item size then?
  * S3, SNS, SQS - what are they doing here?
  * ItemService - seems to actually handle persistence <https://github.com/standardnotes/syncing-server-js/blob/5114b03c273ca99aacc40f1c2f6b29a0c998d48c/src/Domain/Item/ItemService.ts>
  * What exactly does "projection" mean?
    * Conversion between persistent-data and some transfer format?
  * S3 backup
    * <https://github.com/standardnotes/syncing-server-js/blob/develop/src/Infra/S3/S3ItemBackupService.ts>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.ainzzorl.lol/tech/open-source/standard-notes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
