ITC-NTHU / LyricLab

1 stars 0 forks source link

README.md

LyricLab

A web service designed to help language learners expand their Mandarin vocabulary through Taiwanese songs. LyricLab's goal is to make learning more convenient and enjoyable.

Project Overview

LyricLab involves the design and implementation of a database for managing songs, lyrics, vocabulary, and recommendations with related attributes. The database is created and managed using Sequel, a Ruby toolkit for interacting with SQL databases. LyricLab pulls song information (title, artist, popularity, etc.) as well as lyrics from the Spotify and LrcLib APIs. Users can select one of the language levels and search for a song, generating a vocabulary list based on the selected level and the lyrics of the specified song. Users can then select specific words to see more learning information such as translations, pinyin, and example sentences.

Domain Entities

The primary domain entities for this project are:

Attributes of the lyrics Entity:

Attributes of the songs Entity:

Attributes of the vocabularies Entity:

Attributes of the words Entity:

Attributes of the recommendations Entity:

Attributes of the vocabularies_filtered_words Join Table:

Entity-Relationship Diagram (ERD)

Below is a conceptual representation of the database structure:

+-------------+       +---------------+     +---------------+
|   lyrics    |       |   songs       |     | vocabularies  |
+-------------+       +---------------+     +---------------+
| id          |------>| lyrics_id     |<----| id            |
| text        |       | vocabulary_id |     |               |
| is_mandarin |       | title         |+--->| language_level|
| is_instr.   |       | spotify_id    ||    | created_at    |
| created_at  |       | ...           ||    | updated_at    |
| updated_at  |       +---------------+|    +---------------+
+-------------+                        |             ^
                                       |             |
+-------------+       +----------------------------+ |
|   words     |<------| vocabularies_filtered_words| |
+-------------+       +----------------------------+ |
| id          |       | vocabulary_id              |-+
| characters  |       | filtered_word_id           |
| translation |       +----------------------------+
| pinyin      |
| ...         |
| created_at  |
| updated_at  |
+-------------+

+--------------------+
|  recommendations   |
+--------------------+
| id                 |
| title              |
| artist_name_string |
| search_cnt         |
| spotify_id         |
| created_at         |
| updated_at         |
+--------------------+

ERD Explanation:

Setup

  1. Create a personal Spotify API CLIENT_ID and CLIENT_SECRET.
  2. Copy config/secrets_example.yml to config/secrets.yml and update the information.
  3. Ensure the correct version of Ruby is installed (see .ruby-version for rbenv).
  4. Run bundle install to install the required gems.