How tiny-factories/tiny-garden-discord works
Project type and purpose
• This is a full-stack web application built with Next.js on the frontend and Node.js API routes on the backend, persisting data in MongoDB.
• Purpose: user-driven blogging/CMS platform (“Tiny Garden”) with user registration, authentication (email verification, password reset), post creation, narrative sections, and import capabilities.
File structure
• Top-level “pages” directory implements:
• UI routes: pages/*.jsx (e.g., index.jsx, edit.jsx, login.jsx)
• API routes: pages/api/* (auth.js, posts/index.js, user/password/reset.js, etc.)
• “components” directory houses reusable React components (footer, layout, post editors, narrative editors)
• “db” directory encapsulates MongoDB connection and data-access objects (db/index.js, post.js, user.js, token.js)
• “lib” holds helper utilities (API helpers, fetch wrapper, mail sender, default config)
• “middlewares” layer for session management, Passport authentication, database connection, general request handling
• “hooks” for client-side React hooks (user context, etc.)
• Config files: next.config.js, jsconfig.json, .eslintrc, .gitignore, schema JSON files
README for additional insights
• Confirms Next.js + MongoDB foundation
• Mentions planned extensions (rich-text editor, wildcard domains) but current core is Next.js SSR/SSG pages + REST-style API + MongoDB