APIs for music streaming covering essential functionalities for user management, browsing albums and songs, managing playlists, and searching songs by artists/albums.
Requirements
- Node
- Docker
To set up the app in a development environment:
- Clone the repository from GitHub:
git clone https://github.com/JSAssassin/sonic-connect.git
cd sonic-connect
- Install the required dependencies:
npm install
- 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
- 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
- At this point you can run the app
npm run dev
- To run the app in a production environment, you can do it in one of 2 ways:
- You can run
npm run prod
- Build docker image
docker build -t sonic-connect . docker run sonic-connect
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.
To check the test coverage, use the following command:
npm run coverage
To ensure the code follows the project's style guidelines, run the linter with:
npm run lint
For a detailed explanation of the APIs used in this project, please refer to the API Documentation.
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.
This project is licensed under the MIT License. See the LICENSE file for more details.