Alan052918 / CloudNotes

A simple RESTful service to organize notes with folders and hashtags, built with Spring Boot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CloudNotes

Java CI with Maven Coverage Coverage

A simple RESTful service to organize notes with folders and hashtags, built with Spring Boot.

  • Spring Boot
    • Spring Web MVC: controller, service, repository architecture
    • Spring Data JPA: entity, JQL query
      • OneToMany, ManyToOne, ManyToMany relations
    • Spring HATEOAS: entity model, collection model, add links to API (make it RESTful)
    • Spring Validation: validate request forms
    • Spring Testing, JUnit 5, Mockito: controller tests, service tests, repository tests
  • Maven
    • Maven multi-module project: dependency management, plugin management
    • Build and run Spring Boot Application
  • MySQL
  • Docker Compose
  • API design
  • Exception handling
  • Unit/integration testing

Table of Contents

Getting Started

Environment

  • Java SE 1.8
  • Docker Compose 3.8
  • Spring Boot 2.6.4
  • MySQL 8

Clone the repository

git clone https://github.com/Alan052918/CloudNotes.git

Run MySQL container

cd CloudNotes
docker compose up -d

Run note Spring Boot Application

cd note
mvn spring-boot:run

Warning: There is a LoadDatabase.java that populates the database with some folders, notes, and tags. My intention is to save you some time creating data, but please drop all tables before rerunning the application. An in-memory database like H2 that allows clean starts is preferable for testing purposes.

Model

  • Folder: A folder can have multiple sub-folders and multiple notes
    • id: Long
    • name: String
    • createdAt: ZonedDateTime
    • updatedAt: ZonedDateTime
    • parentFolder: Folder
    • subFolders: List<Folder>
    • notes: List<Note>
  • Note: A note belongs to only one folder
    • id: Long
    • name: String
    • content: String
    • createdAt: ZonedDateTime
    • updatedAt: ZonedDateTime
    • folder: Folder
    • tags: List<Tag>
  • Tag: A tag can be attached to multiple notes, a note can also have multiple tags
    • id: Long
    • name: String
    • createdAt: ZonedDateTime
    • updatedAt: ZonedDateTime
    • notes: List<Note>

Next Steps

Service oriented architecture:

  • Transport: HTTP JSON
  • Logging
  • Audit logging
  • Security
  • Metrics
  • Tracing
  • Circuit breaking
  • Rate limiting
  • Service discovery
  • Service registry
  • Caching strategy
  • Deploy strategy
  • Contract testing
  • Alerting

Miscellaneous:

  • Add unit tests and integration tests with Spring Testing
  • Containerize note application
  • Add more submodules and service discovery to make this project fully microservice.

About

A simple RESTful service to organize notes with folders and hashtags, built with Spring Boot


Languages

Language:Java 99.8%Language:HTML 0.1%Language:Dockerfile 0.1%