-
Notifications
You must be signed in to change notification settings - Fork 0
26 set up the database on the VM #66
Conversation
…ss configuration of the databse in VM
Keeps the work of #66 (the setup script, the build and start scripts, Prisma 7.10.1, base /project2/ in Vite). The server entry point is now backend/src/index.ts, which replaces the first version, and the resolvers of the first version are replaced by backend/src/server/resolvers/. start runs tsx, because there is no dist/.
|
@xeniag Thanks for starting on this. I ran the branch against a fresh PostgreSQL 18 with the seeded catalog.
The problems I found in the server (search results that cannot be read, The VM instructions are the main part that is still missing. Do you want to take them, or should someone else? Comment made with Claude Code in discussion with Ronja |
VM PostgreSQL 18 Setup
|
Summary of Changes & Review Fixes (#26)This PR addresses all outstanding setup and configuration requirements for database infrastructure, deployment path alignment, and code cleanups: 1. VM Database Setup & Dual-User Security Model
2. Configuration & Environment Updates
3. Asset Path Fixes & Code Cleanup
|
Summary
Xenia's work on #26 ("Set up the database on the VM"), opened as a pull request so it can be reviewed. It prepares the backend for the virtual machine. It is a first step, and it does not yet do everything that #26 asks for (see "Not in this PR").
What is in it
backend/src/index.ts: a first entry point for the server (Apollo Server standalone), which loadssrc/schema.graphqland connects to the database with the existing Prisma client.backend/src/resolvers.ts: a resolver forsearchCatalogthat calls the search function frombackend/src/catalog/search.ts.backend/package.json: new scriptssetup(prisma migrate deployand then the seed),dev,buildandstart, and Prisma moved to^7.10.1.package.json: the server packages (@apollo/server,graphql,pg,dotenv,tsx,@prisma/client,prismaand some types) are added at the root.vite.config.ts:base: '/project2/', because the app is served by Apache under/project2on the virtual machine.Not in this PR (still open in #26)
docs/API.mddescribes two users there: one that the backend uses (reads and writes the tables, cannot create users or databases) and one for the migrations.Notes for review
I have only read this branch, not run it. These are things to check:
backend/src/server.ts,backend/src/server/) with the catalog resolvers, DataLoader, the error handling and the settings. This PR has a second entry point (index.ts) and a second set of resolvers. Only one of the two should be the server.searchCatalogreturns catalog entries, but the schema saysnode: CatalogItem(an interface that is resolved toElementorVault). The resolver here does not resolve the interface, so a query fornode { ... }may fail. feat: add the GraphQL server with the catalog queries #65 has this.buildandstart:backend/tsconfig.jsonhasnoEmit: true, sotscdoes not writedist/, andstartrunsnode dist/index.js. Runningtsx(as indev) works without a build.index.tsdefaults to 4000, while the backend should be on 3001 on the VM.index.tsreadssrc/schema.graphqlfrom the current folder, so it only works when started frombackend/.backend/package.json, so the server packages may belong there.setupscript runs the migrations and the seed with oneDATABASE_URL. With two users on the VM (see above), the migration user is the one that must run it.Part of #26
🤖 Generated with Claude Code