Assignment for the 2023 edition of the "Web Development and the Semantic Web" course, by Andre Guimaraes Barros, Bruno Santos Fernandes and Renan Campista
This project utilizes React with Vite and Node.js with MySQL and requires specific extensions and dependencies to function properly.
Make sure to have the following extensions installed:
- Node.js - Runtime environment for JavaScript.
- Vite - A build tool for modern frontend projects with React.
- VS Code (recommended) - A popular code editor with extension support for easier development.
Before getting started, install the following dependencies using npm or yarn:
Running the Backend
-
With a terminal, navigate to the server folder and run the following commands:
npm install prisma
-
Copy the
.env.example
file to a new file called.env
:cp .env.example .env
-
Open the
.env
file and fill in the environment variables with their values. For the server, configure the variables below:DATABASE_URL="your_database_url" KEY="your_jwt_secret" USER_NAME="your_email_to_recover_password" USER_PASSWORD="your_password_to_recover_password"
-
Run the following command to create the database schema:
npx prisma db push
-
Run the following command to start the server:
npm start
Running the Frontend
-
With a terminal, navigate to the client folder and run the following commands:
npm install
-
Run the following command to start the client:
npm run dev
-
Open your browser and navigate to http://localhost:5173/ to see the application running.
The project includes a data collector script to populate the database with movies. To run the script, follow the steps below:
-
Open the .env file in the server folder and fill in the environment variables with their values. For the data collector, configure the variables below:
OMDb_API_KEY="your_api_key" TMDB_API_KEY="your_api_key"
-
To get the API keys, create an account on the OMDb API and The Movie Database API.
-
Run the following command to start the data collector:
npm codar_movies
- This script does not automatically upload movies to the database. It only collects the data and saves it to a JSON file.
- Sending to the database is performed when starting the server.
- It is not necessary to run this script to run the web application. A file with film data to be inserted into the database has already been made available along with this project.
- More information about the itinerary can be accessed by clicking here
Ensure you have the environment properly set up and database configurations to make the application work as expected.
Happy coding!