Survey IT is a RESTful application built with Spring Boot that facilitates the creation, management, and participation in IT-focused surveys. The platform, ITLens, enables users to engage with structured surveys and view detailed statistical results of responses.
- Survey Management: Create and manage surveys with hierarchical structures (Chapters → Sub-Chapters → Questions).
- Question Types:
- 📋 Single Choice Questions
- 📝 Multiple Choice Questions
- Survey Participation: Collect user responses for active surveys.
- Results Analysis: View statistical insights and percentage breakdowns of survey responses.
- Backend: Spring Boot, Spring Web (REST API), Spring Data JPA, Spring Validation, Spring Context
- Database: PostgreSQL
- Documentation: Swagger/OpenAPI
- Testing: JUnit 5, Mockito
- Utilities: Lombok, MapStruct (DTO Mapping), @RestControllerAdvice (Centralized Exception Handling)
id
: Integertitle
: Stringdescription
: Stringowner
: Owner (reference)
id
: IntegercreationDate
: DatestartDate
: Dateyear
: Integersurvey
: Survey (reference)
id
: Integertitle
: String
id
: Integertitle
: Stringsubject
: Subject (reference)
id
: Integertext
: StringanswerCount
: Integertype
: QuestionType (SINGLE_CHOICE, MULTIPLE_CHOICE)subSubject
: SubSubject (reference)
id
: Integertext
: StringselectionCount
: Integerquestion
: Question (reference)
id
: Integername
: String
The @Exist
annotation is a custom validation annotation created to check whether a given entity exists in the database. This is particularly useful for validating foreign key relationships and ensuring data integrity before saving.
Simply annotate your DTO fields with @Exist
to ensure that the related entity exists in the database.
Example:
@NotNull @Positive @Exist(entity = Owner.class) Long ownerId
src/
├── main/
│ ├── java/
│ │ └── com.wora.itlens/
│ │ ├── annotations/
│ │ ├── config/
│ │ ├── controllers/
│ │ ├── exceptions/
│ │ ├── mappers/
│ │ ├── models/
│ │ │ ├── dtos/
│ │ │ ├── entites/
│ │ │ └── enumes/
│ │ ├── repositories/
│ │ ├── services/
│ │ ├── validation/
│ │ └── ItLensApplication.java
│ └── resources/
│ ├── static/
│ ├── templates/
│ ├── application.properties
│ └── application-test.properties
└── test/
└── java/
└── com.wora.itlens/
Before running the application, make sure you have the following installed: Java 17+ Maven PostgreSQL database
Clone the repository:
git clone https://github.com/hamzalamin/itLens/
Install the dependencies:
mvn install
Configure your database credentials:
spring.datasource.url=jdbc:postgresql://localhost:5432/your_database_name
spring.datasource.username=your_database_username
spring.datasource.password=your_database_password
You can explore the API documentation using Swagger at: http://localhost:8080/swagger-ui.html