π΅ ScreenSounds Music App
A simple console-based Java application that allows users to register music, artists, songs, search songs by artist, and retrieve artist summaries from Wikipedia using an AI-powered API call.
π Features
β Register music artists with types: SOLO, DUO, BAND
β Register songs with title, artist, and genre
β List all registered songs
β Search songs by artist
β Fetch a Wikipedia summary about an artist using an external API
β Uses Spring Boot, Spring Data JPA, and PostgreSQL
π οΈ Technologies
Java 17+
Spring Boot
Spring Data JPA
PostgreSQL
Hibernate
Wikipedia API (via HttpURLConnection)
π§© Entities
π€ Artist id (auto-generated)
name
type: SOLO, DUO, or BAND
musics: list of songs linked to the artist
πΆ Musics
id (auto-generated)
title
artist (many-to-one relationship)
gender
π» How It Works
When you run the application, a menu is displayed in the terminal:
*** Screen Sounds Musics ***
1 - Register artist
2 - Register song
3 - List songs
4 - Search songs by artist
5 - Search data about artist
9 - Exit
You can interactively add or retrieve data through this menu.
π External API
Artist summaries are retrieved from the Wikipedia API in plain text format.
Example endpoint used:
π§ͺ How to Run
Configure your database in application.properties:
spring.datasource.url=jdbc:postgresql://localhost/screensoundsdb
spring.datasource.username=your_username
spring.datasource.password=your_password
Run PostgreSQL and create a database named screensoundsdb: CREATE DATABASE screensoundsdb;
Build and run the application:
./mvnw spring-boot:run
The interactive menu will be shown in the terminal.
π Project Structure
βββ model/
β βββ Artist.java
β βββ Musics.java
β βββ ArtistType.java
β βββ AI.java
βββ repository/
β βββ ArtistRepository.java
β βββ MusicsRepository.java
βββ service/
β βββ ApiConsumption.java
βββ main/
β βββ Main.java
βββ ScreenSoundsApplication.java
βββ StartupRunner.java
π§ AI Feature
The AI class uses the Wikipedia API to provide a brief summary of the artist entered by the user, giving contextual information and improving the app's experience.