This full-stack project creates a simple customer loyalty point system, offering two interfaces: a customer page and a employee page. After the employee interface enters the amount, the customer can collect points by confirming their phone number on the customer page. The ratio of points to the amount can be adjusted through the config. The project's frontend is built with React.js, the backend with Node.js, and the database is MongoDB. This project was bootstrapped with express-es6-spa-example.
- Node.js
- Express
- Mongoose
- MongoDB
- Socket.IO
- React.js
- Bootstrap 5
- Real-time Interaction: Using
Socket.IO
, the client side, checkout side, and server can communicate in real time. As the checkout side enters an amount, it immediately appears on the client side without refreshing. The same happens when entering a phone number. - Customizable Ratio: The ratio between the amount spent and the points awarded can be determined by modifying
server/config.json
. - On-screen Numeric Buttons: Numeric buttons are displayed on the screen, convenient for devices like tablets. The layout for the amount is like a calculator, and for the phone number, it's like a phone keypad.
- API for Checkout Integration: The checkout can use an API to input amounts. This makes it easy to connect with other POS systems.
- Clone this project and install dependencies with
npm install
. - Rename
server/config.js.example
toconfig.js
and complete its content (MongoDBURI). - Start the program with
node index.js
. - Open the
Employee
andCustomer
links at their respective devices.
- Node.js (recommended version 12.20.0+)