How harsh2509/coursesellingwebsite works
Project type and purpose
• This is a full-stack course-selling application with two client frontends (an admin dashboard and a user-facing site) and a Node/Express backend.
• The README describes routes for the user site (list courses, purchased courses, view/purchase single course, signup/login, landing page) and mentions an existing admin dashboard front end.
File structure
• Top level:
• /.github – CI pipeline for tests/linting
• /client – Vite-powered React user site
• /server – Express backend, with routes, middleware, and a Database folder
• client/src: React components (pages & UI elements), state management under src/store (Jotai atoms & selectors), routing via react-router.
• server: Express entry point (index.js), two Routers (admin.js, users.js), middleware for adminAuth & userAuth, Database/index.js for data persistence.
README for additional insights
• Emphasizes boilerplate creation with Vite and the RESTful routes.
a. Main components:
• User Frontend (client) – built with Vite/React, MUI, Jotai state, React Router, Axios calls
• Admin Frontend – (02-medium-course-selling-app-admin-dashboard, similar tech stack)
• Backend API (server) – Node.js, Express, REST endpoints under /users and /admin, authentication middleware
• Database – the persistence layer imported under server/Database/index.js (could be MongoDB, PostgreSQL, etc.)
• External Services (optional) – e.g., payment gateway for purchases
b. Relationships & interactions:
• Browsers ▶ REST calls ▶ API endpoints
• API ▶ reads/writes ▶ Database
• Middleware intercepts ▶ auth checks ▶ route handlers
• Frontends share the same API but use different routes (admin vs. user)
c. Architectural patterns & design principles:
• Separation of concerns: frontends vs. backend vs. DB
• RESTful API layer with stateless endpoints
• Authentication & authorization via middleware (adminAuth, userAuth)
• Component-driven UI on the frontends, atomic state management (Jotai)
d. Key technologies & libraries:
• Frontends – Vite, React, React Router, Axios, MUI, Jotai
• Backend – Node.js, Express, dotenv for config, custom middleware, Database connector