This is a JavaScript project that uses Prisma to interact with a database. The project analyzes movie data from CSV files.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Node.js
- pnpm
- Clone the repository:
git clone <repository-url>
- Navigate to the project directory:
cd <project-directory>
- Install the dependencies:
pnpm install
Create a .env
file in the project directory and add the following environment variables:
DATABASE_URL=<database-url>
The main script is index.js
. It contains several functions for analyzing movie data, such as topMoviesByDuration
, topMoviesByYear
, and topMoviesByRating
. These functions are currently commented out.
To use these functions, uncomment them in getSolutions
and run the script:
pnpm run start
The movie data is stored in CSV files in the data
directory:
- movies.csv
- ratings.csv
The PostgreSQL database of this project is currently hosted on render and its schema is defined in prisma/schema.prisma
.
Database migrations are stored in the prisma/migrations
directory.
- Prisma - Next-generation Node.js and TypeScript ORM for PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite.