docs: describe running the verified MVP and the demo stand
This commit is contained in:
1 parent
f1a8064d51
commit
fc35e27af5
6 files changed
+254
-10
No files matched your search
+112
-1
@@ -2,6 +2,117 @@
|
||||
|
||||
This guide describes the checked-in configuration. Compose provides a local technical stack; it does not establish a production deployment.
|
||||
|
||||
## Running the MVP: quick start
|
||||
|
||||
This section is for anyone who starts the MVP on their own machine: the jury, the team, or a reviewer. Run the commands from the repository root; the other sections of this guide describe each setting in detail. The scenarios below were run on a fresh clone with the example files `.env.example` and `deploy/demo/demo.env.example`.
|
||||
|
||||
### Implemented and planned
|
||||
|
||||
Implemented in this build (backend API and frontend screens):
|
||||
|
||||
- Candidate and employer registration with consent C1, email confirmation through the link in the message, sign-in, sign-out, and resuming from the saved step. Mail is sent only with `EMAIL_PROVIDER=resend`.
|
||||
- Candidate cabinet: consents C1-C5, a manual profile without a resume and without an FSP ID, the questionnaire with specializations and self-assessment, and the home page with the next step.
|
||||
- Skill assessment: the `demo_express` demonstration express run without a grade and the `demo_basic` full test with a result, result history, and skill evidence. On the demo stand a passed full test receives an uncalibrated synthetic category. The operator can read the [review band](#assessment-review-band).
|
||||
- Privacy: publication of the anonymous card (C2), preview, search status, hidden organizations, and the history of changes and card views.
|
||||
- Employer cabinet: organizations (one account can own several and be a recruiter in others), the company profile, needs with a salary range, deterministic candidate search over the bank or by a need without ML, with an explanation of the components, and the anonymous card with its evidence. Only an organization owner can search.
|
||||
- Support cases in both cabinets, including a manual assessment request after a C3 refusal.
|
||||
- The notification inbox in both cabinets. In this build no product workflow creates notifications yet, so the list is empty.
|
||||
- Invitation drafts on the organization side only and through the API only: create, list, read, and change the terms with versions. There is no invitation screen.
|
||||
|
||||
Planned and not working: sending an invitation to a candidate (the API answers 501 `not_implemented`), the candidate invitation inbox, viewing, accepting, and declining, withdrawal, salary raise, and contact release, the invitation screens in both cabinets (placeholders now), password reset, mail for product notifications, resume upload and parsing, PDF, FSP integration, ML inference and semantic search, the adaptive test, sandbox practice, percentiles and calibrated grades, and the SMTP transport.
|
||||
|
||||
### Requirements
|
||||
|
||||
Docker Engine with the Compose plugin, GNU make, python3 (the `deploy` targets run check scripts), and openssl to generate a secret. No GPU, external inference key, or FSP access is needed: no target reads one. The first start builds the backend and frontend images and pulls base images, so it takes several minutes; later starts use the cache.
|
||||
|
||||
### Stand parameters
|
||||
|
||||
| Stand | Command | Compose project | Address | Data |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| Core | `make -C deploy up` | `APP_PROJECT`, default `app` | http://localhost:8080 (`APP_HTTP_PORT`, bound to `APP_HTTP_BIND=127.0.0.1`) | Migrations and the startup policy version 1; no assessment bank, matching section, or accounts |
|
||||
| Demo | `make -C deploy demo-seed DEMO_MODE=isolated` | `DEMO_PROJECT`, default `lincodex-demo` | http://localhost:8090 (`DEMO_HTTP_PORT`, `DEMO_PUBLIC_URL`) | Synthetic accounts, organizations, assessment bank, and prepared attempts |
|
||||
| Technical smoke | `make -C deploy smoke` | `lincodex-smoke`, removed after the run | 127.0.0.1:18080 during the check | None |
|
||||
| ML | `make -C deploy ml-up` | `ML_PROJECT`, default `ml` | http://127.0.0.1:8000 (`ML_HTTP_PORT`) | No model; `/readyz` answers 503 |
|
||||
| Monitoring | `make -C deploy monitoring-up` | `MONITORING_PROJECT`, default `monitoring` | Grafana http://127.0.0.1:3000 | Metrics and logs of the core stack |
|
||||
|
||||
- Open a stand exactly at the address in `APP_PUBLIC_URL` or `DEMO_PUBLIC_URL`, that is through `localhost`. The backend compares the Origin of every changing request with this address, so signing in from a page at http://127.0.0.1:8090 is refused with 403 `csrf_check_failed`. The session cookie has the `Secure` flag; browsers accept it at http://localhost, and another host needs HTTPS (see [Edge proxy, HTTPS and tunnel](#edge-proxy-https-and-tunnel)).
|
||||
- Make takes the project name from the command line or the environment, not from `.env`. To run a stack under another name, pass the same value to every target: `make -C deploy up APP_PROJECT=<name>`, then `logs` and `down` with that value. The port and bind address come from `.env`.
|
||||
- The core and demo stands use different subnets and ports and can run at the same time.
|
||||
|
||||
### 1. Core stack
|
||||
|
||||
cp .env.example .env
|
||||
# replace every replace-this-... value with your own;
|
||||
# POSTGRES_PASSWORD takes URL-safe characters only, for example hex
|
||||
# IDENTITY_KEY_SECRET= paste the output of: openssl rand -base64 48
|
||||
make -C deploy config
|
||||
make -C deploy up
|
||||
curl http://localhost:8080/api/v1/healthz
|
||||
|
||||
The last command answers `{"status":"ok"}`; then open http://localhost:8080. Compose does not start with an empty `IDENTITY_KEY_SECRET`, and the backend refuses a value that starts with `replace-this`. `make -C deploy smoke` is a separate throwaway technical check: it starts its own stack with the values of `.env.example`, checks the health routes, dependency failures, and storage isolation, and removes its containers and volumes. It does not check the running stack and does not prove a business workflow.
|
||||
|
||||
The core stack is a clean base for a working stand. Without further steps it serves the public pages, registration, and the health checks. No assessment bank is loaded, so a test cannot start, and search answers 500 until an operator publishes the matching section (see [Match search policy on a stand](#match-search-policy-on-a-stand)). Use the demo stand to show the product.
|
||||
|
||||
### 2. Mail: Resend or disabled
|
||||
|
||||
- `EMAIL_PROVIDER=disabled` (the `.env.example` value) sends nothing. Registration is accepted (202), but the address cannot be confirmed, so signing in with such an account answers 403 `email_not_verified`. The prepared accounts of the demo stand need no mail.
|
||||
- `EMAIL_PROVIDER=resend` sends confirmation mail through Resend. Set `RESEND_API_KEY` in the server environment only and never commit it, set `EMAIL_FROM` to an address on a domain verified in the Resend account, and set `APP_PUBLIC_URL` to the origin the user opens, because the link in the message leads there. Then run `make -C deploy up` again. Only confirmation mail is sent; the default quotas are 100 recipients per day and 3000 per month (see [Mail](#mail) and [Mail quotas](#mail-quotas)). The repository does not test real Resend: the browser test `make -C deploy test-e2e-registration` registers through a local Resend-compatible inbox.
|
||||
- `EMAIL_PROVIDER=smtp` stops the backend at startup in this build.
|
||||
|
||||
### 3. Demo stand
|
||||
|
||||
make -C deploy demo-seed DEMO_MODE=isolated
|
||||
|
||||
The target needs the root `.env` from step 1: the stand takes the secrets and the mail transport from it and overrides the project name, port, address, and subnet. The command starts a separate project, waits for backend readiness, fills the database with synthetic data, and prints the list of logins; a repeated run creates nothing and prints the same list. Open http://localhost:8090.
|
||||
|
||||
Every prepared account uses `DEMO_ACCOUNT_PASSWORD` from `deploy/demo/demo.env`, or from `deploy/demo/demo.env.example` when that file does not exist. The example value is a published demo credential of synthetic accounts, not a secret. For a stand reachable from outside, copy the example to `demo.env`, set a new password, run `make -C deploy demo-reset DEMO_MODE=isolated`, and give the password to the jury separately.
|
||||
|
||||
| Login | Purpose |
|
||||
| --- | --- |
|
||||
| `candidate@demo.lincodex.test` | Self-guided run: the express run and the Backend Junior full test with Go |
|
||||
| `prepared-1@demo.lincodex.test` - `prepared-6@demo.lincodex.test` | Candidates with a completed full test, a synthetic Backend Junior category, evidence, and a published card |
|
||||
| `employer-alpha@demo.lincodex.test` | Owner of the "Alpha" organization and recruiter in "Beta" |
|
||||
| `employer-beta@demo.lincodex.test` | Owner of the "Beta" organization |
|
||||
|
||||
The full inventory and the seed rules are in [Isolated demo stand](#isolated-demo-stand).
|
||||
|
||||
### 4. Demonstration route
|
||||
|
||||
1. Candidate: sign in as `candidate@demo.lincodex.test` and open the skill assessment (`/candidate/assessment`). The demonstration express run has three items and ends with the result "demonstration": no grade, category, percentile, or evidence, and it does not appear in the real result history. This is the express run without a grade.
|
||||
2. On the same page start the Backend Junior full test with Go: 25 items, a 72-hour deadline, two work sessions, no practice. After it completes, the result is compared with the pass mark of the demo policy; a passed test receives an uncalibrated synthetic category, a failed one the result `not_confirmed`. The result and the history open at `/candidate/results`.
|
||||
3. Prepared candidate: sign in as `prepared-1@demo.lincodex.test` and open the results, the skill evidence, and the privacy settings with the published card.
|
||||
4. Employer: sign in as `employer-alpha@demo.lincodex.test`, select "Alpha", create a need, and open the search (`/employer/candidates`). The main group holds the six prepared cards with the flags `ml_unavailable` and `cohort_below_30`; a card and its evidence open from the results. In "Beta" the same account is a recruiter, and search answers 403: in the minimal release only the owner can search.
|
||||
5. Invitations: the screen in both cabinets is a placeholder. A draft can be created through the API only; sending and the candidate's answer are planned.
|
||||
|
||||
### 5. FSP, ML, and data
|
||||
|
||||
- FSP: there is no integration in any mode. This build has no off or mock switch, no fixture provider, and no call to an external API. The profile is filled in manually, linking an FSP ID is optional and not available yet, and the path to a category goes through the questionnaire and the test. The project has no official access to FSP data and does not promise it; an FSP link through a fixture provider is planned (see [ARCHITECTURE.md](ARCHITECTURE.md#identity-fsp-and-privacy)).
|
||||
- ML: the core and demo stands do not start ML and do not call it. Search uses the neutral semantic similarity 0.5 and marks it with the `ml_unavailable` flag. `make -C deploy ml-up` starts a separate service without a model: `/healthz` answers 200 and `/readyz` 503. The core needs no GPU or external inference key and reads none.
|
||||
- Data: the demo stand holds synthetic data only. Addresses on the reserved domain `@demo.lincodex.test` never receive mail, names are marked as synthetic, categories have the source `synthetic_demo` and are uncalibrated, and the item families are synthetic and had no subject review. Do not register real people on this stand. Only the demo overlay enables synthetic categories (`ASSESSMENT_DEMO_CATEGORIES_ENABLED=true`); `.env.example` sets `false`.
|
||||
|
||||
### 6. Checks
|
||||
|
||||
| Command | What it shows |
|
||||
| --- | --- |
|
||||
| `make docs-check` | Documentation structure and local links |
|
||||
| `make -C deploy config` | Rendering of every Compose file without starting it |
|
||||
| `make -C deploy smoke` | Technical smoke on a throwaway stack |
|
||||
| `make -C frontend install`, then `make -C deploy test-e2e` | The Playwright browser suite on a throwaway stack |
|
||||
| `make -C deploy test-e2e-registration` | Browser registration, confirmation, and sign-in through a local Resend-compatible inbox |
|
||||
| `make -C deploy check-demo` | The guards of the demo stand targets without starting services |
|
||||
| `make test`, `make check`, `make verify` | The full check set, see [TESTING.md](TESTING.md#commands) |
|
||||
|
||||
The smoke and the browser suites do not start the demo stand; an integration test covers its seed (see [Demo seed tests](TESTING.md#demo-seed-tests)).
|
||||
|
||||
### 7. Stop and clean up
|
||||
|
||||
make -C deploy down
|
||||
make -C deploy demo-down DEMO_MODE=isolated
|
||||
make -C deploy ml-down
|
||||
make -C deploy monitoring-down
|
||||
|
||||
These targets stop the containers and keep the volumes. `make -C deploy demo-reset DEMO_MODE=isolated` recreates the demo stand with its initial data only when it holds no ordinary account; otherwise the reset refuses and deletes nothing. Removing a demo project together with its data is a deliberate manual decision only: `docker compose -p lincodex-demo down --volumes` with the name of your project. The `<project>-backend`, `<project>-frontend`, and `<project>-demo-seed` images built by these targets stay local; remove them with `docker image rm` when they are not needed.
|
||||
|
||||
## Core application
|
||||
|
||||
Install Docker Engine and the Docker Compose plugin. At the repository root, copy .env.example to .env, replace every placeholder password, and keep the file local. Then run:
|
||||
@@ -19,7 +130,7 @@ The backend build context is `backend/`, so Docker applies `backend/.dockerignor
|
||||
|
||||
The current `postgres:alpine` volume mounts at `/var/lib/postgresql`; the image stores data in a subdirectory for its major version. When the tag advances to a new major version, migrate an existing database with `pg_upgrade` or backup/restore. Updating the image alone does not convert the data.
|
||||
|
||||
Open http://127.0.0.1:8080. The host port binds to loopback. Nginx handles /healthz, proxies /api/v1/ to Go, and uses the SPA fallback for other paths; see [Public perimeter and client address](#public-perimeter-and-client-address). The public API health route is /api/v1/healthz through Nginx /api/v1/. On the internal port 8080, Go also serves /healthz for the process and /readyz, which checks PostgreSQL with SELECT 1, Redis with PING, and the SeaweedFS bucket with HeadBucket; any dependency being unavailable produces 503. The internal backend port 9090 serves /metrics.
|
||||
Open http://localhost:8080, the address in `APP_PUBLIC_URL`: from another origin, changing requests, including sign-in, are refused. The host port binds to loopback. Nginx handles /healthz, proxies /api/v1/ to Go, and uses the SPA fallback for other paths; see [Public perimeter and client address](#public-perimeter-and-client-address). The public API health route is /api/v1/healthz through Nginx /api/v1/. On the internal port 8080, Go also serves /healthz for the process and /readyz, which checks PostgreSQL with SELECT 1, Redis with PING, and the SeaweedFS bucket with HeadBucket; any dependency being unavailable produces 503. The internal backend port 9090 serves /metrics.
|
||||
|
||||
This Nginx configuration has no production TLS. The current bind does not expose the app directly to the public network. Remote access needs a selected TLS reverse proxy, firewall rules, and environment-specific configuration.
|
||||
|
||||
|
||||
Reference in new issue
Block a user