https://github.com/erebelo/spring-mysql-demo
Java REST API project using Spring Boot 3 and MySQL database
https://github.com/erebelo/spring-mysql-demo
back-end backend backend-api backend-service java mysql mysql-database relational-database spring spring-boot springboot sql
Last synced: 11 months ago
JSON representation
Java REST API project using Spring Boot 3 and MySQL database
- Host: GitHub
- URL: https://github.com/erebelo/spring-mysql-demo
- Owner: erebelo
- License: mit
- Created: 2024-05-20T18:08:56.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-24T23:35:12.000Z (over 1 year ago)
- Last Synced: 2025-03-25T00:26:58.969Z (over 1 year ago)
- Topics: back-end, backend, backend-api, backend-service, java, mysql, mysql-database, relational-database, spring, spring-boot, springboot, sql
- Language: Java
- Homepage:
- Size: 226 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spring MySQL Demo
REST API project developed in Java using Spring Boot 3 and MySQL database.
## Requirements
- Java 17
- Spring Boot 3.x.x
- Apache Maven 3.8.6
## Libraries
- [spring-common-parent](https://github.com/erebelo/spring-common-parent): Manages the Spring Boot version and provide common configurations for plugins and formatting.
## Configuring Maven for GitHub Dependencies
To pull the `spring-common-parent` dependency, follow these steps:
1. **Generate a Personal Access Token**:
Go to your GitHub account -> **Settings** -> **Developer settings** -> **Personal access tokens** -> **Tokens (classic)** -> **Generate new token (classic)**:
- Fill out the **Note** field: `Pull packages`.
- Set the scope:
- `read:packages` (to download packages)
- Click **Generate token**.
2. **Set Up Maven Authentication**:
In your local Maven `settings.xml`, define the GitHub repository authentication using the following structure:
```xml
github-spring-common-parent
USERNAME
TOKEN
```
**NOTE**: Replace `USERNAME` with your GitHub username and `TOKEN` with the personal access token you just generated.
## Run App
- Create a new database schema named: `mysql_demo`
- Set the following environment variables: `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USERNAME`, and `DB_PASSWORD`.
- Run the `SpringMySQLDemoApplication` class as Java Application.
## Collection
[Project Collection](https://github.com/erebelo/spring-mysql-demo/tree/main/collection)
## DB Setup
[MySQL Server Setup](https://github.com/erebelo/spring-mysql-demo/tree/main/db-setup)
## Diagram
[Entity Relationship Diagram](https://github.com/erebelo/spring-mysql-demo/tree/main/db-setup/Entity%20Relationship%20Diagram.png)
## Script
[MySQL Demo Script](https://github.com/erebelo/spring-mysql-demo/tree/main/db-setup/mysql_demo_script.sql)