Skip to content

Architecture

Athi Fongoqa edited this page Mar 10, 2022 · 3 revisions

Target audience:

  • Backend SE and/or PM with basic web development skills and looking to be onboarded to the project.

Before Reading:

  • An assumed reader has basic web AND software development skills (i.e., having passed SE19 and/or SE01).
  • Prior basic knowledge of Node.js would be recommended.

After Reading:

  • The reader should possess a basic understanding of the backend system and its interactions.

Description:

Ambient is an audio-first mobile application focused on artists and curators (both regarded as Creators) that allows them to engage with Listeners and promote their (Spotify-hosted) work directly to them. This can help them bring in more streams, but also add another source of income from direct support.

Users function as both Creators and Listeners from the same account:

  1. As a Creator:
    1. Will begin a live show and hold the highest privileges within their own respective ‘show-room’, meaning that if other participants would like to speak during a show, they will have to request permission from the Creator – which the Creator can either accept or reject.
    2. Will be able to set a playlist beforehand for the show. During the show, the Creator can interchangeably speak to the audience or play a song(s) from the playlist.
  2. As a Listener:
    1. Will join a live show and listen to the content or a particular Creator in real-time.
    2. Can request access from a Creator to speak in the show.
    3. Can leave comments in the comment section.

The system covered in this document is the backend component of this application.

The backend system comprises of:

  1. A Fastify REST API, which serves as an entry-point for the frontend system to retrieve information to display to the user.

Fastify is an efficient web framework for node.js with a powerful plugin architecture. Fastify allows the user to extend its functionalities with plugins. A plugin can be a set of routes, a server, decorator or a database connection (the list goes on).

  1. A MongoDB database, which stores information related to a user, the shows generated by the respective user along with their interactions.
  2. Third-party services which make possible functionalities such as:
    1. Authentication
    2. Audio-streaming
    3. Music playback (TBD)

Notable Third-Party Services:

  • Spotify Web API
    • Used for user authentication, extracting user data to create profiles, fetching songs, and for music playback.
  • Socket.io
    • Used for handling show events in real-time in collaboration with the frontend.
  • NGINX
    • Used for securely load balancing requests to the deployed backend.

Deployment: (Currently looking into the possibility of working with Terraform and AWS instead. We might be able to secure a larger cloud budget.)

  • Docker
  • Google Cloud Platform (STILL TBD, again)
    • Container Registry
    • Artifact Registry
    • Cloud Run (TESTING/DEVELOPMENT)
    • Kubernetes Engine (PRODUCTION - tested and works but expensive to test with this.)
  • Automated testing and CI/CD workflow using GitHub actions.
Clone this wiki locally