๐ Deployment:
https://ambient-niqfhm2phq-ey.a.run.app
The development of the project is still in progress. Currently we are working on controlling music playback and playlists for upcoming shows directly from Spotify.
Prerequisites: nodejs v16.13.0
or newer and npm 8.3.1
or newer.
To install this project and run it locally, please follow the following steps:
- Open the terminal and run
git clone https://github.com/athifongoqa/ambient-BE.git
; - Navigate to the repository (
cd ambient-BE
) and create a .env file as specified below; - Navigate to the branch you are interested in (
git checkout BRANCH_NAME
); - Install the npm packages by running
npm install
; - Either run the development server with
npm run dev
or run the app for better performances by runningnpm run start
; - Visit http://0.0.0.0:3000.
- To login, visit http://0.0.0.0:3000/login/spotify
CLIENT_ID= # Spotify client id - visit: https://developer.spotify.com/dashboard and create a new application & register http://0.0.0.0:3000/spotify/login/spotify/callback as the redirect URI
CLIENT_SECRET= # Spotify client secret - visit: https://developer.spotify.com/dashboard and create a new application & register http://0.0.0.0:3000/spotify/login/spotify/callback as the redirect URI
MONGODB= # MongoDB URI
FASTIFY_ADDRESS=0.0.0.0
JWT_SECRET= # your secret
This app uses Jest, and Mocha for Unit & Integration tests.
You can run the Unit and Integration tests by simply running npm run test
.
Here is a description of the content of each folder in the directory:
. # Root directory.
โโโ .github # Convention folder used to place Github related folders and files
โ โโโ workflows # Configuration folder containing yml files for GitHub Actions
โ โโโ gcp # yml file for handling deployment jobs
โโโ controllers # Handler functions
โ โโโ admin
โ โโโ shows
โ โโโ sockets
โ โโโ users
โโโ models # Show & User models & schemas
โ โโโ shows.model
โ โโโ users.model
โโโ plugins
โ โโโ jwt # JWT-related decorators
โ โโโ sockets # Fastify-socket.io events and connection
โ โโโ spotify # Spotify OAuth support
โ โโโ swagger # Documentation support using Swagger
โโโ routes
โ โโโ api
โ โ โโโ shows
โ โ โ โโโ index # Show endpoints
โ โ โ โโโ schema # Show schema definitions
โ โ โโโ users
โ โ โโโ index # User endpoints
โ โ โโโ schema # User schema definitions
โ โโโ spotify
โ โ โโโ index # Spotify callback and user sign-in
โ โโโ root # Health-check
โโโ tests # Unit & integration tests
โ โโโ routes
โ โโโ routes
โ โ โโโ admin.integration
โ โ โโโ shows.integration
โ โ โโโ shows.test
โ โ โโโ users.integration
โ โโโ dummyShows # Mock shows
โ โโโ helper # Builds server for tests
โ โโโ testdb # Mock database
โโโ app # Main server file
The features currently available in this app include:
- Secure OAuth integration with Spotify
- Secure authentication and authorisation with JSON Web Tokens
- API for users and shows endpoints
- Websockets for audio streaming and chat functionality
- Unit & Integration tests
- API documnetation using Swagger
- Deployed using Google Cloud Platform's Cloud Run
The features that will be implemented soon in the future include:
- Spotify music playback streaming through websocket server
- Storing playlists for upcoming shows
- The social functionalities that will allow the users to follow each other and see each other's acitity are also under development.