How sanjeevpandeyy/document-vault works
Document Vault is a GraphQL API for organizing collections and managing documents. A client request enters through the Bun server, is handled by the GraphQL schema and resolvers, then reaches collection or document services that validate inputs and use Prisma to access PostgreSQL. The README also describes search, filtering, cursor pagination, tags, archiving, nested collection documents, and structured errors. Resolver and schema-composition source was not sampled, so those links follow the documented structure and tree; uncertain internal wiring is omitted.
Main entry points: index.ts Resolver map · server.ts Bun server · collection.service.ts Collection service · document.service.ts Document service
Components 16
GraphQL API
- Bun server
src/server.ts - Schema setup
src/graphql/schema.ts - GraphQL schema
src/graphql/schema.graphql - Resolver map
src/graphql/resolvers/index.ts - Collection resolvers
src/graphql/resolvers/collection.resolver.ts - Document resolvers
src/graphql/resolvers/document.resolver.ts - Relationship resolvers
src/graphql/resolvers/relationship.resolver.ts - DateTime scalar
src/graphql/resolvers/datetime.scalar.ts
Vault Services
- Collection service
src/services/collection.service.ts - Document service
src/services/document.service.ts
Persistence
- Prisma client
src/lib/prisma.ts - PostgreSQL
prisma/schema.prisma
Shared Support
- Input validation
src/validators/common.ts - Structured errors
src/errors/app-error.ts - Runtime config
src/config/env.ts
Other components
- API client
Connections 20
- API client → Bun server: sends GraphQL
- Bun server → Schema setup: serves schema
- Schema setup → GraphQL schema: defines types
- Schema setup → Resolver map: uses resolvers
- Resolver map → Collection resolvers: registers
- Resolver map → Document resolvers: registers
- Resolver map → Relationship resolvers: registers
- Resolver map → DateTime scalar: registers
- Collection resolvers → Collection service: delegates
- Document resolvers → Document service: delegates
- Collection service → Input validation: validates input
- Document service → Input validation: validates input
- Collection service → Structured errors: raises errors
- Document service → Structured errors: raises errors
- Bun server → Structured errors: formats errors
- Bun server → Runtime config: reads port
- Prisma client → Runtime config: reads database URL
- Collection service → Prisma client: queries and writes
- Document service → Prisma client: queries and writes
- Prisma client → PostgreSQL: accesses data