Skip to content

Commit

Permalink
Merge pull request #216 from hoangsonww/main-deployment-branch
Browse files Browse the repository at this point in the history
Main deployment branch
  • Loading branch information
hoangsonww authored Jun 20, 2024
2 parents f965c87 + 8c4617a commit 5118058
Show file tree
Hide file tree
Showing 21 changed files with 62,321 additions and 165 deletions.
2 changes: 1 addition & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ There are also additional directories and files for project configuration, testi

The current deployment and production branch is `main-deployment-branch` and is being deployed to the official website at [movie-verse.com](https://movie-verse.com). The deployment process involves building the frontend, backend, and mobile app, configuring the server, and deploying the application to the server. The deployment process is automated using CI/CD pipelines and scripts to ensure a seamless deployment experience.

The app is using `Netlify` for the frontend deployment and `Heroku` for the backend deployment. The deployment status is monitored regularly to ensure the application is up and running smoothly.
The app is using [Netlify](https://www.netlify.com/) for the frontend deployment and [Heroku](https://www.heroku.com) for the backend deployment. The deployment status is monitored regularly to ensure the application is up and running smoothly.

## Technology Stack

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
99 changes: 0 additions & 99 deletions App.vue

This file was deleted.

2 changes: 1 addition & 1 deletion MovieVerse-Backend/.idea/MovieVerse-Backend.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion MovieVerse-Backend/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

102 changes: 72 additions & 30 deletions MovieVerse-Backend/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 56 additions & 8 deletions MovieVerse-Backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Running the Services](#running-the-services)
- [Quick Start](#quick-start)
- [Running the Services (Recommended)](#running-the-services-recommended)
- [Database Services](#database-services)
- [Django Service](#django-service)
- [API Service](#api-service)
- [Flask Service](#flask-service)
- [Machine Learning Services](#machine-learning-services)
- [Crawler Service](#crawler-service)
Expand All @@ -17,9 +19,9 @@

## Overview

The backend of MovieVerse is built using a microservices architecture. This architecture allows for independent scalability and enhanced flexibility in the development of different functionalities of the app, such as authentication, user management, movie data processing, and more.
The backend of MovieVerse is built using the **microservices architecture**. This architecture allows for independent scalability and enhanced flexibility in the development of different functionalities of the app, such as authentication, user management, movie data processing, and more.

**Important**: Be sure to read this file and the [README.md](databases/README.md) file in the `databases` directory for more information on the backend services of MovieVerse before you start developing.
**Important**: Be sure to carefully read this file and the [README.md](databases/README.md) file in the `databases` directory for more information on the backend services of MovieVerse before you start developing.

## Architecture

Expand Down Expand Up @@ -70,7 +72,7 @@ pip install -r requirements.txt

2. Navigate to the repository:
```bash
cd mobile-backend
cd MovieVerse-Backend
```

3. Create a Virtual Environment (optional but recommended):
Expand All @@ -81,7 +83,19 @@ pip install -r requirements.txt

4. Follow the specific installation instructions for each service below.

### Running the Services
### Quick Start

To quickly start the backend services of MovieVerse, simply run:

```bash
npm start
```

This command will start most (but not all) of the services required for the backend of MovieVerse. Note that before running this command, you must have all the prerequisites installed on your machine.

**Important**: Remember to set the `SECRET_KEY` and set `Debug` to `True` in the [settings.py](django_backend/django_backend/settings.py) file in the `django_backend` directory. This is crucial for running the Django server locally. Additionally, you are also required to obtain a Django secret key and set it in the `settings.py` file.

### Running the Services (Recommended)

To run the MovieVerse's backend services, follow these steps **in order**:
Expand Down Expand Up @@ -179,11 +193,11 @@ MovieVerse currently uses MongoDB, Redis, PostgreSQL, and MySQL as its primary d
7. For the next steps, refer to the [README.md](databases/README.md) file in the `databases` directory for more information on the database services.
**Disclaimer**: These servers are for your local development environment only, in order for you to see how our backend services interact with each other.
In our production environment, we use cloud-based services like AWS, Azure, and Google Cloud to host our databases and services. This thus will look different from what you might see on your end.
In our production environment, we use cloud-based services like AWS, Azure, and Google Cloud (in our case, **Heroku**) to host our databases and services. This thus will look different from what you might see on your end.
#### Django Service
The Django service is responsible for handling the majority of backend functionalities of MovieVerse, such as API endpoints, movies management, database interactions, user management, and more. To run the Django service, follow these steps:
The Django service is responsible for handling the majority of backend functionalities of MovieVerse, such as API endpoints, movies management, database interactions, user management, and more. It was designed using the **Model-View-Controller (MVC)** architecture. To run the Django service, follow these steps:
1. Navigate to the `django_backend` directory:
```bash
Expand Down Expand Up @@ -227,10 +241,44 @@ If you go to `http://127.0.0.1:8000/admin/` in your browser, you should see te f
<img src="../images/Administration-UI.png" alt="The MovieVerse Backend Admin Interface" width="100%" height="auto" style="border-radius: 10px"/>
</p>
This is the Django admin interface for the backend of MovieVerse. It allows you to manage users, movies, reviews, and more.
This is the Django admin interface for the backend of MovieVerse. It allows you (the admin and other authorized users) to manage users, movies, reviews, and more in the databases.
For example, if you click on `Movies`, you should see the following interface, which allows you to manage movies in the database:
<p align="center" style="cursor: pointer">
<img src="../images/Movies-UI.png" alt="The MovieVerse Movies Interface" width="100%" height="auto" style="border-radius: 10px"/>
</p>
Note that the UI that you see when you go to `http://127.0.0.1:8000/` in your browser is only a template and does not represent the actual UI of the MovieVerse app. The actual UI is built using React and Vue and can be found in the [MovieVerse-Frontend](../MovieVerse-Frontend) directory.
**Important**: There has been a known Django bug where the admin interface' CSS styles are not loaded properly. If you encounter this issue, you can fix it by:

1. Set the `STATIC_ROOT` variable in the `settings.py` file to the path of the `static` directory in the `django_backend` directory:

```python
import os
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
```

2. Set the `STATIC_URL` variable in the `settings.py` file to the path of the `static` directory in the `django_backend` directory:

```python
STATIC_URL = '/static/'
```

3. Run the following command to collect the static files:

```bash
python manage.py collectstatic
```

If the issue is still not fixed, contact me at [[email protected]](mailto:[email protected]) so that I can take a look at your situation.

#### API Service

The API service is responsible for handling API requests from the frontend of MovieVerse. To get started with the API service, follow the steps outlined in this [README.md](databases/README.md#rest-apis) file.

#### Flask Service

The Flask service is responsible for handling basic backend functionalities of MovieVerse. To run the Flask service, follow these steps:
Expand Down
2 changes: 1 addition & 1 deletion MovieVerse-Backend/django_backend/movieverse/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __str__(self):
class Movie(models.Model):
_id = models.ObjectIdField()
movieId = models.IntegerField(unique=True)
title = models.CharField(max_length=255)
title = models.CharField(max_length=255, db_column='title')
overview = models.TextField(null=True, blank=True)
releaseDate = models.DateField(null=True, blank=True)
runtime = models.IntegerField(null=True, blank=True)
Expand Down
Loading

0 comments on commit 5118058

Please sign in to comment.