Skip to content

RipperZero/React-SpringBoot

 
 

Repository files navigation

React-SpringBoot

简体中文

movie helper icon

Movie Helper

Known Vulnerabilities

Movie management and find valuable movies to watch

Visitor

visitor

Git clone repo

git clone --recursive [email protected]:zzh1991/Movie-Helper.git

# or
git clone [email protected]:zzh1991/Movie-Helper.git
git submodule init
git submodule update

🚀 Usage

Start application

configure database

configure your database name (an empty database), user, password in src/main/resources/application.yml

You could use PostgreSQL(default configuration) or MySQL. Also, you could use H2 database.

MySQL configuration
spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/movie?allowPublicKeyRetrieval=true&useConfigs=maxPerformance&useSSL=false&serverTimezone=UTC&characterEncoding=utf8
    password: mysql
    username: root
    initialization-mode: never

  flyway:
    enabled: true
    baseline-on-migrate: true
    validate-on-migrate: false
    locations: classpath:db/migration/mysql

remove postgres dependency and add mysql dependency in pom.xml

<!-- remove -->
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
</dependency>

<!-- add -->
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
</dependency>

Configure Front

  • cd front
  • yarn: install dependency
  • prepare front static files
    • dev mode
      • yarn start
    • build mode
      • yarn run deploy
  • start the web app in IDE
  • open browser

Update submodule for front end

cd front
git fetch origin master
git rebase origin/master

# or
git submodule update --remote front

Java doc

mvn javadoc:javadoc

open target/site/apidocs/index.html by browser

New Design

Dark Mode

Old Design

Recent Movies

Recent

Top 100 Movies

Top

Viewed Movies

View

Stared Movies(Want to watch)

Star

All Movies

All

Reference

Todo

Improvement

  • sync recent / top movies
  • latest sync time
  • search by movie name
  • database upgrade
  • schedule task
  • java doc
  • lazy load
  • use timestamp with time zone

Dependency

Backend

  • Spring Boot 2
  • PostgresQL
  • Guava
  • Swagger2
  • Flyway
  • Prometheus
  • GraphQL
  • Mybatis
  • Mybatis-plus

Endpoints

Swagger UI

Monitoring Endpoint

GraphiQL Endpoint

Configuration

Hot deploy for Intellij IDEA

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
</dependency>
  • setting -> compiler -> make project automatically
  • ctrl + shift + a -> registry -> auto make enabled

Active dev profile

  1. edit run/debug configuration
  2. add environment variables: spring.profiles.active=dev

Dependency Version Management

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>versions-maven-plugin</artifactId>
</plugin>

Display update

mvn versions:display-dependency-updates

Update dependency

mvn versions:use-next-releases

mvn versions:use-latest-releases

Problems

Migrate flyway 3.x to 5.x issue

firstly should migrate to 4.2.0 and then 5.x

H2 database conflict with druid?

Mybatis timestamptz could not convert to timestamp?

Refer to mybatis/mybatis-3#1644

  1. copy LocalDateTimeTypeHandler.java into project
  2. configure LocalDateTimeTypeHandler bean

Author

👤 Zhihao Zhang

Show your support

Please ⭐️ this repository if this project helped you!

📝 License

Copyright © 2020 zzh1991.
This project is MIT licensed.

About

React + Spring Boot (Movie Helper)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 95.6%
  • TSQL 2.4%
  • HTML 1.1%
  • Other 0.9%