For the impatient, the curious, and the malicious... get the spoilers before the movie even starts!
Spoilerator is a web application that provides movie spoilers before the movie even starts. It uses TMDB API to fetch movie data and MISTRAL AI API to generate spoilers.
- React
- TypeScript
- Vite
- Mistral AI API
- TMDB API
- Node.js (v14 or later)
- npm (v6 or later)
-
Clone the repository:
git clone https://github.com/born3am/spoilerator.git
-
Navigate to the project directory:
cd spoilerator
-
Install the dependencies:
npm install
To run the project locally, use the following command:
npm run dev
This will start the development server, and you can access the application at http://localhost:5173
.
-
Install the Vercel CLI:
npm install -g vercel
-
Log in to Vercel:
vercel login
-
Deploy the Project:
vercel
-
Update the Deployment: If you want to update an existing deployment, use the
--prod
flag:vercel --prod
-
Verify the Deployment: After the deployment is complete, you can verify it by visiting the provided URL.
- Set Up Environment Variables
a) Locally (.env
for Development Only)
Create a .env
file in your project root and add:
MISTRAL_API_KEY=your_mistral_api_key
TMDB_API_KEY=your_tmdb_api_keyy
b) On Vercel (For Production & Deployment)
Go to Vercel Dashboard → Your Project → Settings → Environment Variables.
Add the following keys manually: MISTRAL_API_KEY → your_mistral_api_key TMDB_API_KEY → your_tmdb_api_key Redeploy the project for changes to take effect.
- Vercel Environment Variables*
To view the environment variables set up on Vercel, you can use the following command:
vercel env ls
- Create Serverless Functions: Vercel automatically detects API routes inside the /api/ directory. Your project structure should look like this: /api ├── mistral.js # Handles requests to the Mistral AI API ├── tmdb.js # Fetches data from The Movie DB API
Important: Do not use VITE_* prefixes for backend variables, as they expose them to the frontend.
- Deploy the Functions: Run the following command to deploy your serverless functions:
vercel
- Verify the Deployment: After the deployment is complete, you can verify it by visiting the provided URL and testing the serverless functions.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.