Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prath0m/first-spring-application-
My First Spring Boot Application that Contain Basic Crud Operation on Account using Clever Cloud MySQL Cloud Database.
https://github.com/prath0m/first-spring-application-
clevercloud crud-operation java mysql-database spring-boot spring-mvc
Last synced: about 1 month ago
JSON representation
My First Spring Boot Application that Contain Basic Crud Operation on Account using Clever Cloud MySQL Cloud Database.
- Host: GitHub
- URL: https://github.com/prath0m/first-spring-application-
- Owner: prath0m
- Created: 2024-08-15T05:18:06.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-15T05:27:27.000Z (3 months ago)
- Last Synced: 2024-10-12T02:03:21.504Z (about 1 month ago)
- Topics: clevercloud, crud-operation, java, mysql-database, spring-boot, spring-mvc
- Language: Java
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# My First Spring Boot Application
Welcome to my first Spring Boot application! This project demonstrates a basic CRUD (Create, Read, Update, Delete) operation on an `Account` entity, using a MySQL database hosted on Clever Cloud.
## Features
- **Spring Boot**: The project is built using the Spring Boot framework, making it easy to create stand-alone, production-grade Spring-based applications.
- **CRUD Operations**: Perform basic operations like Create, Read, Update, and Delete on the `Account` entity.
- **MySQL Database**: The application is connected to a MySQL database hosted on Clever Cloud, ensuring a reliable and scalable database solution.
- **Controller API**: Exposes a Controller API for interacting with the `Account` data.## Getting Started
### Prerequisites
- **Java 17** or later
- **Maven**: For managing dependencies and building the project.
- **MySQL Database on Clever Cloud**: Make sure you have set up your MySQL database on Clever Cloud and have the connection details ready.### Installation
1. **Clone the repository:**
```bash
git clone https://github.com/yourusername/your-repo-name.git
cd your-repo-name
```2. **Configure the database connection:**
Update the `application.properties` file located in `src/main/resources/` with your Clever Cloud MySQL database connection details:
```properties
spring.datasource.url=jdbc:mysql://:3306/
spring.datasource.username=
spring.datasource.password=
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
```3. **Build the project:**
```bash
mvn clean install
```4. **Run the application:**
```bash
mvn spring-boot:run
```5. **Access the API:**
The application runs on `http://localhost:8080`. You can access the API endpoints via tools like Postman or your web browser.
### Controller Endpoints
- **Create Account**: `POST /addacc`
- **Get All Accounts**: `GET /showacc`
- **Get Account by ID**: `POST /searchacc/{id}`
- **Update Account**: `POST /depositeamt/{id, amount}`
- **Delete Account**: `DELETE deleteacc/{id}`## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Happy coding!