/FoodDeliveryBackend

A takeout system backend built with jdk22 and springboot3

Primary LanguageJavaMIT LicenseMIT

Food Delivery Backend System

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.

Configuration

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.

Technologies Used

  • 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.

Installation

Prerequisites

You need the following installed on your system:

  • Java JDK 22
  • Maven
  • MySQL
  • RabbitMQ
  • Redis

Setup

  1. Clone the repository:

    git clone https://github.com/yourusername/food-delivery-backend.git
  2. Navigate to the project directory:

    cd food-delivery-backend
  3. Install dependencies:

    mvn install

Configuration

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:


Running the Application

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.

  1. First, package the application into a runnable jar file with Maven:

    mvn clean package

    This command will create a .jar file in the target directory.

  2. 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

API documentation is available via Swagger UI and Knife4j at:

Security

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.

Contributing

We appreciate contributions. Please follow the standard GitHub fork-and-pull-request workflow.

License

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.