How nila-4-96/fullstackpalautukset8 works
This is a full-stack library catalog: users browse books and authors, authenticate to add books or edit author birth years, and receive new-book updates. The React client queries a GraphQL API; backend resolvers enforce authentication and coordinate MongoDB models, while a subscription broadcasts book additions. README content was not provided, so capability coverage is based on the supplied source index and excerpts; frontend component behavior and backend schema details not shown are represented conservatively.
Main entry points: App.jsx Application shell · server.js HTTP and WS server · resolvers.js Query and mutations · apolloCache.js Book cache updates
Components 19
Library client
- Application shell
library-frontend/src/App.jsx - Author browser
library-frontend/src/components/Authors.jsx - Book browser
library-frontend/src/components/Books.jsx - Add book form
library-frontend/src/components/NewBook.jsx - Login form
library-frontend/src/components/LoginForm.jsx - Recommendations
library-frontend/src/components/Recommend.jsx - Notifications
library-frontend/src/components/Notify.jsx - GraphQL operations
library-frontend/src/queries.js - Book cache updates
library-frontend/src/utils/apolloCache.js - Apollo transport
library-frontend/src/main.jsx
GraphQL API
- HTTP and WS server
library-backend/server.js - Query and mutations
library-backend/resolvers.js - Token authentication
library-backend/server.js - GraphQL schema
library-backend/schema.js
Catalog storage
- Book records
library-backend/models/book.js - Author records
library-backend/models/author.js - User records
library-backend/models/user.js - MongoDB connection
library-backend/db.js
Other components
- Library user
Connections 23
- Library user → Application shell: uses
library-frontend/src/App.jsx - Application shell → Author browser: renders
library-frontend/src/App.jsx - Application shell → Book browser: renders
library-frontend/src/App.jsx - Application shell → Add book form: renders
library-frontend/src/App.jsx - Application shell → Login form: renders
library-frontend/src/App.jsx - Application shell → Recommendations: renders
library-frontend/src/App.jsx - Application shell → Notifications: renders
library-frontend/src/App.jsx - Application shell → GraphQL operations: uses
library-frontend/src/App.jsx - Application shell → Book cache updates: updates
library-frontend/src/App.jsx - Login form → GraphQL operations: uses login
library-frontend/src/components/LoginForm.jsx - Book cache updates → GraphQL operations: updates query
library-frontend/src/utils/apolloCache.js - Application shell → Apollo transport: runs within
library-frontend/src/main.jsx - Apollo transport → HTTP and WS server: sends GraphQL
library-frontend/src/main.jsx - HTTP and WS server → GraphQL schema: builds schema
library-backend/server.js - HTTP and WS server → Query and mutations: registers
library-backend/server.js - HTTP and WS server → Token authentication: loads token user
library-backend/server.js - Token authentication → User records: looks up user
library-backend/server.js - Query and mutations → Book records: reads and writes
library-backend/resolvers.js - Query and mutations → Author records: reads and writes
library-backend/resolvers.js - Query and mutations → User records: reads and writes
library-backend/resolvers.js - HTTP and WS server → MongoDB connection: starts after connection
library-backend/index.js - Query and mutations → Application shell: publishes book events
library-backend/resolvers.js - Application shell → Book cache updates: adds subscribed books
library-frontend/src/App.jsx