The SNI website is comprised of a headless CMS built with FastAPI and a frontend built with NextJS.
The server relies on Docker Compose for environment management. Ensure Docker Compose is installed on your system. To aid in local development, just
commands are also provided.
-
Getting Started:
- Access the server directory:
cd server
. - If you are using
just
, setENV=local
in.justenv
. - Build the Docker environment:
- Execute:
docker compose -f docker-compose.local.yml build
- Or use
just build
for a simplified process.
- Execute:
- Launch the Docker environment:
- Execute:
docker compose -f docker-compose.local.yml up -d
- Or use
just up
for convenience.
- Execute:
This will automatically handle data migrations and imports.
- Access the server directory:
-
Updating Dependencies: You will need to install
uv
and runuv sync
locally to update the dependencies inuv.lock
. -
API Access: The API is accessible at
http://localhost:8000
. -
Local Document Serving: For local serving of PDFs, ePubs, etc., download the necessary files from here and place them in
server/static/docs
.
The frontend uses pnpm
for package management. Ensure pnpm
is installed before proceeding.
-
Getting Started:
- Navigate to the client directory:
cd client
. - Update your
/etc/hosts
file withsatoshi.localhost
:Note: if you do not want these redirects, instead add127.0.0.1 satoshi.localhost ::1 satoshi.localhost
.env.local
to the client directory:MAP_DOMAIN=false
- Install dependencies:
pnpm i
. - Start the development server:
pnpm dev
.
- Navigate to the client directory:
-
Website Access: The site is available at
http://localhost:3000
.
The SNI platform is designed with i18n and l10n at its core, actively supporting and encouraging the translation of content across various sections, including the Mempool, the library, content pages, and application strings.
To contribute Mempool translations:
-
Markdown Front Matter: Include the required metadata using the schema below:
title: # Translated post title slug: # Translated slug (ASCII only) (Optional) excerpt: # Key quote (refer to English posts) (Optional) translation_url: # Original translation URL (Optional) translation_site: # Original publication name (Optional) translation_site_url: # Original publication URL (Optional) translators: # List of translator slugs (Optional) image_alt: # Translated header image alt text (Optional)
-
File Placement: Save the markdown file in
server/content/mempool
with the naming convention<slug>.<ietf-code>.md
(e.g.,speculative-attack.es.md
).
For library content translations, follow these guidelines:
-
Markdown Front Matter: Utilize the schema below for metadata:
title: # Translated document title slug: # Translated slug (ASCII only) (Optional) subtitle: # Translated subtitle (Optional) display_title: # Display title in the translated language (Optional) external: # Source URL of the translation (Optional) sort_title: # Title for sorting purposes (Optional) image_alt: # Translated document header image alt text (Optional) formats: # Available formats [pdf, epub, mobi, txt] (Optional) translators: # Translator slugs list (Optional)
-
File Placement: Save the markdown file in
server/content/library
with the naming convention<slug>.<ietf-code>.md
(e.g.,bitcoin.es.md
).
- Localized Content Pages: Locate content pages within
client/content/pages
and add localized files using the<filename>.<ietf-code>.md
format. - Application Strings Localization: Application strings are found under
client/locales
.
- New Languages: To introduce a new language, update
Locales
andLocaleType
inserver/sni/constants.py
, as well aslanguages
andlocales
inclient/i18n.ts
. Then, executepnpm translate:extract
within theclient
directory.
NakamotoInstitute.org is licensed under the GNU Affero License.