The Visoul Backend is a RESTful API built with Spring Boot that powers the Visouls Coming Soon Website.
It handles user email subscriptions and securely stores them in a MySQL database hosted on Railway.
This backend service provides secure APIs for managing data, authentication, and business logic for the project.
Below is the MySQL database hosted on Railway, used by the Visoul Backend for storing email subscriptions.
| Layer | Technology |
|---|---|
| Language | Java 21 |
| Framework | Spring Boot |
| Build Tool | Maven |
| Database | MySQL |
| ORM | Spring Data JPA |
| Testing | Postman |
src/
├── main/
│ ├── java/com/example/project/
│ │ ├── controller/
│ │ ├── model/
│ │ ├── repository/
│ │ ├── service/
│ │ └── config/
│ └── resources/
│ ├── application.properties
│ └── static/
└── test/
└── java/com/example/project/
git clone https://github.com/<your-username>/<your-repo-name>.git
cd <your-repo-name>
Make sure MySQL is running locally or remotely, and create a database:
CREATE DATABASE your_database_name;
There are two ways to configure your database credentials:
Create a file named .env in the project root:
DB_HOST=localhost
DB_PORT=3306
DB_NAME=your_database_name
DB_USER=root
DB_PASSWORD=your_password
Open the file: src/main/resources/application.properties
# Database Configuration
spring.datasource.url=jdbc:mysql://localhost:3306/your_database_name
spring.datasource.username=root
spring.datasource.password=your_password
# Hibernate Settings
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
mvn spring-boot:run
🔹 Example: Send JSON Data with POST Request
Method: POST URL: http://localhost:8080/
{
"email": "john@example.com"
}
reveice a succussfull message!!!
services:
mysql:
image: mysql:8
container_name: mysql_container
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: your_database_name
ports:
- "3306:3306"
networks:
- springboot-net
app:
build: .
container_name: springboot_app
ports:
- "8080:8080"
depends_on:
- mysql
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/your_database_name
SPRING_DATASOURCE_USERNAME: root
SPRING_DATASOURCE_PASSWORD: root
networks:
- springboot-net
networks:
springboot-net:
driver: bridge
Jagadeesh S
📧 sjagadeesh668@gmail.com