This is the backend system for a food delivery application, built using Spring Boot. The application leverages a range of technologies including MySQL, Redis, RabbitMQ, and integrates with Alibaba Cloud's OSS and WeChat Pay. This system is designed to be scalable, secure, and efficient, utilizing Spring Boot's extensive support for enterprise-grade applications.
The application is configured to run on port 8080 and is set up with production profiles. It uses MyBatis for ORM, JWT for authentication, and includes advanced logging configurations.
- Spring Boot - Framework for building Java-based applications.
- MySQL - Database for storing user and order data.
- Redis - Used as a cache and session store.
- RabbitMQ - Messaging broker for handling asynchronous processing.
- JWT - For securing REST APIs by providing tokens to verify user identity.
- MyBatis - Persistence framework integrating with Spring Boot for data handling.
- Knife4j - Enhanced Swagger-compatible interface for visualizing RESTful APIs.
- Alibaba Cloud OSS - For storage solutions.
- WeChat Pay - Payment integration for handling transactions and refunds.
You need the following installed on your system:
- Java JDK 23
- Maven
- MySQL
- RabbitMQ
- Redis
-
Clone the repository:
git clone https://github.com/yourusername/food-delivery-backend.git
-
Navigate to the project directory:
cd food-delivery-backend
-
Install dependencies:
mvn install
Update the application.yml
or application.properties
with your specific settings for MySQL, Redis, RabbitMQ, OSS, and WeChat Pay. This typically includes hosts, ports, usernames, passwords, and other essential configuration details.
Certainly! Here's the section of the README updated to reflect how to run the application using the java -jar
command instead of Maven directly:
Instead of using Maven to run the application, you can build a jar file and run it directly using the Java command. This is often more suitable for production environments or when deploying the application.
-
First, package the application into a runnable jar file with Maven:
mvn clean package
This command will create a
.jar
file in thetarget
directory. -
Run the application using:
java -jar target/your-application-name.jar
Replace
your-application-name.jar
with the actual name of your jar file generated by Maven.
The application will start running on http://localhost:8080
.
API documentation is available via Swagger UI and Knife4j at:
- Swagger UI: http://localhost:8080/swagger-ui.html
- Knife4j: http://localhost:8080/doc.html
This application uses JWT for authentication. Ensure you configure your JWT settings properly, including secret keys and token names for both admin and user levels.
We appreciate contributions. Please follow the standard GitHub fork-and-pull-request workflow.
This project is licensed under the MIT License - see the LICENSE.md file for details.
This README includes detailed instructions for setting up and running your application, along with configuration management practices, to ensure smooth deployment and operation. Adjustments may be necessary to fit your exact setup or additional features.