Project Overview
Role: Backend Developer
Duration: May 2024 – June 2024
Tech Stack
- Node.js
- Express.js
- Firebase
- Google Cloud Run
- JWT (JSON Web Token)
- Flask
- GitHub Actions
MUVI-APP is a movie recommendation platform powered by machine learning, designed to deliver personalized movie suggestions based on user preferences. The backend supports user management, movie recommendations, and social features such as friend systems.
System Architecture
1. Clients
Smartphone: Users interact with the MUVI-APP through their mobile devices. These clients send requests to the backend APIs for tasks such as fetching movie recommendations or managing user data.
2. Application Layer
- Cloud Run (Backend API): The core backend service of MUVI-APP, deployed on Google Cloud Run. It is built using Node.js and Express.js, handling user authentication, data retrieval, and database interactions.
- Cloud Run (Recommendation API): Another service within MUVI-APP, developed using Python and Flask. It handles the movie recommendation logic by analyzing user interactions and preferences to generate personalized movie suggestions.
- Cloud Firestore (NoSQL Database): Google Cloud’s managed NoSQL database used to store user interaction data such as watched movies and preferences. It provides real-time synchronization, enabling changes to reflect instantly on users’ devices.
3. Artifact Registry
- Artifact Registry (Docker Images): This component stores Docker images for the Backend API and Recommendation API. These container images are securely version-controlled in the Google Artifact Registry.
4. Build Process
- GitHub Actions (CI/CD Workflows): Automates the process of building, testing, and deploying the MUVI-APP. It ensures a smooth and efficient continuous integration/continuous delivery (CI/CD) pipeline.
- Cloud KMS (Service Key Management): Manages encryption keys to securely encrypt and decrypt sensitive data, such as service accounts.
- Cloud Storage (Service Key Storage): Encrypted keys and configuration files are stored securely in Google Cloud Storage, managed by Cloud KMS.
NoSQL Database Design
- User: Stores user data, machine learning data, and authentication details.
- Movies: Stores movie ratings provided by users.
Design Pattern
The backend follows a Service-Repository Design Pattern to separate business logic from data access.
API Design
You can find the API documentation here.
Authentication and Authorization
Authentication is managed using JWT tokens. Each authenticated user receives a token, which must be included in the Authorization header for all subsequent API requests.
Data Security
User data is encrypted before being stored in the database. Passwords are hashed using the bcrypt algorithm.
Error Handling
Both frontend and backend errors are handled by sending appropriate error messages to the user, while error logs are stored for further analysis.
Deployment
MUVI-APP is deployed using Google Cloud Run, a fully managed serverless platform that automatically scales the application. The deployment process is part of the CI/CD pipeline.
Scalability
Cloud Run scales the application instances based on incoming traffic. It can start more container instances (up to 3) during high traffic periods and scale down when traffic decreases (minimum 0 instances), optimizing resource usage and cost.