How dkellerman/songisms works
Main Components
• Frontend Client: Represent the Nuxt.js app ("rhymes/client") that provides the user interface for querying rhymes.
• Django Backend:
• Main Django project (“songisms”) that handles settings, routing (via ASGI/WGSI files), and serves as the entry point.
• Two key Django apps:
▪ "songs": This handles administrative tasks and database management for the song lyric database.
▪ "rhymes": This app provides rhyme query functionality and contains the neural network (see “rhymes/nn.py”) as well as management commands (such as "rhymesnet") to support training, testing, and predictions.
• Database: Although not shown explicitly as a code file, the README indicates the use of PostgreSQL (with extensions like fuzzystrmatch and cube) which is central to storing and managing song lyric data.
• Auxiliary Scripts & Data: The “data” folder and scripts in “scripts/” provide supporting data files (CSV, JSON, TXT) and processing logic (e.g., lyric_sim, proc_gpt_ipa) which may be integrated into the backend processes.
Relationships and Interactions
• The Django backend (songisms project) orchestrates interactions between the two Django apps. For example, the "songs" app might manage song metadata and the "rhymes" app handles rhyme-specific queries, potentially using data from both apps.
• The backend interacts with the PostgreSQL database to store and retrieve song lyric data and to support rhyme search queries.
• Management commands (such as from “rhymes/management” and “songs/management”) may be depicted as auxiliary processes that operate on the database and the neural network. These can be shown as occasional batch processes that trigger neural net training or cache updates.
• Any integration with external libraries or frameworks (e.g., PyTorch for neural net training in “rhymes/nn.py”) should be noted as part of the backend’s technical stack.
Important Architectural Patterns and Technologies
• Separation of concerns: the project is modular, with a clear division between the frontend (Nuxt.js) and backend (Django), and further within the backend between administrative (songs) and rhyme-serving (rhymes) functionalities.
• API interactions: the Nuxt.js client interacts with the Django backend via defined API endpoints.
• Use of management commands: for operations like neural net training, cache generation, and data processing—these reflect design decisions to separate background tasks from the main request/response cycle.
• Relevant technologies include Python 3.9+, Django, PostgreSQL (with custom extensions), Node v18, Nuxt.js (Vue.js framework), and PyTorch (for the neural net).
• “songs” App (Admin and DB management)
• “rhymes” App (API for rhyme queries, neural net functionality)
• Additional annotations for key technologies such as PyTorch, Nuxt.js, Django, PostgreSQL, and any important configuration tools.