Skip to content

Latest commit

 

History

History
100 lines (77 loc) · 2.27 KB

README.md

File metadata and controls

100 lines (77 loc) · 2.27 KB

Sonic Connect

APIs for music streaming covering essential functionalities for user management, browsing albums and songs, managing playlists, and searching songs by artists/albums.

Getting started

Requirements

  • Node
  • Docker

To set up the app in a development environment:

  1. Clone the repository from GitHub:
git clone https://github.com/JSAssassin/sonic-connect.git
cd sonic-connect
  1. Install the required dependencies:
npm install
  1. create a .env file

Example:

For database and server configuration:

DB_NAME=sonic-connect
DB_USER=root
DB_PASSWORD=password
DB_CONN_STR=mongodb://127.0.0.1:27017
PORT=3000

For JWT configuration:

SECRET_STR=mysecretkey
LOGIN_EXPIRES=86400000 # 1 day in milliseconds
  1. Create the database
docker compose up -d

Note: The database must be set up before running the application, as it is required for both development and testing.

Optional (Seed DB with mock data) see script for instructions mock data seeder script

  1. At this point you can run the app
npm run dev
  1. To run the app in a production environment, you can do it in one of 2 ways:
    1. You can run
    npm run prod
    1. Build docker image
    docker build -t sonic-connect .
    docker run sonic-connect

Running Tests

To run the tests, use the following command:

npm run test

Note: The --silent flag is set to true in the test script. To get logs for debugging purposes, remove the --silent flag from the script.

Test Coverage

To check the test coverage, use the following command:

npm run coverage

Linting

To ensure the code follows the project's style guidelines, run the linter with:

npm run lint

API Documentation

For a detailed explanation of the APIs used in this project, please refer to the API Documentation.

Contributing

Contributions to Sonic Connect are welcome! Please fork the repository, create a new branch, and submit a pull request. Ensure that your code follows the linting and testing guidelines.

License

This project is licensed under the MIT License. See the LICENSE file for more details.