Password management tool, using Java Web, Spring, Redis, Vue.js, DDD and TDD technologies.
Redis must be installed. If not yet, it can be done in Arch Linux with:
$ sudo pacman -S redis
This is a Maven application, that can be installed with:
mvn clean package
This is a simple web application. It's main endpoint can be just called in a Web browser, as explained in the 'Run' section, below.
First of all, Redis server must be up and running. This can be done in Arch Linux by running the following:
$ redis-server
After that, the application must be started with a single jar call:
$ java -jar <jarfile>
This will execute embedded Tomcat, that will create a web app in port 8080. So, the application can be called by any Web browser in the following URL:
http://localhost:8080/
You can type:
$ mvn clean test
To run unit tests; and
$ mvn clean integration-test
To run both unit and integration tests.
Some important design choices are defined in the table below:
Category | Topic | Description | References |
---|---|---|---|
Architecture & Design | DDD layered architecture | Adopted as a way decouple the domain problem (transactions, accounts and its business rules) from different levels of technical elements (json parsing, input redirection), so that the domain can evolve regardless of technical layers and those can be changed later without any impact to the domain. According to DDD layer theory, there are four layers (presentation, application, domain and infrastructure) and, as dependency rule, each layer cannot access the above layer. | archfirst |
Architecture & Design | Web application | A web application that decouples front-and and back-end. Using Vue.js in the front and Spring (Boot+MVC) in the backend. | spring-boot spring-mvc vue.js |
Architecture & Design | Key-Value NoSQL database | Using Redis as storage technology (and Jedis as Java client). The key-value model seems a good fit for password management data. | redis jedis spring-data-redis baeldung-spring-redis |
Code best practices | Reducing boilerplate code | Using lombok library as a way to remove boilerplate code in Java. Lombok can generate getters, setters, builders and others, during compile-time, based on annotations. | lombok |
Code best practices | TDD | A way to design and build classes that do just the necessary and nothing more. | tdd |
Code best practices | Integration tests | It's a good practice to test code altogether with Redis in an embedded environment designed just for tests. This way, the code is constructed and validated before put into production. | emb-redis-server |
VCS | Git Branching Model | A branch model is an organized way to structure a git project for further collaboration. | git-branching |
VCS | Git Commit | Adopting best practices in Git commit messages. | chris-beams |
The packages' structure (in src/main/java
dir) was designed as DDD layering (above described),
and it is as following:
Package/Layer | Function | Allowed to access | Currently accessing |
---|---|---|---|
br.com.arneam.pwdmanager.presentation |
Responsible to interact with the external world (users). This is where web pages are located. | itself, application , domain and infrastructure layers |
itself and application layer |
br.com.arneam.pwdmanager.application |
Responsible to serialize and deserialize data, expose REST services (as entry-points to the presentation layer), and orchestrate calls to domain's aggregated roots. This layer is stateless. | itself, domain and infrastructure |
itself, domain and infrastructure layers |
br.com.arneam.pwdmanager.domain |
Responsible to implement business rules. | itself and infrastructure layer |
itself and infrastructure layer |
br.com.arneam.pwdmanager.infrastructure |
Responsible to interact with external world (data, integration with third party tools, etc) and to keep useful objects for the domain that are not part of the domain layer. | itself | itself |
Copyright © 2019 medeiros
Distributed under the MIT License.