How liamosycka/covamat works
1. This repository contains only the server side of CoVaMaT, a Node.js GraphQL API for managing “context variety” data. The README makes clear that the implementation here is the GraphQL server; the broader thesis documentation is external to the repo.
2. The application entrypoint is src/index.js. It is the bootstrap layer that starts the server, loads configuration, and connects the API layer to the database/configuration layer before serving requests.
3. The API is assembled in two main pieces: src/schema.js and src/resolvers.js. These are composition modules that likely merge the per-domain schema and resolver modules into one executable GraphQL service.
4. The GraphQL type system is split by business concept under src/schemas/: case, datasheet, datasheetInstance, domain, variation, variationPoint, and varietyType. This indicates the domain model is centered on cases and datasheets, with an explicit variability model built from domains, variations, variation points, and variety types.
5. The resolver layer lives under src/resolvers/ with one resolver file per major entity (case, datasheet, datasheetInstance). These resolvers are the main boundary between incoming GraphQL operations and the underlying data model: they interpret queries/mutations and return domain objects.
6. The persistence/model layer is under src/entities/ with entity definitions for case, datasheet, and datasheetInstance. These are the data-facing counterparts to the GraphQL types and are the primary abstraction used by resolvers to read/write stored records.
7. src/config/db.js isolates database setup and connection concerns from the rest of the codebase. Architecturally, this is the infrastructure boundary: the application boots, connects to the configured datastore, and then exposes GraphQL operations over that backing store.
8. The data flow is therefore: GraphQL request enters the server → the composed schema routes it to a resolver → the resolver uses an entity/model and the DB configuration to access persistence → the result is returned through the GraphQL response. There is no separate service layer visible; the resolvers are the main orchestration point.
9. The repository is organized as a single-service backend with clear separation between API schema, request handling, persistence models, and infrastructure configuration. There are no frontend components, background workers, or multiple services in this repo; the architecture is intentionally focused on one GraphQL API surface.
Main entry points: schema.js Schema compose · resolvers.js Resolvers compose · db.js DB config · index.js Server start
Components 17
Bootstrap
Application startup and wiring
- Server start · Application entrypoint that starts the GraphQL server and wires configuration to the API and database.
src/index.js
GraphQL API
Schema and resolver composition
- Schema compose · Assembles the executable GraphQL schema from domain schema modules.
src/schema.js - Resolvers compose · Combines per-entity resolver modules into the API resolver map.
src/resolvers.js - Case resolver · Resolver boundary for case queries and mutations.
src/resolvers/case.js - Datasheet resolver · Resolver boundary for datasheet operations.
src/resolvers/datasheet.js - Instance resolver · Resolver boundary for datasheet instance operations.
src/resolvers/datasheetInstance.js
Domain model
GraphQL types by business concept
- Case type · GraphQL schema for cases.
src/schemas/case.js - Datasheet type · GraphQL schema for datasheets.
src/schemas/datasheet.js - Instance type · GraphQL schema for datasheet instances.
src/schemas/datasheetInstance.js - Domain type · GraphQL schema for domain concepts.
src/schemas/domain.js - Variation type · GraphQL schema for variations.
src/schemas/variation.js - Variation point · GraphQL schema for variation points.
src/schemas/variationPoint.js - Variety type · GraphQL schema for variety types.
src/schemas/varietyType.js
Persistence
Entity abstractions for stored records
- Case entity · Persistence-facing abstraction for case records.
src/entities/case.js - Datasheet entity · Persistence-facing abstraction for datasheet records.
src/entities/datasheet.js - Instance entity · Persistence-facing abstraction for datasheet instance records.
src/entities/datasheetInstance.js
Infrastructure
Database configuration and connection
- DB config · Isolates datastore configuration and connection setup.
src/config/db.js
Connections 19
- Server start → DB config: connects · Bootstraps datastore access before serving requests.
- Server start → Schema compose: loads · Starts the server with the composed GraphQL schema.
- Server start → Resolvers compose: loads · Wires resolver implementations into the API.
- Schema compose → Case type: includes · Composes the case type into the executable schema.
- Schema compose → Datasheet type: includes · Composes the datasheet type into the executable schema.
- Schema compose → Instance type: includes · Composes the datasheet instance type into the executable schema.
- Schema compose → Domain type: includes · Includes domain-related type definitions.
- Schema compose → Variation type: includes · Includes variation-related type definitions.
- Schema compose → Variation point: includes · Includes variation point type definitions.
- Schema compose → Variety type: includes · Includes variety type definitions.
- Resolvers compose → Case resolver: merges · Composes the case resolver module.
- Resolvers compose → Datasheet resolver: merges · Composes the datasheet resolver module.
- Resolvers compose → Instance resolver: merges · Composes the datasheet instance resolver module.
- Case resolver → Case entity: uses · Reads and writes case records through the model layer.
- Datasheet resolver → Datasheet entity: uses · Reads and writes datasheet records through the model layer.
- Instance resolver → Instance entity: uses · Reads and writes datasheet instance records through the model layer.
- Case resolver → DB config: depends on · Relies on the configured datastore connection.
- Datasheet resolver → DB config: depends on · Relies on the configured datastore connection.
- Instance resolver → DB config: depends on · Relies on the configured datastore connection.