Skip to main content

Architecture

Daydream uses a microservice architecture to provide a scalable and maintainable platform. Backend services are hosted by the Google Cloud Platform, while the frontend is hosted by Vercel.

Architecture

Frontend

The frontend is a Next.js application hosted by Vercel. It is a server-rendered application that uses React for the user interface. Backend data mutations are required to go through server-side actions to ensure security and data integrity. Data fetching is done with both methods, server-side and client-side, depending on the use case. Authentication is integrated with NextAuth.js.

Backend

The entrypoint to the backend services is Firestore. Data can be accessed and modified directly. Additional functionality is triggered by Firestore events, where Cloud Functions serves as a gateway to distribute the work to the respective microservices running on Cloud Run. Cloud Functions are also used to write back data to Firestore, as well as to push files to Cloud Storage. User authentication is handled by Firebase Authentication which is a subset of Identity Platform.