A Netflix-inspired movie discovery platform built with Next.js and Flask, allowing users to browse and search movies by genres, languages, and countries.
- Browse movies by genres, languages, and countries
- Search functionality with multiple filters
- Dynamic movie poster loading
- Video trailer playback in hero section
- Responsive design
- Rating-based movie sorting
- Horizontal scrolling movie rows
- Framework: Next.js (v14)
- Styling: Tailwind CSS
- Icons: Lucide Icons
- Language: TypeScript
- Framework: Flask
- Data Handling: Pandas
- API Integration: TMDb API (for movie posters)
- Node.js: Version 18 or higher
- Python: Version 3.8 or higher
- Pip: Python package manager for backend dependencies
```bash git clone cd movieflex ```
```bash npm install ```
```bash cd backend pip install flask flask-cors pandas requests ```
Create a `.env.local` file in the project root and add the following: ```bash NEXT_PUBLIC_API_URL=http://localhost:5000/api ```
Open `backend/crawl.py` and replace the `API_KEY` value with your TMDb API key.
```bash mkdir -p movieflex/backend/posters mkdir -p movieflex/public/videos ```
Copy your movie database file to the backend folder: ```bash cp path/to/your/imdb_movies-1.csv movieflex/backend/ ```
Copy your hero trailer video to the public folder: ```bash cp path/to/your/trailer.mp4 movieflex/public/videos/hero-trailer.mp4 ```
```bash cd backend python app.py ``` The backend will run on `http://localhost:5000\`.
Open a new terminal: ```bash cd movieflex npm run dev ``` The frontend will run on `http://localhost:3000\`.
-
API Connection Issues
- Verify Flask server is running on port 5000.
- Check CORS settings in `backend/app.py`.
- Confirm `NEXT_PUBLIC_API_URL` is correctly set in the frontend.
- Test health endpoint: `http://localhost:5000/api/health\`.
-
Database Issues
- Ensure the database file exists and is readable.
- Check file permissions.
- Validate the setup using `check_environment.py`.
- Confirm CSV file format.
-
Video Playback Issues
- Verify the video file exists in `public/videos`.
- Use MP4 format for compatibility.
- Check browser console for media-related errors.
-
Poster Loading Issues
- Ensure the TMDb API key is valid.
- Verify network connectivity.
- Confirm the `posters` directory exists and is writable.
- `GET /api/health` - Check API health status
- `GET /api/search` - Search movies with filters
- `GET /api/genres` - Retrieve all genres
- `GET /api/languages` - Retrieve all languages
- `GET /api/countries` - Retrieve all countries
- `GET /api/movies/top-rated` - Fetch top-rated movies
- `GET /api/movies/by-genre/` - Fetch movies by genre
- `GET /api/poster/<movie_title>` - Fetch a movie poster
-
Run the environment check script: ```bash chmod +x scripts/check-env.sh ./scripts/check-env.sh ```
-
Set proper permissions: ```bash chmod -R 755 backend/posters ```
- Add Python to the system `PATH`.
- Use proper path separators (`\`) in configuration files.
- Run Flask with `python app.py`.