The applications tracker, leads inbox, email pipeline and capture userscript move here from web_server's backend, Python service and Vue app, as one Go binary that serves its own Vue SPA under /jobs/. - The Go services, resolvers and tests move over almost unchanged. - The three Claude calls are ported from Python to Go (internal/claude), with the same prompts, per-model request shaping and error messages. - There is no login: internal/auth asks the site backend's /auth/validate-admin with the visitor's cookies, and relays refreshed cookies back. - A Settings page replaces the admin-panel capture token card and adds the Microsoft sign-in link and a manual email sync. - The userscript is 2.0.0, at /jobs/, and migrates a saved API base. - Dockerfile, a standalone compose with Postgres, Makefile, and a Gitea CI workflow that tests and publishes the image. Co-Authored-By: Claude Opus 5.5 <[email protected]>
26 lines
1.4 KiB
Go
26 lines
1.4 KiB
Go
// Package graph is the GraphQL layer: the single POST /jobs/api/graphql
|
|
// endpoint behind every page of the tracker.
|
|
//
|
|
// How the pieces fit:
|
|
//
|
|
// - schema/*.graphql is the source of truth. `make generate` regenerates
|
|
// generated.go and model/models_gen.go, and adds stubs for any new field
|
|
// to the matching *.resolvers.go. Never edit those two generated files.
|
|
// - gqlgen.yml maps the GraphQL object types straight onto the GORM structs
|
|
// in internal/models, so model/ holds only input types. A model's
|
|
// `ID uint` binds to `id: ID!` directly through graphql.UintID.
|
|
// - The JobStatus enum is bound to a custom marshaller in
|
|
// services/job_status.go rather than a generated type; see that file.
|
|
// - Resolvers reach the database and the lead fetcher through
|
|
// Resolver.Store, the same handlers.Store the REST endpoints use.
|
|
//
|
|
// Authorisation: the endpoint has auth.Annotate in front of it, which asks the
|
|
// site backend whether the caller is the admin and records the answer without
|
|
// refusing anything. What refuses is the @admin directive on each field
|
|
// (directives.go). Every field in this schema is admin-only, and
|
|
// directives_test.go fails if one is added without the directive.
|
|
//
|
|
// Resolver commentary lives inside function bodies, because gqlgen relocates
|
|
// or strips anything above the signature when regenerating.
|
|
package graph
|