API Documentation in Spring Boot Project using springdoc-openapi
How to generate API documentation using OpenAPI Specification in a Spring Boot project.
How to generate API documentation using OpenAPI Specification in a Spring Boot project.
What is jOOQ ? jOOQ is a Java library that lets you to generate Java code from the database and lets you write type-safe SQL queries. jOOQ transforms tables in a database into Java classes, which we can use to retrieve or update data. Using jOOQ Library Inititalize Database Tables Execute the SQL statements in src/resources/initial_table.sql file on a Postgres server to create users, categories, transacations tables. initial_table.sql content 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 DROP TABLE IF EXISTS users CASCADE; DROP TABLE IF EXISTS categories CASCADE; DROP TABLE IF EXISTS transactions CASCADE; CREATE TABLE IF NOT EXISTS users ( id BIGINT NOT NULL PRIMARY KEY, username TEXT, email TEXT, updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() ); CREATE TABLE IF NOT EXISTS categories ( id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY(START WITH 200000000) , user_id BIGINT REFERENCES users(id), name TEXT, active BOOLEAN NOT NULL DEFAULT TRUE, type TEXT, updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() ); CREATE TABLE IF NOT EXISTS transactions ( id BIGINT NOT NULL PRIMARY KEY, user_id BIGINT REFERENCES users(id), category_id BIGINT REFERENCES categories(id), amount BIGINT, transaction_date DATE NOT NULL DEFAULT CURRENT_DATE, note TEXT, updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() ); Add jOOQ Dependency To use jOOQ in Spring Boot, we declare a dependency to spring-boot-starter-jooq:...
Repository The repository for the backend implementation of Tabunganku is available here. Technology I develop the backend using Java 17 with Spring Boot, and Postgres 15.3 as the data store. Other Java libraries that I use in this project: spring-dotenv: a library to load environment variables from .env file. I use it to load database information and others. MapStruct: a library to create mapping between two Java Beans. I use it to transform entity objects into DTO objects....
Background When building a web application, we eventually have to connect to a database to retrieve data and to update data. One thing we don’t want to experience is having our database password leaked. Cloud providers solve this issue by providing a service to store sensitive information (e.g., AWS Secrets Manager). We need to explore an alternative solution to avoid reliance on external services. I researched two Java libraries that allow us to store sensitive data: Jasypt and dotenv....
I have completed the implementation of most of the main page features. It can load recent transactions and create a pie chart based on these transactions. Furthermore, the page displays both the total earnings and expense of the day. There is one feature that I have not completed yet, and that is the ability to view transactions on a date other than the current date. Display Here’s what it looks like if there is available data: To ensure good accessibility, I use Accessible Colors to adjust the red and green text colors....