How spviswanath/collaborative-story-builder works
StoryBuilder supports discovery and reading of both authored stories and Project Gutenberg books, plus authenticated story creation, collaboration, chapter editing, branching and PDF export. The documented external-book flow proxies raw text through the backend, then parses it in the browser into chapters. The graph follows the sampled route/controller and frontend call relationships; unsampled UI and integration internals are represented only where README or source-index evidence supports them.
Main entry points: storyController.js Story service · storyRoutes.js Story routes · Reader.jsx Reader · app.js HTTP application
Components 29
Web experience
- Reader
frontend/src/pages/Reader.jsx - Story discovery
frontend/src/pages/Main.jsx - Story cards
frontend/src/components/story/StoryCard.jsx - Story editor
frontend/src/pages/Editor.jsx - Chapter tools
frontend/src/components/editor/ChapterSidebar.jsx - Page routing
frontend/src/routes/AppRoutes.jsx - Book parser
frontend/src/utils/gutenbergParser.js
Story workflows
- Story API
frontend/src/api/storyApi.js - Story routes
backend/src/routes/storyRoutes.js - Story service
backend/src/controllers/storyController.js - Story records
backend/src/models/Story.js - Chapter routes
backend/src/routes/chapterRoutes.js - Chapter service
backend/src/controllers/chapterController.js - Chapter records
backend/src/models/Chapter.js - PDF export
backend/src/utils/pdfGenerator.js
Identity and accounts
- Auth session
frontend/src/context/AuthContext.jsx - Auth API
frontend/src/api/authApi.js - Auth routes
backend/src/routes/authRoutes.js - Auth service
backend/src/controllers/authController.js - JWT guard
backend/src/middleware/authMiddleware.js - User records
backend/src/models/User.js
Backend platform
- Image hosting
backend/src/config/cloudinary.js - HTTP application
backend/src/app.js - Server startup
backend/src/server.js - Database connection
backend/src/config/db.js - Live collaboration
backend/src/socket.js
Other components
- Project Gutenberg
- Reader or author
- MongoDB
Connections 40
- Reader or author → Story discovery: browses
README.md - Story discovery → Story API: loads listings
frontend/src/pages/Main.jsx - Story discovery → Story cards: renders
frontend/src/pages/Main.jsx - Reader or author → Reader: opens book
README.md - Reader → Story API: requests story
- Reader → Book parser: parses text
README.md - Book parser → Reader: provides chapters
README.md - Reader or author → Story editor: creates stories
README.md - Story editor → Chapter tools: uses editor tools
- Chapter tools → Live collaboration: coordinates edits
frontend/src/components/editor/ChapterSidebar.jsx - Page routing → Reader: routes to
frontend/src/routes/AppRoutes.jsx - Page routing → Story editor: routes to
frontend/src/routes/AppRoutes.jsx - Auth session → Auth API: authenticates with
frontend/src/context/AuthContext.jsx - Auth API → Auth routes: calls auth endpoints
- Story API → Story routes: calls story endpoints
README.md - Story routes → Story service: dispatches
backend/src/routes/storyRoutes.js - Story routes → JWT guard: guards requests
backend/src/routes/storyRoutes.js - Story service → Story records: reads and writes
backend/src/controllers/storyController.js - Story service → Chapter records: reads chapters
backend/src/controllers/storyController.js - Story service → User records: reads users
backend/src/controllers/storyController.js - Story service → PDF export: generates export
backend/src/controllers/storyController.js - Story service → Image hosting: uses image service
backend/src/controllers/storyController.js - Story routes → Project Gutenberg: proxies book text
README.md - Chapter routes → Chapter service: dispatches
backend/src/routes/chapterRoutes.js - Chapter routes → JWT guard: guards requests
backend/src/routes/chapterRoutes.js - Chapter service → Chapter records: reads and writes
backend/src/controllers/chapterController.js - Chapter service → Story records: checks story access
backend/src/controllers/chapterController.js - Auth routes → Auth service: dispatches
backend/src/routes/authRoutes.js - Auth routes → JWT guard: guards session
backend/src/routes/authRoutes.js - Auth service → User records: reads and writes
backend/src/controllers/authController.js - JWT guard → User records: identifies request
- Server startup → HTTP application: starts
backend/src/server.js - Server startup → Database connection: connects database
backend/src/server.js - Server startup → Live collaboration: initializes
backend/src/server.js - HTTP application → Auth routes: mounts
backend/src/app.js - HTTP application → Story routes: mounts
backend/src/app.js - HTTP application → Chapter routes: mounts
backend/src/app.js - Story records → MongoDB: persists in
- Chapter records → MongoDB: persists in
- User records → MongoDB: persists in