This is a simple Todo application built with Spring Boot, PostgreSQL, and React. It provides basic CRUD functionality for managing Todo items.
Backend
- Java 17 or later
- PostgreSQL database
- Gradle
Frontend
- Node.js
- pnpm
ReveseProxy(For development)
- Golang
git clone https://github.com/yourusername/todo-application.git
cd todo-application
- Start PostgreSQL and create a new database and user.
CREATE DATABASE todo_db;
CREATE USER todo_user WITH ENCRYPTED PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE todo_db TO todo_user;
- Update the
application.properties
file with your database credentials.
# backend/src/main/resources/application.properties
spring.application.name=demo
spring.datasource.url=jdbc:postgresql://localhost:5432/todo_db
spring.datasource.username=todo_user
spring.datasource.password=password
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
cd backend/src/main/resources/certs
# create rsa key pair
openssl genrsa -out keypair.pem 2048
# extract public key
openssl rsa -in keypair.pem -pubout -out public.pem
# create private key in PKCS#8 format
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in keypair.pem -out private.pem
- backend
cd backend
./gradlew bootRun
- frontend
cd frontend
pnpm i
pnpm run dev
- revese proxy
cd proxy
go run main.go
Go to http://localhost:8080/swagger-ui
and you will found this swagger ui
To get openapi's yaml spec file, run the command
curl localhost:8080/api-docs.yaml
To Donwload the latest spec file, run the command while backend is running
curl localhost:8080/api-docs | yq -P > api/spec.yml
To update frontend's api client according to the latest openapi's spec file, run the command
cd frontend
pnpm run gen
Contributions are welcome! Please create a pull request or submit an issue if you find any bugs or have suggestions for improvements.
This project is licensed under the MIT License.