feat(isac): link skill chips to abilities
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
# SHD.build
|
||||
|
||||
A SvelteKit application for creating and sharing loadouts for *The Division Resurgence*.
|
||||
A SvelteKit community application for *The Division Resurgence*. SHD.build
|
||||
combines a public game database, loadout builder, shared builds, guides,
|
||||
account management, and the ISAC data-management console.
|
||||
|
||||
The first increment includes a responsive discovery page, an anonymous builder draft saved to local storage, authentication UI boundaries, an admin data-management preview, and an embedded Turso database foundation. See `docs/architecture.md` for the staged implementation plan.
|
||||
See `docs/architecture.md` for the implementation model.
|
||||
|
||||
## Database
|
||||
|
||||
The server uses the in-process `@tursodatabase/database` package with a local
|
||||
SQLite-compatible file—there is no Turso Cloud dependency.
|
||||
The server uses the in-process `@tursodatabase/database` package and a local
|
||||
SQLite-compatible file. Turso Cloud is not required.
|
||||
|
||||
Create or update the local database:
|
||||
|
||||
@@ -15,10 +17,10 @@ Create or update the local database:
|
||||
npm run db:migrate
|
||||
```
|
||||
|
||||
The default file is `data/shd-build.db`. Copy `.env.example` to `.env` to
|
||||
override its location.
|
||||
The default file is `data/shd-build.db`. Copy `.env.example` to `.env` and
|
||||
set a different location if needed.
|
||||
|
||||
Custom avatars are stored as metadata-free 256 × 256 WebP files. Set
|
||||
Store custom avatars as metadata-free 256 × 256 WebP files. Set
|
||||
`TDR_AVATAR_STORAGE_PATH` to a persistent, writable directory in production;
|
||||
it defaults to `data/avatars`. The same configuration works on Windows and
|
||||
Linux.
|
||||
@@ -29,9 +31,9 @@ Seed the initial local accounts once:
|
||||
npm run db:seed-users
|
||||
```
|
||||
|
||||
This creates administrator `Aewyn` and standard user `Quartermaster`. Strong
|
||||
temporary passwords are generated and displayed once; only salted Argon2id
|
||||
hashes are stored.
|
||||
The seed creates administrator `Aewyn` and standard user `Quartermaster`.
|
||||
It generates and displays strong temporary passwords once, then stores only
|
||||
salted Argon2id hashes.
|
||||
|
||||
## Develop
|
||||
|
||||
@@ -41,9 +43,9 @@ npm run dev
|
||||
|
||||
## Encrypted environment files
|
||||
|
||||
Development, staging, and production settings live in the committed, encrypted
|
||||
`.env.development`, `.env.staging`, and `.env.production` files. Private
|
||||
decryption keys live only in the ignored `.env.keys` file; back it up in a
|
||||
Keep development, staging, and production settings in the committed, encrypted
|
||||
`.env.development`, `.env.staging`, and `.env.production` files. Keep private
|
||||
decryption keys only in the ignored `.env.keys` file and back it up in a
|
||||
password manager.
|
||||
|
||||
```sh
|
||||
@@ -56,42 +58,38 @@ npm run env:decrypt:production
|
||||
npm run env:sync:staging-credentials # copy shared Discord/SMTP values from development
|
||||
```
|
||||
|
||||
The repository pre-commit hook runs `env:stage`, so a commit always replaces
|
||||
staged plaintext environment files with encrypted versions. Git does not expose
|
||||
a pre-add hook, so use `npm run env:stage` instead of directly adding these two
|
||||
files when possible.
|
||||
The repository pre-commit hook runs `env:stage` and replaces staged plaintext
|
||||
environment files with encrypted versions. Git has no pre-add hook. Use
|
||||
`npm run env:stage` instead of directly adding these two files.
|
||||
|
||||
Never commit or lose `.env.keys`. Production should receive
|
||||
`DOTENV_PRIVATE_KEY_PRODUCTION` through its secret manager rather than copying
|
||||
the keys file onto the server.
|
||||
Keep `.env.keys` out of Git and retain a backup. Production deployments receive
|
||||
`DOTENV_PRIVATE_KEY_PRODUCTION` through their secret manager; do not copy the
|
||||
keys file to the server.
|
||||
|
||||
## Containers and staging deployment
|
||||
|
||||
The application uses the official SvelteKit Node adapter and includes a
|
||||
multi-stage `Dockerfile`. Database files, database backups, user avatars, and
|
||||
uploaded game-data icons live under `/app/data`, which must be a persistent
|
||||
volume. Runtime secrets are injected when the container starts and are never
|
||||
baked into the image.
|
||||
The application uses the official SvelteKit Node adapter and a multi-stage
|
||||
`Dockerfile`. Keep database files, database backups, user avatars, and uploaded
|
||||
game-data icons under `/app/data` on a persistent volume. Inject runtime secrets
|
||||
when the container starts; keep them out of the image.
|
||||
|
||||
The staging compose topology and Gitea Actions deployment are documented in
|
||||
[docs/DEPLOYMENT.md](docs/DEPLOYMENT.md). Pushes to `main` validate the
|
||||
application, build the candidate image while staging remains online, stop the
|
||||
application and scheduler briefly, back up the embedded database, migrate it,
|
||||
and start the new release.
|
||||
[docs/DEPLOYMENT.md](docs/DEPLOYMENT.md) documents the staging Compose topology
|
||||
and Gitea Actions deployment. A push to `main` validates the application,
|
||||
builds the candidate image while staging stays online, stops the application
|
||||
and scheduler for the database backup and migration, then starts the release.
|
||||
|
||||
## Passwordless authentication
|
||||
|
||||
Passkeys are the preferred sign-in method. `APP_ORIGIN` must exactly match the
|
||||
public origin used for registration and authentication, while `PASSKEY_RP_ID`
|
||||
must be that hostname or a registrable parent domain. The hosted environments
|
||||
use `shd.build`, allowing credentials on both `shd.build` and
|
||||
`dev.shd.build`. Direct localhost development should use `localhost`.
|
||||
Use passkeys as the preferred sign-in method. Set `APP_ORIGIN` to the exact
|
||||
public origin for registration and authentication. Set `PASSKEY_RP_ID` to that
|
||||
hostname or a registrable parent domain. Hosted environments use `shd.build`,
|
||||
which permits credentials on `shd.build` and `dev.shd.build`. Use `localhost`
|
||||
for direct local development.
|
||||
|
||||
Magic links require `SMTP_HOST`, `SMTP_PORT`, `SMTP_SECURE`, `SMTP_USER`,
|
||||
`SMTP_PASSWORD`, and `SMTP_FROM`. Port 465 normally uses
|
||||
`SMTP_SECURE=true`; port 587 normally uses `false` and upgrades with STARTTLS.
|
||||
Email identities become usable only after the account owner follows a
|
||||
15-minute, single-use verification link.
|
||||
`SMTP_PASSWORD`, and `SMTP_FROM`. Use `SMTP_SECURE=true` on port 465. Use
|
||||
`false` on port 587 and upgrade with STARTTLS. An account owner activates an
|
||||
email identity by following a 15-minute, single-use verification link.
|
||||
|
||||
## Validate
|
||||
|
||||
@@ -100,12 +98,10 @@ npm run check
|
||||
npm run build
|
||||
```
|
||||
|
||||
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
|
||||
[`sv`](https://github.com/sveltejs/cli) creates and configures Svelte projects.
|
||||
|
||||
## Creating a project
|
||||
|
||||
If you're seeing this, you've probably already done this step. Congrats!
|
||||
|
||||
```sh
|
||||
# create a new project
|
||||
npx sv create my-app
|
||||
@@ -120,7 +116,8 @@ npx sv@0.16.5 create --template minimal --types ts --install npm .
|
||||
|
||||
## Developing
|
||||
|
||||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
||||
Install dependencies with `npm install` (or `pnpm install` or `yarn`), then
|
||||
start a development server:
|
||||
|
||||
```sh
|
||||
npm run dev
|
||||
@@ -131,15 +128,16 @@ npm run dev -- --open
|
||||
|
||||
## Building
|
||||
|
||||
To create a production version of your app:
|
||||
Build a production version:
|
||||
|
||||
```sh
|
||||
npm run build
|
||||
```
|
||||
|
||||
You can preview the production build with `npm run preview`.
|
||||
Preview the production build with `npm run preview`.
|
||||
|
||||
> Deployments may require an [adapter](https://svelte.dev/docs/kit/adapters) for the target environment.
|
||||
|
||||
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
|
||||
The shared visual language and dashboard conventions are documented in
|
||||
[docs/DESIGN_SYSTEM.md](docs/DESIGN_SYSTEM.md).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user