Skip to content

samrat21saha/VidyaArk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

VidyaArk πŸ“š

E-Commerce Bookstore Platform with e-book PDF free to Download

Node.js Express.js MongoDB JWT REST API

πŸ“Œ Overview

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.

🎯 Key Objectives

  • 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

🧠 How It Works (High-Level Flow)

  • 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

πŸ—οΈ System Workflow Diagram

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
Loading

πŸ‘€ User Capabilities

  • 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

πŸ› οΈ Admin Capabilities

  • 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

πŸ” Authentication & Authorization

  • JWT issued on successful login
  • Tokens sent as Bearer Authorization headers
  • Middleware validates:
    • Token integrity
    • User identity
    • User role (user / admin)
  • Unauthorized access is blocked at middleware level

🧩 Backend Design Overview

Express Router Layer

  • Modular route separation for users, books, cart, favourites, and orders

Middleware Layer

  • Authentication, authorization, validation, and error handling

Controller Layer

  • Business logic and request orchestration

Database Layer

  • MongoDB with Mongoose schemas for structured relations

This layered approach ensures maintainability, testability, and scalability.

🌐 Frontend–Backend Integration

  • 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

🧩 Tech Stack

Backend

  • Node.js
  • Express.js
  • MongoDB (Mongoose)
  • JWT Authentication
  • RESTful API Design

Frontend

  • React
  • Redux Toolkit
  • Axios
  • Tailwind CSS

πŸ“‚ Project Structure

VidyaArk/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ connection/
β”‚   β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ middlewares/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ uploads/
β”‚   └── app.js
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ store/
β”‚   β”‚   └── App.jsx
β”œβ”€β”€ package.json
└── README.md

βš™οΈ Installation & Local Setup

###Prerequisites

-Node.js (v18+) -MongoDB (local or Atlas)

Steps

git clone https://github.com/<your-username>/VidyaArk.git
cd VidyaArk
npm install
npm run dev

Environment Variables

PORT=5600
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret

🚧 Known Limitations

  • Payment gateway not yet integrated

  • No real-time notifications

  • Basic analytics only (can be extended)

πŸ›£οΈ Future Enhancements

  • Payment gateway integration

  • Advanced search and filtering

  • Recommendation engine

  • Email notifications

  • Admin analytics expansion

  • Cloud storage for media

πŸ“„ License

  • This project is licensed under the MIT License.

πŸ‘€ Author

Samrat Saha Backend & Full-Stack Developer

About

VidyaArk serves as a global archive of free, reliable e-books, curated from trusted sources worldwide and delivered through a single platform, so your time is spent learning, not hunting for PDFs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages