This project is a Flask-based framework for small and medium-sized book sales enterprises or online bookstore book management system , the user scale covers from a few hundred to thousands of customer groups , it has a user management , book management , order management , review management and other functions . The system uses SQLAlchemy to interact with PostgreSQL database, builds RESTful API with the help of Flask-RESTful, and uses Flask-JWT-Extended to realize authentication.
The system adopts a layered architecture design, which is mainly divided into the following levels:
- The presentation layer (API layer) is responsible for receiving requests from the client and returning the processing results to the client. The Flask-RESTful framework is used to build the RESTful API, providing interfaces for user authentication, book management, order management, etc.
- The business logic layer (service layer) handles user authentication, book management, order management, and so on. The business logic layer (service layer) handles specific business logic, such as the creation, update and deletion of books, and the creation, update and deletion of orders. The service layer calls the interface of the data access layer to realize data persistence.
- The data access layer (model layer) is responsible for interacting with the database, including data addition, deletion, modification and retrieval operations. SQLAlchemy is used as an ORM tool to map database tables to Python classes to facilitate database operations.
- Database layer Stores all the data of the system and uses PostgreSQL as the database management system. The database contains several tables such as user information, book information, order information, comment information and so on.
Go to Github Marketplace and click Use this model to fetch the token, then add the token to BookStoreSystem/.env
SECRET_KEY=get_your_SECRET_KEY
JWT_SECRET_KEY=get_your_JWT_SECRET_KEY
DATABASE_URL=get_your_postgresql_DATABASE_URL
UPLOAD_FOLDER=uploads
GITHUB_TOKEN=get_your_Deepseek-V3_token
Just replace get_your_Deepseek-V3_token with the fetched token
Go to the Download page of postgsql official website, choose the appropriate version to download and install
PgAdmin 4 is the open source management tool of Postgres, Installation link
Based on python3, download the corresponding installation package can be, will not be repeated here
git clone https://github.com/reallinshengxiang/Integrated-Management-and-Intelligent-Service-Platform-for-Book-Sales.git
Data set fetch (This step can be omitted, douban_books.csv and bookreviews_processed.csv are already in the Import_Data folder)
Go to the Crawling file path and run
python3 run1.py
python3 run2.py
At the end of the run there is the douban_books.csv
bookreviews_processed.csv derived from Kaggle platform Douban dataset(rating+review+side information)
sudo service postgresql start
sudo -i -u postgres
Go to Import_Data file path and run
python3 import.py
Go to book_store_backend file path, run
python3 run.py
Go to book_store_frontend file path, run
npm run dev
Just open the link (default) to the browser
If the following situations were encountered
linshengxiang@sxLin:~/Integrated Management and Intelligent Service Platform for Book Sales/BookStoreSystem/book_store_frontend$ npm run dev
> [email protected] dev
> vite
sh: 1: vite: not found
run
npm cache clean --force
rm -rf node_modules package-lock.json
npm install --force --unsafe-perm
Run again and it will run successfully!
npm run dev