Giter Club home page Giter Club logo

todo-app's Introduction

Todo Application

This is a simple Todo application built with Spring Boot, PostgreSQL, and React. It provides basic CRUD functionality for managing Todo items.

Todo app's top page image

Prerequisites

Backend

  • Java 17 or later
  • PostgreSQL database
  • Gradle

Frontend

  • Node.js
  • pnpm

ReveseProxy(For development)

  • Golang

Setup

Step 1: Clone the Repository

git clone https://github.com/yourusername/todo-application.git
cd todo-application

Step 2: Configure the Database

  1. 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;
  1. 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

Step 3: Generate RSA Public & Private Keys

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

Step 4: Run Applications

  1. backend
cd backend
./gradlew bootRun
  1. frontend
cd frontend
pnpm i
pnpm run dev
  1. revese proxy
cd proxy
go run main.go

OpenAPI

Go to http://localhost:8080/swagger-ui and you will found this swagger ui

Swagger's image

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

Contributing

Contributions are welcome! Please create a pull request or submit an issue if you find any bugs or have suggestions for improvements.

License

This project is licensed under the MIT License.

todo-app's People

Contributors

ppdx999 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.