rohankumardubey / todo-app-r2dbc-spring

TODO is a simple web application that introduces you to the power, performance, and simplicity of MariaDB. The TODO app contains a React.js front-end and Java (Maven) project back-end, which utilizes MariaDB Connector/R2DBC and Spring Data R2DBC.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TODO

TODO is a web application that introduces you to the power, performance, and simplicity of MariaDB.

This application is made of two parts:

This README will walk you through the steps for getting the TODO web application up and running using MariaDB.

Table of Contents

  1. Requirements
  2. Getting started with MariaDB
  3. Get the code
  4. Create the database and table
  5. Configure, build and run the apps
    1. Configure
    2. Build and run the Java API app
    3. Build and run the Client app
  6. Support and contribution
  7. License

Requirements

This sample application requires the following to be installed/enabled on your machine:

1.) Getting Started with MariaDB

MariaDB is a community-developed, commercially supported relational database management system, and the database you'll be using for this application.

If you don't have a MariaDB database up and running you can find more information on how to download, install and start using a MariaDB database in the MariaDB Quickstart Guide.

2.) Get the code

First, use git (through CLI or a client) to retrieve the code using git clone:

$ git clone https://github.com/mariadb-developers/todo-app-r2dbc-spring.git

Next, because this repo uses a git submodule, you will need to pull the client application using:

$ git submodule update --init --recursive

3.) Create the database and table

Connect to your MariaDB database (from Step #2) and execute the following SQL scripts using the following options:

a.) Use the MariaDB command-line client to execute the SQL contained within schema.sql.

Example command:

$ mariadb --host HOST_ADDRESS --port PORT_NO --user USER --password PASSWORD < schema.sql

OR

b.) Copy, paste and execute the raw SQL commands contained in schema.sql using a client of your choice.

CREATE DATABASE todo;

CREATE TABLE todo.tasks (
  id INT(11) unsigned NOT NULL AUTO_INCREMENT,
  description VARCHAR(500) NOT NULL,
  completed BOOLEAN NOT NULL DEFAULT 0,
  PRIMARY KEY (id)
);

4.) Configure, Build and Run the App

This application is made of two parts:

The following steps, a through c, will walk you through the process of configuring, building and running the api and client applications.

a.) Configure the app

Configure the MariaDB connection by changing a application.properties file to the Java project from the folder resources folder.

Example implementation:

spring.r2dbc.url=r2dbc:mariadb://127.0.0.1:3306/todo
spring.r2dbc.username=app_user
spring.r2dbc.password=Password123!
spring.r2dbc.pool.initial-size=5
spring.r2dbc.pool.max-size=10
spring.r2dbc.pool.max-idle-time=30m

b.) Build and run the Java API app

Once you have retrieved a copy of the code you're ready to build and run the project! Start by opening a terminal and navigating to the root of the api folder, then...

i. Build the project by executing the following CLI command:

$ mvn package

ii. Run the project by executing the following CLI command:

$ mvn spring-boot:run

c.) Build and run the UI (Client) app

Once the API project is running you can now communicate with the exposed endpoints directly (via HTTP requests) or with the application UI, which is contained with the client folder of this repo.

To start the client application follow the instructions here.

Support and Contribution

Please feel free to submit PR's, issues or requests to this project project directly.

If you have any other questions, comments, or looking for more information on MariaDB please check out:

Or reach out to us diretly via:

License

License

About

TODO is a simple web application that introduces you to the power, performance, and simplicity of MariaDB. The TODO app contains a React.js front-end and Java (Maven) project back-end, which utilizes MariaDB Connector/R2DBC and Spring Data R2DBC.

License:MIT License


Languages

Language:Java 100.0%