Server for the web app music player
- Install MongoDB Community edition
- Start mongodb as a service
- Install MongoDB Compass
- Run
yarn
ornpm install
- Run
yarn start
ornpm run start
to run this project. - Add a
.env
file, with aMONGO_URI
variable specifying the mongodb URL, and assign theTOKEN_SECRET
variable a value similar to the key hash generated bycrypto.randomBytes(128).toString('hex')
. - Add a
APP_SECRET
variable in the.env
file and assign it a value similar to the key hash generated bycrypto.randomBytes(16).toString('hex')
.
- User table schema
username: {type: String, required: true},
firstName: {type: String, required: true},
lastName: {type: String, required: true},
hash: {type: String, required: true},
salt: {type: String, required: true}
- AuthToken table schema
authToken: {type: String, required: true},
username: {type: String, required: true}
An API endpoint to fetch all users
An API endpoint that creates a new entry in the users table and an entry in the auth token table for the user.
An API endpoint that deletes all users and auth tokens from the users table and the auth token tables.
An API endpoint to authenticate a user, and return an auth token corresponding to the user.
An API endpoint to update password for a user.
An API endpoint to upload songs to the SoundFlow backend. An APP Secret header has to be added to verify the authenticity of the upload request.
An API endpoint that returns the URL to stream songs. An APP Secret header has to be added to verify the authenticity of the request.
An API endpoint that returns a URL from which a specific song can be streamed if the song ID exists in the database. An APP Secret header has to be added to verify the authenticity of the request.