A full-stack e-commerce web application for books, featuring a modern Angular frontend and a robust Node.js/Express backend with MongoDB.
- Browse, search, and view book details
- Shopping cart and order management
- User authentication and registration
- Book reviews and ratings
- Admin dashboard for managing books, users, and orders
- Responsive, mobile-first UI
- Light/Dark mode support
- Angular 19+
- Tailwind CSS for utility-first styling
- Lucide Icons and FontAwesome
- RxJS for reactive programming
- Node.js with Express
- MongoDB with Mongoose
- JWT authentication
- Zod for validation
- Winston for logging
- Multer for file uploads
prototype_2/
client/ # Angular frontend
src/app/
components/ # UI components (navbar, sidebar, etc.)
pages/ # Page modules (home, book-info, cart, admin, etc.)
services/ # API and state management
types/ # TypeScript interfaces
server/ # Node.js backend
src/
controllers/ # Route logic
models/ # Mongoose schemas
routes/ # API endpoints
middlewares/ # Auth, error handling, etc.
utils/ # Helpers, email, validation, etc.
uploads/ # Uploaded book images
- Node.js (v18+ recommended)
- MongoDB
-
Clone the repository:
git clone https://github.com/e-commerce-itians/prototype_2.git cd prototype_2 -
Install dependencies:
cd client npm install cd ../server npm install
-
Configure environment variables:
- Copy
.env.exampleto.envin theserver/directory and set your MongoDB URI and other secrets.
- Copy
-
Run the backend:
cd server npm run dev -
Run the frontend:
cd client npm start -
Visit:
- Frontend: http://localhost:4200
- Backend API: https://bookstore.adel.dev/server/api/v1
npm start— Run Angular dev servernpm run build— Build for productionnpm test— Run unit tests
npm run dev— Start server with auto-reloadnpm start— Start server (production)
https://bookstore.adel.dev/server/api/v1
POST /users/register— Register a new userPOST /users/login— Login and receive JWTGET /users/profile— Get current user profile (auth required)
GET /books— List all books (with filters, search, pagination)GET /books/:id— Get book detailsPOST /books— Add a new book (admin only)PUT /books/:id— Update book (admin only)DELETE /books/:id— Delete book (admin only)
GET /authors— List all authorsGET /authors/:id— Get author details
GET /cart— Get current user's cartPOST /cart— Add book to cartPUT /cart/:bookId— Update quantityDELETE /cart/:bookId— Remove book from cart
GET /orders— List user ordersPOST /orders— Place a new order
GET /reviews/book/:bookId— Get reviews for a bookPOST /reviews/book/:bookId— Add a review (auth required)
- Fork the repo
- Create your feature branch (
git checkout -b feature/YourFeature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/YourFeature) - Open a pull request
This project is licensed under the ISC License.
- ITI E-Commerce Team