Skip to content

A mySQL database to store my music library with a TUI frontend. Created for my CS 317 project.

License

Notifications You must be signed in to change notification settings

kcajeel/music-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Music Library

This is a music catalog system, where the information is stored in a MariaDB database and accessed via a TUI. You can add, remove, modify, and search for songs, artists, and albums in your library. This program was written in Rust with SQLx for the database integration and Ratatui for the UI.

Completed

  • Database integration works, queries work ✅
  • All CRUD operations tested ✅
  • -h/--help and -v/--version CLI args work ✅
  • TUI displays songs from database ✅
  • TUI search works ✅
  • New Song works ✅
  • Edit Song works ✅
  • Delete Song works ✅

All project features are completed!

I will continue testing the UI and fixing bugs as I find them, but in the general case this application is complete.

To Run This Application:

Dependencies

In order to run this application, you need to have these dependencies:

Once everything is installed and/or compiled, you need to initialize the database.

Initializing the Database

In your preferred SQL editor (I use DBeaver), use the included schema to initialize the tables.

  • note: You must first create a database called music before running the schema.

Building and Running the App

Now, you should navigate in your terminal to the directory where you downloaded this source code and use the command

$ cargo sqlx prepare -D mysql://<Database Username>:<Database Password>@localhost:<Your Database Port>/music
  • the usual port for a MySQL database is port 3306

This will run sqlx on the code to ensure that all of the queries will work. Sqlx checks all queries at compile-time and saves them in a .sqlx/ directory. This way, sqlx can protect your queries from SQL injection and it will ensure that they work before you run your code.

Now that your SQL queries are prepared, you should be all clear to run the code:

$ cargo run

If you installed your dependencies correctly, the application will begin to compile. If you set up and prepared your database correctly, it will run too.

The TUI provides instructions at the bottom of the screen, but I suppose I should make a user guide eventually.

Please submit an issue if you encounter any errors or need any clarification.

About

A mySQL database to store my music library with a TUI frontend. Created for my CS 317 project.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages