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=localin.justenv. - Build the Docker environment:
- Execute:
docker compose -f docker-compose.local.yml build - Or use
just buildfor a simplified process.
- Execute:
- Launch the Docker environment:
- Execute:
docker compose -f docker-compose.local.yml up -d - Or use
just upfor convenience.
- Execute:
This will automatically handle data migrations and imports.
- Access the server directory:
-
Updating Dependencies: You will need to install
uvand runuv synclocally 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. - Copy
.env.exampleto.env.localand setVERCEL_ENV=development. - Update your
/etc/hostsfile withsatoshi.localhost:Note: if you do not want these redirects, instead add127.0.0.1 satoshi.localhost ::1 satoshi.localhost.env.localto 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/mempoolwith 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/librarywith the naming convention<slug>.<ietf-code>.md(e.g.,bitcoin.es.md).
- Localized Content Pages: Locate content pages within
client/content/pagesand add localized files using the<filename>.<ietf-code>.mdformat. - Application Strings Localization: Application strings are found under
client/locales.
- New Languages: To introduce a new language, update
LocalesandLocaleTypeinserver/sni/constants.py, as well aslanguagesandlocalesinclient/i18n.ts. Then, executepnpm translate:extractwithin theclientdirectory.
NakamotoInstitute.org is licensed under the GNU Affero License.