How roodyridar2/my-react-note-app works
Main Components
• Frontend (Client)
• “client” directory which contains the React application.
• UI components, pages (e.g., Home, Login, Register, Write, Public, Single), and the admin-specific pages (Dashboard, AdminSingle, AllUsers, UserPosts).
• Use of React for UI, Vite as the build tool, and supporting libraries like Ant Design, ReactQuill, and Axios (used via client/src/service/api.js).
• Backend (API)
• “api” directory that runs the Express.js server.
• Controllers (admin.js, auth.js, post.js, user.js) which orchestrate business logic.
• Database connection component (api/db.js) and Knex.js integration (with its configuration file knesfile.js and migration files for users, posts, and likes tables) which models the persistence layer.
• Middleware and libraries like cookie-parser, multer for file uploads, bcryptjs for password hashing, and JWT for authentication.
• Database
• Although not part of the repository, include a MySQL instance connected via Knex.js. Show that migrations set up tables for users, posts, and likes.
• External Services/Tools
• A note for the Postman collection provided to test API endpoints.
Relationships and Interactions
• The Frontend (client) issues HTTP requests (via Axios) to the Backend (api).
• The Backend processes these requests through its API endpoint routes, invoking controllers.
• The Controllers then interact with the Database to perform CRUD operations on notes, users, likes, etc.
Architectural Patterns & Design Principles
• Separation of concerns by visually separating the frontend and backend components.
• Use of MVC-like separation in the backend (routes, controllers, and database/migrations).
• That the frontend uses a component-based architecture, common with React projects.
• Additional integration points such as file uploads (Multer) and authentication middleware handling.
Technologies, Frameworks, and Libraries
• Associate each component with its tech stack:
• Frontend: React, Vite, Ant Design, ReactQuill, Axios, Moment.js.
• Backend: Node.js, Express.js, Knex.js, JWT, bcryptjs, cookie-parser, multer.
• Database: MySQL.