Skip to content

Repository files navigation

Book Worm

An e-commerce web application for buying and selling books online.

Prerequisites

  • Node.js 16.x or higher
  • npm 8.x or higher
  • Microsoft SQL Server 2016 or higher

Installation

  1. Clone the repository
git clone https://github.com/lilkhoa/book-worm.git
cd book-worm
  1. Install dependencies
npm install
  1. Set up environment variables

Create a .env file in the root directory (use .env.example as a template):

APP_NAME=Book Worm
APP_URL=http://localhost:3000
PORT=3000
NODE_ENV=development

SESSION_SECRET=your-super-secret-session-key-change-in-production

DB_SERVER=localhost
DB_DATABASE=BookWormDB
DB_USER=your_username
DB_PASSWORD=your_password
DB_ENCRYPT=true
DB_TRUST_CERT=true
  1. Set up the database

Run these files in the correct order using SQL Server Management Studio or any SQL client:

  • database_setup.sql
  • trigger.sql
  • insert-data.sql
  • functions-and-procedures.sql
  1. Test database connection (optional)
node test_db_connection.js

Running the Application

  1. Start the server
npm start
  1. In a separate terminal, watch for SCSS changes
npm run watch
  1. Access the application

Open your browser and navigate to: http://localhost:3000

Available Scripts

  • npm start - Start the Node.js server with nodemon
  • npm run watch - Watch and compile SCSS files
  • npm run build:scss - Build SCSS files once

Project Structure

book-worm/
├── src/
│   ├── app/
│   │   ├── controllers/     # Request handlers
│   │   ├── models/          # Database models
│   │   └── middlewares/     # Custom middleware
│   ├── config/              # Configuration files
│   ├── public/              # Static files (CSS, images)
│   ├── resources/
│   │   ├── scss/            # SCSS source files
│   │   └── views/           # Handlebars templates
│   ├── routes/              # Route definitions
│   └── utils/               # Utility functions
├── database_setup.sql       # Database schema and sample data
└── package.json

Features

  • Browse and search books
  • User authentication (login/register)
  • Shopping cart
  • Category filtering
  • Responsive design
  • Vietnamese language support

Technologies Used

  • Backend: Node.js, Express.js
  • Database: Microsoft SQL Server
  • Template Engine: Handlebars
  • Styling: Bootstrap 5, SCSS
  • Session Management: express-session
  • Authentication: bcryptjs

License

ISC

About

An E-commerce Web application for buying and selling books.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages