1. Function introduction
Users can complete registration, login and browse the goods after login.
After logging in, the user can purchase and add related products to the shopping cart.
Users can add, reduce and delete the goods in the shopping cart.
Users can settle the shopping cart goods.
2. Technical Selection
This project involves the use ofNodeJS、Express framework、MongoDB database、Mongoose object model library, detailed as follows:
V8Engine, a backend
API, such as file operation, network programming, etc.
ExpressA concise and flexible base
WebApplication development framework, support
Ejs、jadeAnd provides a series of powerful functions, such as template parsing, static file service, middleware, route control, etc.
MongoDBIs a high-performance, open source, modeless document database based on distributed file storage
BSONThe format of the document is stored on disk.
Mongoose: one aimed at
MongoDBThe operation of the object model library, encapsulation
MongoDBSome common methods such as adding, deleting, modifying and checking documents.
3. Structure division
The project is mainly divided into the following modules:Registration module,Login module,Commodity module、Shopping cart module、Settlement module.
User registration module: After the user name, password and confirmation password are filled in, successful registration is realized, and then login is performed.
User login module: Fill in the registered user name, fill in the correct password and enter the commodity display page.
Commodity module: The user selects relevant products to add to the shopping cart.
Shopping cart module: add, reduce and delete related commodities.
Settlement module: settle the selected goods in the shopping cart.
The module structure is shown in the following figure:
4. Process design
This flow chart shows that the user can log in and register. If the user has already registered, he can log in directly. If he has not registered, he must register successfully before logging in. After logging in successfully, he can enter the commodity page to browse commodities, or select relevant commodities and add them to the shopping cart. In the shopping cart page, he can perform relevant operations on shopping cart commodities, and finally settle accounts by selecting relevant commodities.
The flow chart is as follows: