A full-stack web application for managing a modern online bookstore with user authentication, admin panel, and shopping cart functionality.
- Browse Books: View a comprehensive catalog with detailed information
- Quick View: Modal window displaying book details, reviews, and author information
- Shopping Cart: Add books to cart with quantity management
- User Authentication: Secure login and registration system with password encryption (bcrypt)
- User Profile: Manage personal information and shipping addresses
- Genre Filtering: Browse books by categories (Fiction, Mystery, Horror, Fantasy, etc.)
- Book Reviews: Read customer reviews and ratings
- Admin Dashboard: Accessible only to users with admin privileges
- Book Management: Add, edit, and delete books with cover image upload
- Author Management: View and manage author information
- Publisher Management: Track publisher details
- Genre Management: Organize books by genres with visual categories
- User Management: View registered users and their roles
- Vue.js 3: Progressive JavaScript framework
- Vue Router 4: Official router for Vue.js
- FontAwesome: Icon library
- Custom CSS: Modern, responsive design with Tan Mon Cheri font
- Node.js: JavaScript runtime
- Express.js 5: Web application framework
- MySQL: Relational database
- Passport.js: Authentication middleware
- bcrypt: Password hashing
- express-session: Session management
- CORS: Cross-Origin Resource Sharing support
BooksPoject/
βββ webapp_clientside/ # Vue.js frontend
β βββ public/
β β βββ index.html
β βββ src/
β β βββ assets/
β β β βββ font/ # Custom fonts
β β β βββ img/ # Images (books, categories, icons)
β β βββ components/
β β β βββ libraryhome.vue # Main homepage
β β β βββ Login.vue # Login/Register page
β β β βββ profile.vue # User profile
β β β βββ admin.vue # Admin dashboard
β β β βββ contact.vue # Contact page
β β βββ router/
β β β βββ index.js # Route definitions
β β βββ App.vue
β β βββ main.js
β βββ package.json
β
βββ webapp_serverside/ # Express.js backend
β βββ controllers/
β β βββ library.route.js # API routes
β βββ routes/
β β βββ auth.js # Authentication routes
β βββ utils/
β β βββ db.include.js # Database configuration
β βββ library_db.sql # Database schema
β βββ server.js # Main server file
β βββ package.json
β
βββ README.md
- Node.js (v14 or higher)
- MySQL Server (v8.0 or higher)
- npm or yarn package manager
-
Create the database:
mysql -u root -p
-
Import the SQL schema:
CREATE DATABASE library_db; USE library_db; SOURCE webapp_serverside/library_db.sql;
-
Configure environment variables: Create a
.envfile inwebapp_serverside/:# Server Configuration WEB_PORT=3000 CLIENT_URL=http://localhost:8080 # Database Configuration DB_HOST=localhost DB_USER=root DB_PASSWORD=your_mysql_password DB_NAME=library_db # Session Secret SESSION_SECRET=your_random_secret_key_here
-
Navigate to server directory:
cd webapp_serverside -
Install dependencies:
npm install
-
Start the server:
npm start
Server will run on
http://localhost:3000
-
Navigate to client directory:
cd webapp_clientside -
Install dependencies:
npm install
-
Start the development server:
npm run serve
Application will run on
http://localhost:8080
The application uses the following main tables:
- users: User accounts with bcrypt-hashed passwords
- books: Book catalog with ISBN, pricing, and metadata
- authors: Author information (first name, last name, biography)
- publishers: Publisher details
- genres: Book categories
- book_genres: Many-to-many relationship between books and genres
- reviews: Customer reviews and ratings
- addresses: User shipping and billing addresses
- Registration: Users can create accounts with username, email, and password
- Password Security: Passwords are hashed using bcrypt before storage
- Session Management: Express-session maintains user login state
- Role-Based Access:
USER: Standard customer accessADMIN: Full administrative privileges
Email: admin@gmail.com
Password: admin
- Custom Typography: Tan Mon Cheri font for elegant headers
- Responsive Layout: Works on desktop and mobile devices
- Animated Modals: Smooth transitions for book details and cart
- Category Cards: Visual genre browsing with cover images
- Star Rating System: Dynamic 5-star display for book reviews
- Sidebar Cart: Slide-in shopping basket
GET /api/books- Get all booksPOST /api/books- Add new book (admin)PUT /api/books/:id- Update book (admin)DELETE /api/books/:id- Delete book (admin)
POST /api/auth/register- Register new userPOST /api/auth/login- Login userPOST /api/auth/logout- Logout userGET /api/auth/current- Get current user
GET /api/authors- Get all authorsGET /api/publishers- Get all publishersGET /api/genres- Get all genresGET /api/book-genres- Get book-genre associations
GET /api/reviews- Get all reviews
Access the application:
- Open browser to
http://localhost:8080 - Browse books as guest
- Register a new account or login with admin credentials
- Test shopping cart functionality
- Admin: Access admin panel to manage inventory
- Payment gateway integration
- Order history tracking
- Email notifications
- Advanced search and filtering
- Wishlist functionality
- Book recommendations
- Inventory management
- Sales analytics dashboard
- Browse and search books
- View detailed book information
- Add items to cart
- Manage profile and addresses
- Read and write reviews
- All customer features
- Add/edit/delete books
- Upload book cover images
- Manage authors and publishers
- Assign genres to books
- View all users
This is a school project. For educational purposes only.
This project is created for academic purposes.
For questions or issues, please use the Contact page in the application.
Built with β€οΈ using Vue.js and Node.js