Update README.md

This commit is contained in:
Chigozirim Igweamaka 2024-08-04 22:52:08 +01:00 committed by GitHub
parent e8d706742d
commit 0a67461819
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,9 +41,43 @@ npm install
```
## Usage :bicyclist:
#### ▸ Setup MongoDB 🍃
#### ▸ Start the Client App
```
# Assuming you're in the client directory:
npm start
```
#### ▸ Start the Backend App
In a separate terminal window:
```
cd seek-tune
go run *.go serve [-proto <http|https> (default: http)] [-port <port number> (default: 5000)]
```
#### ▸ 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.
```
go run *.go download <https://open.spotify.com/.../...>
```
#### ▸ Save local songs to DB (supports all audio formats)
```
go run *.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.
To configure the database connection, you need to set the following environment variables:
#### ▸ Find matches for a song/recording
```
go run *.go find <path-to-wav-file>
```
#### ▸ Delete fingerprints and songs
```
go run *.go erase
```
#### ▸ Setup MongoDB 🍃
SQLite is used as the default database; however, you can switch to MongoDB if desired.
To configure the database connection for MongoDB, set the following environment variables:
- `DB_TYPE` = `"mongo"`
- `DB_USER`: The username for the MongoDB database.
- `DB_PASS`: The password for the MongoDB database.
- `DB_NAME`: The name of the MongoDB database.
@ -52,38 +86,6 @@ To configure the database connection, you need to set the following environment
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`.
#### ▸ Start the Client App 🏃‍♀️‍➡️
```
# Assuming you're in the client directory:
npm start
```
#### ▸ Start the Backend App 🏃‍♀️
In a separate terminal window:
```
cd seek-tune
go run *.go serve [-proto <http|https> (default: http)] [-port <port number> (default: 5000)]
```
#### ▸ 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.
```
go run *.go download <https://open.spotify.com/.../...>
```
#### ▸ Save local songs to DB (supports all audio formats) 💾
```
go run *.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 *.go find <path-to-wav-file>
```
#### ▸ Delete fingerprints and songs 🗑️
```
go run *.go erase
```
## Example :film_projector:
Download a song