this is a simple repo that teachs one how to make a simple crud operation using spring boot. Is actually for my article name Creating a REST API for MySQL CRUD Operations using Spring BootFramework.
- Create (POST): Used for adding new records.
-
Example endpoint: http://localhost:8080/users
-
Body: { "username": "john", "password":"12345", "email": "1@gmail.com"
}
- Read (GET): Fetches information.
- Example endpoint: http://localhost:8080/users
- Update (PATCH/PUT): Modifies existing data.
- Example endpoint: http://localhost:8080/users
- Delete (DELETE): Removes a record.
- Example endpoint: http://localhost:8080/users
-
Clone the repository:
git clone https://github.com/yourgithubusername/SpringMySqlRestApiDemo.git
-
Navigate to the directory:
cd focusBooker
-
Install dependencies: If you're using Maven:
mvn install
-
Run the application:
mvn spring-boot:run
Your application should now be running at http://localhost:8080.
You can deploy the application using Docker Compose, ensuring all dependencies and settings are consistent across different environments.
-
Ensure Docker & Docker Compose are Installed
-
Start the Application Navigate to the directory containing the docker-compose.yml file and execute:
docker-compose up
-
Verification Once the application is up and running, you can use tools like Postman to verify its functionality. Below is a screenshot of docker running and a POST request made to our endpoint using Postman:
This project is licensed under the MIT License.
Contributions, issues, and feature requests are welcome! See our contributing guide for more details.
- Java 8 or newer
- Maven
- A suitable database, with configuration specified in application.properties