Skip to content

davidwrz/QuizApp

Repository files navigation

Portfolio Project

Quiz Application Logo

Motivation

I decided to work on this project because I simply love programming, and it brings me so much joy. I wanted to create it not only to showcase my skills but also to have fun with it. For me, programming is not just a job; it's a passion. Additionally, I aim to leverage the tools I'm already familiar with and have on my resume as a testament to my abilities. Rather than just learning new things through tutorials, I prefer applying them in real projects, which allows me to learn and grow more effectively.

Project Overview

The Quiz Application is a RESTful API that offers a range of functionalities centered around quiz management. Key features of the application encompass user registration, question addition, answer submission, and generating questions from an external API. Additionally, external modules are integrated, with a future goal of transitioning to Microservices for recording question-answer events. The API is structured to enable direct communication with the front-end, facilitated through a RESTful API accessible via the Swagger tool.

Technologies Used

The Quiz Application is built using the following technologies and tools:
Java Spring Boot Hibernate PostgreSQL Groovy Spock JUnit Docker CI/CD Git GitHub Swagger Lombok Postman InteliJ

  • Java
    Java 17 serves as the foundation of this project, where I've harnessed its latest features. Notably, records, streams, and method references have been seamlessly integrated to enhance code clarity and functionality. An emphasis on encapsulation, guided by SOLID principles, underpins the design. Additionally, I've implemented prominent design patterns, including the Facade and Builder patterns. This concerted approach not only optimizes code structure but also reinforces maintainability and extensibility throughout the project.

  • Spring Boot
    I've employed various Spring modules to create a comprehensive application framework. These include Core, Web, Data, Security, AOP, and Validation.

  • Hibernate
    In this project, Hibernate functions as the ORM of choice for validating entities, which have been established through Flyway migrations.

  • Spring Security
    The app's security is powered by JWT. When users sign up, their passwords are kept safe and used to create tokens for access. If a token is lost, users can make a new one by confirming their password. Additionally, other parts of the app are also locked down to keep things secure.

  • Database: PostgreSQL
    The application uses Docker Image of PostgreSQL.

  • Flyway
    The application is still a small project and Hibernate would easily handle automatic mapping. Altough I want to have a scalability and for that FLyway is really suitable option.

  • Unit Testing: Groovy, Spock
    Leveraging Groovy in conjunction with the Spock testing framework addresses a specific challenge encountered in Spring Boot application testing. By adhering to encapsulation principles, direct field access is restricted, necessitating an alternative approach. Groovy's dynamic nature eliminates the need for traditional getters and setters, enabling seamless field access in testing. This alignment is particularly advantageous within Domain Driven Design contexts, upholding the Demeter Law. While this approach warrants caution in production, it significantly enhances testing efficiency and maintains code quality.

  • Integration Tests: jUnit
    The integration tests I've established primarily assess the status codes returned by endpoints, validating their correct operation. These tests operate on a live PostgreSQL database, ensuring accurate evaluation of the application's real-world behavior.

  • Architecture: Domain Driven Design
    I put in a considerable amount of effort to accurately replicate a real project within its authentic environment. As a result, there are times when it might appear somewhat 'overengineered'. To be honest, there were simpler approaches available, but my aim was to apply Domain-Driven Design (DDD) principles , which led me to take this slightly more elaborate route. Plus, I factored in scalability for the project's future.

  • Docker
    Docker was used to package the application into a self-contained image, making it easy to run on different environments. I also set up other images that work alongside my app for added functionality.

  • Cloud deployment: Heroku
    Heroku serves as the deployment platform for this project, triggered automatically upon merging into the main branch.

  • CI/CD: GitHub Actions
    GitHub Actions has been configured to facilitate seamless integration and continuous deployment. This setup streamlines repository management. Continuous Integration (CI) triggers unit and integration tests with every commit. On the other hand, Continuous Deployment (CD) is initiated when pull requests are made to the main branch (develop). CD entails updating the Docker image on DockerHub and deploying changes to Heroku.

  • Swagger
    I utilized Swagger to streamline documentation and facilitate easy exploration of project endpoints. This decision aims for example to simplify frontend implementation by providing an interactive Swagger UI documentation accessible at http://localhost:8080/swagger-ui/index.html

How to Run the Project

Build the Docker image

docker pull davidwrz/quizapp:latest

Run the Docker container

docker run -p 8080:8080 -d quizapp

The application will be available at http://localhost:8080.

Contact

If you have any questions or feedback please feel free to reach out to me at [email protected].

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published