How sowdarjya/inkwell works
Project type and purpose
• InkWell is a full-stack blog platform: React + Redux on the client, Node.js/Express on the server, MongoDB for persistence, and Cloudinary for image storage. Users can sign up/in, create/update/delete posts, view by category, upvote, and manage profiles.
File structure
• Top-level “client” directory holds the React app:
• src/components and src/pages implement UI using functional components
• src/services/axios.instance.js and Redux Toolkit slices handle state and API calls
• “server” directory contains the Express app using an MVC-style layout:
• controllers handle business logic (post.controller.js, user.controller.js)
• routes define HTTP endpoints (post.routes.js, user.routes.js)
• models (Mongoose schemas) map to MongoDB collections
• middlewares (auth.middleware.js) enforce JWT authentication
• utils include Cloudinary integration and helpers
• Shared configuration files: eslint, Vite, Tailwind, package.json’s, .gitignore, DB connection script.
Key insights from README
• Uses React Router for navigation, Tailwind for styling
• Axios for HTTP requests, Redux Toolkit for state
• Express with JWT for API authentication, Cloudinary for media uploads
Main components and interactions
a. Frontend (React)
• UI Pages (Home, PostDetails, Profile, etc.)
• State Store (Redux Toolkit)
• HTTP Layer (Axios instance)
b. Backend (Express API)
• Route layer exposes /api/posts and /api/users endpoints
• Controller layer implements CRUD, upvotes
• Model layer (Mongoose) interacts with MongoDB
• Auth middleware checks JWTs
c. Database (MongoDB Atlas or local)
d. Media service (Cloudinary)
e. External clients (browser, mobile)
Architectural patterns and principles
• MVC pattern on server: separation of routing, controller logic, and data models
• Client-side component architecture: pages vs. reusable components
• Centralized state management with Redux
• RESTful API design
• Security and stateless auth via JWT middleware
• Third-party integration for media storage
Essential elements
• Clear labels on components (Frontend, API Gateway, Controllers, Models, DB, Cloudinary)
• Notes on authentication flow: login → receive JWT → attach to header
• Redux store interaction with UI components