How zak1sn0good/mini-social-media-backend works
Main System Components
a) API Layer:
• A GraphQL API Gateway component at the top level
• Apollo Server integration (evident from the server.js file)
b) Business Logic Layer:
• User Resolvers
• Post Resolvers
• Comment Resolvers
• Like Resolvers
• To the GraphQL Schema (typeDefs.js)
c) Data Model Layer:
• MongoDB as the database layer
• Two main models:
• User Model
• Post Model
d) Utility Services:
• Authentication Service (checkAuth.js)
• Validation Service (validators.js)
Component Relationships and Flow
• Client requests → GraphQL API Gateway
• API Gateway → GraphQL Schema (typeDefs)
• Schema → Respective Resolvers
• Resolvers → Models
• Models → MongoDB
• Cross-cutting concerns (Auth & Validation) should be shown as vertical layers
[Client Applications] (top)
• ↓
[GraphQL API Gateway]
• ↓
[Schema Definitions] ←→ [Authentication]
• ↓ ↕
[Resolver Layer] ←→ [Validation]
• ↓
[Data Models]
• ↓
[MongoDB Database] (bottom)
Additional Elements
• Security boundaries
• Component types
Remember to emphasize the modular nature of the GraphQL resolvers and how they map to the type definitions, as this is a key architectural feature of the system.