Local development
Run the API and dashboard from source, run the checks, add migrations and translations, and test against S3.
Tessra is an ASP.NET Core API (backend/), a Nuxt dashboard (frontend/) and this documentation site (docs-site/). For how the code is laid out, see the repository README.
Running from source
Requirements: .NET SDK 10.0.4xx, Node 26, pnpm 11.
# API on :5080 (Development environment)
cd backend/Tessra.Api
dotnet run
# First run: complete setup with the secret in .data/bootstrap-secret
# SPA on :3000, proxying /api, /s/, /d/ and /health to :5080
cd frontend && pnpm install && pnpm dev
Use http://localhost:3000 in development; it is the configured base URL, so cookies and CSRF origin checks behave as in production.
To serve the built SPA from the API on one origin without Docker, run pnpm generate, copy frontend/.output/public/* into backend/Tessra.Api/wwwroot/ (gitignored), and start the API with Tessra__BaseUrl=http://localhost:5080. Then open http://localhost:5080.
Translations
- Dashboard: strings live in
frontend/i18n/locales/en.json. To add a language, add its JSON file, an entry ini18n.localesinnuxt.config.tsand the matching Nuxt UI locale inapp.vue. - API errors: every problem response has a stable
code(andargsfor values such as the upload limit). The dashboard showsapiErrors.<code>from the locale file;detailstays English for ShareX and other clients. - Share, deletion and not-found pages: strings live in
backend/Tessra.Api/Resources/Sharing/SharePageStrings.resx. AddSharePageStrings.<culture>.resx(for exampleSharePageStrings.de.resx) and the language is picked up from the dashboard's language cookie orAccept-Language, with English for anything missing.
Database migrations
The schema is a versioned EF Core migration history in backend/Tessra.Api/Data/Migrations, applied at startup before the app serves requests. After changing the model, add a migration and commit it; a test fails if the model and migrations drift apart.
dotnet tool restore
dotnet ef migrations add <Name> --project backend/Tessra.Api --output-dir Data/Migrations
Databases created by the 0.0 spike have no migration history and are refused at startup. Delete the data directory's db and blobs folders to start fresh.
Checks
dotnet test Tessra.slnx
cd frontend && pnpm typecheck && pnpm generate
Testing S3 locally
cp deployments/dev/seaweedfs-s3.json.example deployments/dev/seaweedfs-s3.json # set a secret
docker compose --profile s3 up -d s3
docker compose exec s3 sh -c "echo 's3.bucket.create -name tessra' | weed shell"
# then set the Tessra__Storage__* variables in .env (see .env.example) and restart tessra
The S3 credentials can also be read from files, e.g. Docker secrets: set Tessra__Storage__S3__AccessKeyFile and Tessra__Storage__S3__SecretKeyFile instead of the plain values.
To check that storage works, open Settings › Storage and click Test storage. It writes a small probe object, reads it back and deletes it, and shows which step failed if one does.
To try the whole app on S3 in one step, with the bucket created for you and throwaway credentials:
docker compose -f deployments/dev/compose.s3.yaml up --build
# open http://localhost:8081; the setup secret is printed by:
docker compose -f deployments/dev/compose.s3.yaml exec tessra cat /data/bootstrap-secret
# when done (removes its data):
docker compose -f deployments/dev/compose.s3.yaml down -v
Running the S3 contract tests
dotnet test always runs the storage contract tests (ADR 0006) against local storage. To run them against S3 as well, start the same SeaweedFS that CI uses and point the tests at it. PowerShell:
docker run -d --rm --name tessra-test-s3 -p 8333:8333 `
-v "${PWD}/deployments/ci/seaweedfs-s3.json:/etc/seaweedfs/s3.json:ro" `
chrislusf/seaweedfs:4.55 server -dir=/data -s3 -s3.port=8333 -s3.config=/etc/seaweedfs/s3.json
$env:TESSRA_TEST_S3_SERVICE_URL = "http://localhost:8333"
$env:TESSRA_TEST_S3_ACCESS_KEY = "tessra-ci"
$env:TESSRA_TEST_S3_SECRET_KEY = "tessra-ci-throwaway-secret"
dotnet test Tessra.slnx --filter StorageContractTests
docker stop tessra-test-s3
Any other S3-compatible service works the same way, with TESSRA_TEST_S3_BUCKET (default tessra-test) naming a bucket the tests may write to and TESSRA_TEST_S3_REGION (default us-east-1) the signing region. Set TESSRA_TEST_S3_CONDITIONAL_WRITES=false for a service that rejects If-None-Match. A token scoped to one existing bucket is enough. For Cloudflare R2, use a separate test bucket:
$env:TESSRA_TEST_S3_SERVICE_URL = "https://<account_id>.r2.cloudflarestorage.com"
$env:TESSRA_TEST_S3_REGION = "auto"
$env:TESSRA_TEST_S3_BUCKET = "tessra-test"
$env:TESSRA_TEST_S3_ACCESS_KEY = "<Access Key ID>"
$env:TESSRA_TEST_S3_SECRET_KEY = "<Secret Access Key>"
dotnet test Tessra.slnx --filter "StorageContractTests|ServingTests|BackupTests"
Documentation
The docs site is in docs-site/. Run docker compose up docs from the repository root and open http://localhost:3001, or pnpm install && pnpm dev inside docs-site/. pnpm generate && pnpm check-links builds it and checks its links. See Writing documentation.