Update README.md

This commit is contained in:
Chigozirim Igweamaka 2024-08-03 12:27:56 +01:00 committed by GitHub
parent 843635046f
commit 46e7fbbb21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,7 +41,7 @@ npm install
``` ```
## Usage :bicyclist: ## Usage :bicyclist:
▸ Setup MongoDB #### ▸ Setup MongoDB
To configure the database connection, you need to set the following environment variables: To configure the database connection, you need to set the following environment variables:
- `DB_USER`: The username for the MongoDB database. - `DB_USER`: The username for the MongoDB database.
@ -53,26 +53,32 @@ To configure the database connection, you need to set the following environment
The database connection URI is constructed using the environment variables. The database connection URI is constructed using the environment variables.
If the `DB_USER` or `DB_PASS` environment variables are not set, it defaults to connecting to `mongodb://localhost:27017`. If the `DB_USER` or `DB_PASS` environment variables are not set, it defaults to connecting to `mongodb://localhost:27017`.
▸ Start the Client App #### ▸ Start the Client App
``` ```
cd client cd client
npm start npm start
``` ```
▸ Serve the Backend App #### ▸ Start the Backend App
``` ```
cd .. # to go to the root dir cd .. # to go to the root dir
go run main.go serve [-proto <http|https>] [-port <port number>] go run main.go serve [-proto <http|https> (default: http)] [-port <port number> (default: 5000)]
``` ```
▸ Download a Song #### ▸ Download a Song
Note: A link from Spotify's mobile app won't work. You can copy the link from either the desktop or web app. Note: A link from Spotify's mobile app won't work. You can copy the link from either the desktop or web app.
``` ```
go run main.go download <https://open.spotify.com/.../...> go run main.go download <https://open.spotify.com/.../...>
``` ```
▸ Find matches for a song/recording #### ▸ Save local songs to DB (supports all audio formats)
```
go run main.go save [-f|--force] <path_to_song_file_or_dir_of_songs>
```
The `-f` or `--force` flag allows saving the song even if a YouTube ID is not found. Note that the frontend will not display matches without a YouTube ID.
#### ▸ Find matches for a song/recording
``` ```
go run main.go find <path-to-wav-file> go run main.go find <path-to-wav-file>
``` ```
▸ Delete fingerprints and songs #### ▸ Delete fingerprints and songs
``` ```
go run main.go erase go run main.go erase
``` ```
@ -125,7 +131,7 @@ Final prediction: Voilà by André Rieu , score: 5390686.00
## Todo ## Todo
- [ ] Enable song addition from WAV files - [x] Implement saving local songs to DB
- [ ] Add support for file-based DB as an alternative to MongoDB. - [ ] Add support for file-based DB as an alternative to MongoDB.
## Author :black_nib: ## Author :black_nib: