A starter template for building full-stack applications with a Java JDBC backend (MySQL) on a Apache Tomcat server and a Vue.js frontend
backend/
— Java backend using JDBC to connect to MySQLfrontend/
— Vue.js frontend
- Java JDK 17 or higher
- Apache Tomcat 10 or higher
- MySQL Server
- Node.js and npm
Create a MySQL database and a users
table:
CREATE TABLE users (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(100),
email VARCHAR(100)
);
Sample connection details (update as needed):
- URL:
jdbc:mysql://localhost:3306/crud
- User:
root
- Password:
your_password
- Created Using
mvn archetype:generate -DgroupId=com.example -DartifactId=backend -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
- Go to the backend directory:
cd backend
- Build with Maven:
mvn clean package
- Deploy the generated WAR file to your Tomcat
webapps
directory and start Tomcat.
The backend API will be available at:
http://localhost:8080/crud-app/api/users
- Go to the frontend directory:
cd frontend
- Install dependencies:
npm install
- Start the development server:
npm run dev
The frontend will be available at the URL shown in the terminal, typically:
http://localhost:5000
GET /api/users
— Get all usersGET /api/users/{id}
— Get user by IDPOST /api/users
— Create a new userPUT /api/users/{id}
— Update an existing userDELETE /api/users/{id}
— Delete a user
Backend:
- Java
- JDBC (MySQL)
- Jakarta Servlets
- Apache Tomcat
- JSON
Frontend:
- Vue.js
- Axios
- Bootstrap (optional)
This starter pack is designed for easy customization and extension. Build your own features on top of this template!