This is a web application for electric scooter rental in urban areas, providing a user-friendly interface and comprehensive rental management functions.
- User Management System: User registration, login, password recovery, with verification code security
- Scooter Booking System: Multiple rental options (hourly, 4-hour, daily, weekly)
- Multiple Payment Methods: Supports Alipay and bank card payments
- Diverse Discount Rules: Special discounts for students, seniors, and frequent customers
- Complete Order Management: Creation, cancellation, extension, and return of scooters
- Deposit Management System: Refund deposit based on scooter battery level upon return
- Revenue Statistics & Analysis: Weekly and daily revenue reports with visual chart analysis
- User Feedback System: Collect and process user feedback
.
├── Frontend (Vue.js) # User interface, handling user interactions
└── Backend (Spring Boot) # Business logic, data processing and storage
- Frontend and backend communicate via RESTful APIs
- JWT used for user authentication
- Data stored in MySQL database
- Vue.js 3
- Vite
- Vue Router 4
- Vuex
- Axios
- Element Plus UI
- ECharts (Data visualization)
- Spring Boot 3.2.2
- Spring Data JPA
- Spring Security
- MySQL 8.0
- JWT Authentication
- Alipay SDK Integration
- Spring Mail (Email notifications)
The application is deployed and accessible at: http://118.24.22.77
- Username: admin
- Password: Password123
- Username: user
- Password: Password123
For deployment to a production environment, CORS settings need to be updated to allow requests from the production domain:
- Update
SecurityConfig.javato include production domain in allowed origins - Update
WebConfig.javato include production domain in allowed origins - Update all controller
@CrossOriginannotations to include production domain
The current configuration already includes support for the demo server at http://118.24.22.77.
- Node.js 16+
- JDK 17
- Maven 3.9+
- MySQL 8.0+
- Clone the repository
git clone [repository-url]
cd [project-folder]- Configure database
CREATE DATABASE IF NOT EXISTS vuesb;- Modify configuration file (backend/src/main/resources/application.properties)
# Database connection
# 数据库连接
spring.datasource.url=jdbc:mysql://localhost:3306/vuesb?createDatabaseIfNotExist=true&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
spring.datasource.username=root
spring.datasource.password=your-database-password
# Email configuration (if used)
# 邮箱配置(如果使用)
spring.mail.host=smtp.your-email-provider.com
spring.mail.username=your-email@example.com
spring.mail.password=your-email-password
# Alipay configuration (if used)
# 支付宝配置(如果使用)
alipay.appId=your-alipay-AppID
alipay.appPrivateKey=your-alipay-private-key
alipay.alipayPublicKey=alipay-public-key- Build and run the backend
cd backend
mvn clean install
mvn spring-boot:runThe backend service will run on http://localhost:8080
- Install dependencies
cd frontend
npm install- Run the development server
npm run devThe frontend service will run on http://localhost:5173
The system uses the following main tables:
b_user: User informationb_scooter: Scooter informationb_order: Order informationb_store: Store informationb_discount_rule: Discount rulesb_feedback: User feedbackb_weekly_revenue: Weekly revenue statisticsb_daily_revenue: Daily revenue statistics
Initial data will be automatically loaded through schema.sql and data.sql.
- Account Management: Register, login, edit personal information, recover password
- Browse Scooters: View available scooters and pricing information
- Book Scooters: Select time periods and rental types for booking
- Pay Orders: Complete payment via Alipay or bank card
- Order Management: View, cancel, extend personal orders
- Return Scooters: Return after use and receive deposit refund
- Submit Feedback: Submit questions or suggestions to the system
- Scooter Management: Add, edit, delete scooter information
- User Management: View and manage system users
- Order Management: View all orders and handle special cases
- Revenue Analysis: View revenue statistics reports and analysis charts
- Process Feedback: Reply to and process user-submitted feedback
frontend/src/components/: Frontend UI componentsfrontend/src/views/: Page viewsfrontend/src/router/: Route configurationfrontend/src/store/: Vuex state managementbackend/src/main/java/group6/demo/controller/: API controllersbackend/src/main/java/group6/demo/service/: Business logic servicesbackend/src/main/java/group6/demo/entity/: Data entitiesbackend/src/main/java/group6/demo/repository/: Data access layer
API documentation can be accessed via Swagger UI after starting the backend service: http://localhost:8080/swagger-ui.html
Q: How to enable test mode?
A: Set app.test-mode=true in the application.properties file
Q: How to reset the database?
A: Delete and recreate the database, or modify spring.jpa.hibernate.ddl-auto=create to recreate the table structure
Q: How to configure the Alipay sandbox environment? A: Create a sandbox application on the Alipay Open Platform, obtain the corresponding AppID and keys, and configure them in the application.properties file
Pull Requests and Issues are welcome to improve this project. Before submitting code, please ensure:
- Code has been tested
- Follow the project's code style
- Update relevant documentation
[Add project license information]