/tunelad

Dummy playground project

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

Tune Lad (playground)

Tune Lad

Build License

Dummy project used as a playground for things like Spring Modulith, WebFlux, OpenAPI, SvelteKit, Tailwind CSS, etc.

This simple app allows to store an mp3 file with some description and play it via the browser <audio> html element.


  • Upload a track with description

  • List tracks with basic search

  • Play track from browser (streaming bytes with range support)

  • OpenAPI v3 endpoint

  • Spring boot actuator features (health, info, etc.)

  • Mobile friendly

  • PWA support

  • Lighthouse score follow up

  • a git client

  • a java (jdk17 or later)

  • maven (optional if you choose to use maven wrapper script)

  • Docker and Docker Compose

  • NodeJS v18.12.1 or later

This is a standard maven project. To build the application as fat jar, simply execute:

git clone https://github.com/uguy/tunelad.git
cd tunelad/
mvn package

The build should produce under the target/ folder (and in your local maven repository) a jar archive named tunelad-0.0.1-SNAPSHOT.jar

For more details about apache maven, please refer to the documentation

The frontend source code lives in <project root>/app folder.

Svelte frontend is build during maven backend build but if your want livereload for UI development this command will run the frontend app in dev mode.

npm run dev -- --open

You should format frontend resource by running the following command (todo: make this a git commit hook).

npm run format

The application depends on Elasticsearch (ES). You can start one by running docker compose from the root folder.

docker compose up -d

ES should be available at http://localhost:9200

GET http://localhost:9200 sample output
{
    "name" : "641f2b1d9694",
    "cluster_name" : "docker-cluster",
    "cluster_uuid" : "S2nCHRc7Smi4ZR-ZzOiIlA",
    "version" : {
        "number" : "8.5.3",
        "build_flavor" : "default",
        "build_type" : "docker",
        "build_hash" : "4ed5ee9afac63de92ec98f404ccbed7d3ba9584e",
        "build_date" : "2022-12-05T18:22:22.226119656Z",
        "build_snapshot" : false,
        "lucene_version" : "9.4.2",
        "minimum_wire_compatibility_version" : "7.17.0",
        "minimum_index_compatibility_version" : "7.0.0"
    },
    "tagline" : "You Know, for Search"
}

For simplicity, we use a simple file based H2 database. Data file are store under target folder.

If you start the application using -Dspring.profiles.active=h2-console, H2 web console is available at http://localhost:8082.

If you want to use another SGBD, add the maven dependency to the corresponding driver and update configuration in application.yml file

spring:
  datasource:
    driver-class-name: org.h2.Driver
    password: ''
    url: jdbc:h2:file:./target/tunelad;DB_CLOSE_ON_EXIT=FALSE
    username: sa

ES connection use spring-boot default configuration ( localhost:9200 ). If you want to customize it, please refer to the spring-boot documentation and update application.yml file

ES connection sample configuration
spring:
  elasticsearch:
    uris: "localhost:9200"
    socket-timeout: "10s"
    username: "user"
    password: "secret"

Application is available at http://localhost:8080

Track list

You can load some sample by running import method on test class org.tunelad.ImporterTest src/test/java/org/tunelad/ImporterTest.java.

The uguy organization on GitHub hosts the project’s source code, issue trackers, and other projects.

Source repository (git)

https://github.com/uguy/tunelad

Issue tracker

https://github.com/uguy/tunelad/issues

Organization on GitHub

https://github.com/uguy

Use of this software is granted under the terms of the GNU GENERAL PUBLIC LICENSE.

See the LICENSE for the full license text.