Spring-TeamWork is a collaborative project built using the Spring framework. This project serves as a demonstration of teamwork in developing a comprehensive application that integrates various Spring components and best practices.
- Overview
- Features
- Prerequisites
- Getting Started
- Project Structure
- Modules
- Database
- API Endpoints
- Testing
- Contributing
- License
- Contact
- Java-based backend
- Spring Boot integration
- RESTful APIs
- Data persistence with Spring Data JPA
- Security with Spring Security
- Comprehensive unit and integration testing
- Java 11 or higher
- Maven 3.6.3 or higher
- MySQL or any preferred relational database
- Clone the repository:
git clone https://github.com/raphaelzolotarev/Spring-TeamWork.git
- Navigate to the project directory:
cd Spring-TeamWork
- Configure the database in
src/main/resources/application.properties
:spring.datasource.url=jdbc:mysql://localhost:3306/spring_teamwork spring.datasource.username=root spring.datasource.password=yourpassword spring.jpa.hibernate.ddl-auto=update
- Build the project:
mvn clean install
- Run the application:
mvn spring-boot:run
Spring-TeamWork/ ├── src/ │ ├── main/ │ │ ├── java/ │ │ │ └── com/ │ │ │ └── teamwork/ │ │ │ ├── config/ # Configuration files │ │ │ ├── controller/ # REST controllers │ │ │ ├── dto/ # Data Transfer Objects │ │ │ ├── model/ # Entity models │ │ │ ├── repository/ # Repositories │ │ │ ├── service/ # Service layer │ │ │ └── SpringTeamworkApplication.java # Main application file │ │ └── resources/ │ │ ├── static/ # Static resources │ │ ├── templates/ # Thymeleaf templates │ │ └── application.properties # Application properties │ └── test/ # Test files ├── .gitignore ├── README.md └── pom.xml
Contains configuration classes for Spring Security and other configurations.
Houses the REST controllers that handle HTTP requests and responses.
Includes Data Transfer Objects used to transfer data between processes.
Defines the entity classes that map to the database tables.
Interfaces for database operations, extending Spring Data JPA repositories.
Contains the service layer with business logic.
The project uses a relational database (e.g., MySQL). Make sure to update the application.properties
file with your database credentials.
-
User Controller
GET /users
- Retrieve all usersPOST /users
- Create a new userGET /users/{id}
- Retrieve user by IDPUT /users/{id}
- Update user by IDDELETE /users/{id}
- Delete user by ID
-
Task Controller
GET /tasks
- Retrieve all tasksPOST /tasks
- Create a new taskGET /tasks/{id}
- Retrieve task by IDPUT /tasks/{id}
- Update task by IDDELETE /tasks/{id}
- Delete task by ID
The project includes several HTML templates located in src/main/resources/templates
:
- index.html: The home page of the application.
- users.html: Page for managing users.
- tasks.html: Page for managing tasks.
Unit and integration tests are included to ensure the correctness of the application. Run the tests using:
mvn test