{"id":15013748,"url":"https://github.com/zigad/quarkus-timescale-example","last_synced_at":"2025-04-12T05:45:12.070Z","repository":{"id":244296062,"uuid":"814826603","full_name":"zigad/Quarkus-Timescale-Example","owner":"zigad","description":"Example application that will post random values into TimescaleDB","archived":false,"fork":false,"pushed_at":"2025-04-07T14:39:39.000Z","size":84,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-04-12T05:45:04.051Z","etag":null,"topics":["docker-compose","java","quarkus","quarkus-example","quarkus-hibernate-orm","quarkus-maven","quarkus-resteasy","quarkusio","timescale","timescaledb","timeseries"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zigad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-13T19:37:06.000Z","updated_at":"2025-03-23T08:47:10.000Z","dependencies_parsed_at":"2024-06-24T17:23:15.737Z","dependency_job_id":"9d7f9888-68c4-47ae-857a-9b66e49f3623","html_url":"https://github.com/zigad/Quarkus-Timescale-Example","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.25,"last_synced_commit":"c7f547da7f0cb99509bdfc5372b2780447c006b4"},"previous_names":["zigad/quarkus-timescale-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigad%2FQuarkus-Timescale-Example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigad%2FQuarkus-Timescale-Example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigad%2FQuarkus-Timescale-Example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigad%2FQuarkus-Timescale-Example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zigad","download_url":"https://codeload.github.com/zigad/Quarkus-Timescale-Example/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525154,"owners_count":21118616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-compose","java","quarkus","quarkus-example","quarkus-hibernate-orm","quarkus-maven","quarkus-resteasy","quarkusio","timescale","timescaledb","timeseries"],"created_at":"2024-09-24T19:44:44.352Z","updated_at":"2025-04-12T05:45:12.035Z","avatar_url":"https://github.com/zigad.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quarkus TimescaleDB Example\n\nThis project demonstrates a simple Quarkus application that writes random values into TimescaleDB. This is\nmore of a playground for my personal use but feel free to optimise or use to code used here, The application will automatically drop all the tables at startup and recreate random values and populate them into DB so you will already have some example data. We can use REST GET call to get values, we can use POST request call to create a sensor in database and another POST call to populate DB with more random data. This project was done based on Java Quick Start Guide from official [Timescale Code Quick Start - Java](https://docs.timescale.com/quick-start/latest/java/) but instead of using pure Java I used Quarkus.\n\n## Table of Contents\n\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [Getting Started](#getting-started)\n    - [Clone the Repository](#clone-the-repository)\n    - [Configure Database](#configure-database)\n    - [Run the Application](#run-the-application)\n- [Endpoints](#endpoints)\n- [Project Structure](#project-structure)\n- [Technologies Used](#technologies-used)\n\n## Features\n\n- RESTful API for managing sensor data\n- TimescaleDB hypertable for efficient time-series data handling\n- Automatic database schema creation and data initialization\n- Demonstrates use of Quarkus with a PostgreSQL-based TimescaleDB\n\n## Prerequisites\n\n- Java 17 or higher\n- Maven 3.6.3 or higher\n- Docker (for running TimescaleDB)\n- Quarkus CLI (optional, for easier project management)\n\n## Getting Started\n\n### Clone the Repository\n\n```bash\ngit clone https://github.com/zigad/Quarkus-Timescale-Example.git\ncd Quarkus-Timescale-Example\n```\n\n### Configure Database\n\n1. **Start TimescaleDB**:\n\n   You can use Docker to quickly start a TimescaleDB instance:\n\n   ```bash\n   docker run -d --name timescaledb -p 5432:5432 -e POSTGRES_PASSWORD=p433w0rd timescale/timescaledb:latest-pg14\n   ```\n\n   Alternatively, you can use the provided [docker-compose.yaml](docker-compose.yaml) file to start a TimescaleDB\n   instance provided in the\n   root folder.\n   To start the TimescaleDB instance using Docker Compose, run:\n\n   ```bash\n   docker-compose up -d\n   ```\n\n2. **Update Database Configuration**:\n\n   Modify [application.properties](src%2Fmain%2Fresources%2Fapplication.properties) to match your TimescaleDB\n   configuration.\n\n### Run the Application\n\nUse Maven to build and run the application:\n\n```bash\n./mvnw compile quarkus:dev\n```\n\nMake sure that TimescaleDB is running in docker.\nQuarkus will start in development mode, enabling hot reload for faster development.\n\n## Endpoints\n\nThe application exposes the following RESTful endpoints:\n\n- **Get All Sensors**:\n    - **GET** `/sensorEntities`\n    - Response: `[{ \"id\": 1, \"type\": \"Temperature\", \"location\": \"Living Room\", \"sensorDataList\": [...] }]`\n\n\n- **Add a Sensor**:\n    - **POST** `/sensorEntities`\n    - Request Body: `{ \"type\": \"Temperature\", \"location\": \"Living Room\" }`\n\n\n- **Add Sensor Data**:\n    - **POST** `/generateData/{count}`\n    - Replace `{count}` with the number of random data points to generate.\n\n## Project Structure\n\n```\nsrc\n├── main\n│   ├── docker\n│   ├── java\n│   │   └── si\n│   │       └── deisinger\n│   │           ├── dto\n│   │           │   └── SensorDTO.java\n│   │           ├── entity\n│   │           │   ├── Sensor.java\n│   │           │   └── SensorData.java\n│   │           ├── repository\n│   │           │   ├── SensorDataRepository.java\n│   │           │   └── SensorRepository.java\n│   │           └── service\n│   │               ├── SensorDataService.java\n│   │               ├── SensorService.java\n│   │               └── TimescaleResource.java\n│   └── resources\n│       ├── application.properties\n│       └── import.sql\n└── target\n```\n\n- **src/main/java/si/deisinger/dto**: Data Transfer Objects\n- **src/main/java/si/deisinger/entity**: JPA entities for Sensor and SensorData\n- **src/main/java/si/deisinger/repository**: Repositories for accessing the database\n- **src/main/java/si/deisinger/service**: Service layer for business logic\n- **src/main/resources**: Configuration files\n    - **application.properties**: Quarkus application configuration\n    - **import.sql**: SQL script for initializing database schema and data\n\n## Technologies Used\n\n- **Quarkus**: Supersonic Subatomic Java framework\n- **TimescaleDB**: Time-series database based on PostgreSQL\n- **Hibernate ORM**: Object-relational mapping framework\n- **RESTEasy Reactive**: Reactive extensions for JAX-RS\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzigad%2Fquarkus-timescale-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzigad%2Fquarkus-timescale-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzigad%2Fquarkus-timescale-example/lists"}