VidyaArk is a full-stack bookstore e-commerce application designed to manage book discovery, purchasing workflows, and administrative operations through a secure, scalable REST API architecture.
The system supports user authentication, cart and order management, favourites (wishlist), and an admin panel for complete book lifecycle control.
VidyaArk is built with a backend-first mindset, ensuring data integrity, role-based access control, and clean frontendβbackend separation.
- Build a secure bookstore e-commerce backend
- Implement JWT-based authentication and authorization
- Enable cart, favourites, and order workflows
- Provide admin-only book and order management
- Design REST APIs suitable for real-world scaling
- Users authenticate using JWT-based login
- Authenticated users browse and interact with books
- Cart, favourites, and orders are securely user-scoped
- Admin users manage books and view sales analytics
- Frontend communicates exclusively via protected REST APIs
- MongoDB persists all user, book, and order data
The diagram below illustrates the complete VidyaArk workflow, covering authentication, protected routes, business logic, and data persistence.
flowchart LR
A[Frontend / React App] -->|Login / Signup| B[Auth Controller]
B -->|JWT Token| A
A -->|Bearer Token| C[Auth Middleware]
C -->|Authorized| D[Protected Routes]
D --> E[Book Controller]
D --> F[Cart Controller]
D --> G[Favourites Controller]
D --> H[Order Controller]
E --> I[(MongoDB)]
F --> I
G --> I
H --> I
D --> J[Admin Controller]
J --> I
- Register and authenticate securely
- Browse and view book details
- Add/remove books from cart
- Add/remove books from favourites
- Place orders and view order history
- Update profile details and avatar
- Add, update, and delete books
- View all orders across users
- Access admin dashboard metrics:
- Total orders
- Total sales
- Top-selling books
- Role-based route protection
- JWT issued on successful login
- Tokens sent as
BearerAuthorization headers - Middleware validates:
- Token integrity
- User identity
- User role (user / admin)
- Unauthorized access is blocked at middleware level
- Modular route separation for users, books, cart, favourites, and orders
- Authentication, authorization, validation, and error handling
- Business logic and request orchestration
- MongoDB with Mongoose schemas for structured relations
This layered approach ensures maintainability, testability, and scalability.
- React frontend consumes REST APIs via Axios
- Centralized API configuration
- JWT-aware requests for protected endpoints
- UI state driven by API responses
- Frontend remains loosely coupled to backend contracts
- Node.js
- Express.js
- MongoDB (Mongoose)
- JWT Authentication
- RESTful API Design
- React
- Redux Toolkit
- Axios
- Tailwind CSS
VidyaArk/
βββ backend/
β βββ connection/
β βββ controllers/
β βββ middlewares/
β βββ models/
β βββ routes/
β βββ uploads/
β βββ app.js
βββ frontend/
β βββ src/
β β βββ api/
β β βββ components/
β β βββ pages/
β β βββ store/
β β βββ App.jsx
βββ package.json
βββ README.md
###Prerequisites
-Node.js (v18+) -MongoDB (local or Atlas)
git clone https://github.com/<your-username>/VidyaArk.git
cd VidyaArk
npm install
npm run dev
PORT=5600
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
-
Payment gateway not yet integrated
-
No real-time notifications
-
Basic analytics only (can be extended)
-
Payment gateway integration
-
Advanced search and filtering
-
Recommendation engine
-
Email notifications
-
Admin analytics expansion
-
Cloud storage for media
- This project is licensed under the MIT License.
Samrat Saha Backend & Full-Stack Developer