Skip to main content

Prerequisites

Before installing ReactFlix, ensure your development environment meets these requirements:

Required Software

ReactFlix requires Node.js for running the development server and building the application.Check your version:
node --version
Install Node.js:
  • Download from nodejs.org
  • Use nvm (Node Version Manager): nvm install 18
  • Recommended: Node.js v18 LTS or higher
npm is the package manager for JavaScript and comes bundled with Node.js.Check your version:
npm --version
Update npm:
npm install -g npm@latest

System Requirements

  • Operating System: Windows 10+, macOS 10.14+, or Linux
  • RAM: Minimum 4GB (8GB recommended)
  • Disk Space: 500MB for node_modules and build files
  • Browser: Modern browser (Chrome 90+, Firefox 88+, Safari 14+, Edge 90+)

Installation Methods

Project Structure

After installation, your project directory will look like this:
streaming/
├── node_modules/           # Installed dependencies (auto-generated)
├── public/                 # Static assets
│   ├── favicon.ico
│   ├── index.html         # HTML template
│   ├── logo192.png
│   ├── logo512.png
│   ├── manifest.json      # PWA manifest
│   └── robots.txt
├── src/                   # Source code
│   ├── components/        # Reusable UI components
│   │   ├── AlquilerButton.jsx
│   │   ├── CategoryFilter.jsx
│   │   ├── CompraButton.jsx
│   │   ├── Footer.jsx
│   │   ├── Header.jsx
│   │   ├── LoadingSpinner.jsx
│   │   ├── PeliculaCard.jsx
│   │   ├── PeliculaGrid.jsx
│   │   ├── SearchBar.jsx
│   │   └── TrailerModal.jsx
│   ├── pages/             # Route-level components
│   │   ├── AlquileresPage.jsx
│   │   ├── ComprasPage.jsx
│   │   ├── PeliculaDetailPage.jsx
│   │   ├── PeliculasPage.jsx
│   │   └── PrincipalPage.jsx
│   ├── hooks/             # Custom React hooks
│   │   └── usePeliculaSearch.js
│   ├── data/              # Mock data and constants
│   │   └── mockPeliculas.js
│   ├── styles/            # CSS stylesheets
│   │   ├── App.css
│   │   ├── components.css
│   │   └── pages.css
│   ├── App.js             # Main application component
│   ├── App.test.js        # App tests
│   ├── index.js           # Application entry point
│   ├── index.css          # Global styles
│   ├── reportWebVitals.js # Performance monitoring
│   └── setupTests.js      # Test configuration
├── .gitignore
├── package.json           # Dependencies and scripts
├── package-lock.json      # Locked dependency versions
├── LICENSE
└── README.md

Configuration

Package.json Scripts

ReactFlix includes several npm scripts for different tasks:
package.json
{
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  }
}
npm start

# Starts development server
# Opens browser at http://localhost:3000
# Hot reloading enabled
# Shows lint errors in console

Environment Variables

Create a .env file in the root directory for custom configuration:
.env
# Server Port (default: 3000)
PORT=3000

# Browser auto-open (default: true)
BROWSER=true

# Enable HTTPS in development
HTTPS=false

# Advanced webpack config (if ejected)
GENERATE_SOURCEMAP=true
Environment variables must start with REACT_APP_ to be accessible in your code (except built-in variables like PORT).

Browser Support

ReactFlix is configured to support modern browsers:
package.json
{
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

Dependency Overview

Core Dependencies

The latest version of React with:
  • Improved concurrent rendering
  • Automatic batching
  • Enhanced Suspense support
  • New hooks and APIs
Client-side routing library providing:
  • Route definitions with <Routes> and <Route>
  • URL parameters (e.g., /pelicula/:id)
  • Navigation with <Link> components
  • Programmatic navigation with useNavigate
Zero-configuration build tooling including:
  • Webpack bundler
  • Babel transpiler
  • ESLint linter
  • Jest test runner
  • Development server

Testing Dependencies

@testing-library/react     # React component testing utilities
@testing-library/jest-dom  # Custom Jest matchers
@testing-library/dom       # DOM testing utilities
@testing-library/user-event # User interaction simulation

Development Dependencies

All development dependencies are managed by react-scripts and include:
  • Webpack - Module bundler
  • Babel - JavaScript transpiler
  • ESLint - Code linting
  • PostCSS - CSS processing
  • Jest - Testing framework

Verify Installation

1

Check Installation

Verify all dependencies are installed:
npm list --depth=0
You should see all packages from package.json listed.
2

Run Application

Start the development server:
npm start
Browser should open automatically to http://localhost:3000
3

Check Features

Verify these features work:
  • Homepage loads with featured movies
  • Navigation links work (Movies, Rentals, Purchases)
  • Search functionality on /peliculas
  • Movie detail pages load
  • Trailers play in modal
4

Run Tests

Ensure tests pass:
npm test -- --watchAll=false
All tests should pass without errors.

Troubleshooting

Common Installation Issues

Problem: Errors during npm installSolutions:
# Clear npm cache
npm cache clean --force

# Delete node_modules and reinstall
rm -rf node_modules package-lock.json
npm install

# Try using npm ci for clean install
npm ci
Problem: “Port 3000 is already in use”Solutions:
# Find and kill process on port 3000
# macOS/Linux:
lsof -ti:3000 | xargs kill -9

# Windows:
netstat -ano | findstr :3000
taskkill /PID <PID> /F

# Or use different port
PORT=3001 npm start
Problem: “Module not found: Can’t resolve…”Solutions:
# Ensure you're in the correct directory
pwd  # Should show path ending in /streaming

# Reinstall dependencies
npm install

# Check for typos in import statements
# Verify file paths are correct
Problem: Browser shows blank white pageSolutions:
  1. Open browser DevTools (F12)
  2. Check Console for errors
  3. Verify all files are present in src/
  4. Check that public/index.html exists
  5. Clear browser cache and hard reload (Ctrl+Shift+R)
# Reset and restart
rm -rf node_modules build
npm install
npm start
Problem: “The engine ‘node’ is incompatible”Solutions:
# Check your Node version
node --version

# Upgrade Node.js to v14+
# Using nvm:
nvm install 18
nvm use 18

# Then reinstall dependencies
npm install

Next Steps

Quick Start Guide

Learn the basics and build your first feature

Project Structure

Understand the codebase organization

Component Library

Explore all available components

Customization

Customize ReactFlix for your needs

Additional Resources

Useful Commands Reference

CommandDescription
npm installInstall all dependencies
npm startStart development server
npm testRun test suite
npm run buildCreate production build
npm listList installed packages
npm outdatedCheck for outdated packages
npm updateUpdate packages
npm auditCheck for security vulnerabilities
npm audit fixFix security vulnerabilities

Performance Tips

For faster installation:
  • Use npm ci instead of npm install in CI/CD environments
  • Consider using Yarn or pnpm for faster installs
  • Enable caching in your CI/CD pipeline

Build docs developers (and LLMs) love