🇮🇹 Versione Italiana | 🇬🇧 English Version
Un'applicazione full-stack per l'esplorazione di film costruita con React, Redux, Node.js, Express e PostgreSQL. Sono state implementate, tra le altre, le seguenti pratiche di sviluppo: gestione dello stato, API RESTful, autenticazione e containerizzazione Docker.
- 🔐 Autenticazione Utente - Registrazione e login con token JWT
- 🎥 Navigazione Film - Esplora film popolari e di tendenza dall'API TMDB
- 🔍 Ricerca - Trova film per titolo
- 📄 Dettagli Film - Visualizza informazioni dettagliate, cast e valutazioni
- ⭐ Preferiti - Salva i tuoi film preferiti (persistenti in PostgreSQL)
- ✍️ Recensioni e Valutazioni - Scrivi recensioni e valuta i film (1-5 stelle)
- 🌙 Modalità Scura - Alterna tra tema chiaro e scuro
- 🎨 Design Responsive - Funziona perfettamente su desktop e mobile
- Redux Toolkit per la gestione dello stato (auth, movies, favorites, reviews, UI)
- Gestione Errori - Gestione completa degli errori su frontend e backend
- Testing - Test unitari e di integrazione con Jest e React Testing Library
- Docker - Containerizzazione del database PostgreSQL
- SQL Puro - Query SQL dirette per le operazioni sul database
- Tailwind CSS - Styling moderno utility-first
Prima di iniziare, assicurati di avere installato:
- Node.js (v16 o superiore)
- npm o yarn
- Docker e Docker Compose
- Git
git clone https://github.com/your-username/movies-explorer.git
cd movies-explorer- Vai al Sito TMDB
- Crea un account gratuito e verifica la tua email
- Vai su Impostazioni → API → Richiedi Chiave API
- Scegli l'opzione "Developer"
- Compila le informazioni richieste
- Copia la tua Chiave API (v3 auth)
cd server
cp .env.example .envModifica server/.env e aggiungi la tua configurazione:
# TMDB API
TMDB_API_KEY=your_tmdb_api_key_here
TMDB_BASE_URL=https://api.themoviedb.org/3
# Database
DB_USER=postgres
DB_PASSWORD=postgres123
DB_HOST=localhost
DB_PORT=5432
DB_NAME=movies_explorer
# JWT
JWT_SECRET=your_super_secret_jwt_key_change_this_in_production
JWT_EXPIRES_IN=7d
# Server
PORT=5000
NODE_ENV=developmentcd ../client
cp .env.example .envModifica client/.env:
VITE_API_URL=http://localhost:5000/apiDalla directory root:
docker-compose up -dQuesto avvierà un container PostgreSQL e inizializzerà automaticamente lo schema del database.
Verifica che il database sia in esecuzione:
docker pscd server
npm installcd ../client
npm installcd server
npm run devIl backend sarà in esecuzione su http://localhost:5000
cd client
npm run devIl frontend sarà in esecuzione su http://localhost:5173
Apri il tuo browser e vai su:
http://localhost:5173
cd server
npm testcd client
npm test# Backend
cd server
npm run test:coverage
# Frontend
cd client
npm run test:coveragemovies-explorer/
├── client/ # Frontend React
│ ├── public/ # Asset statici
│ ├── src/
│ │ ├── components/ # Componenti React
│ │ │ ├── auth/ # Login, Register
│ │ │ ├── common/ # Componenti riutilizzabili (Button, Card, etc.)
│ │ │ ├── layout/ # Header, Footer, Sidebar
│ │ │ └── movies/ # Componenti relativi ai film
│ │ ├── pages/ # Componenti pagina
│ │ ├── store/ # Store Redux
│ │ │ ├── slices/ # Slice Redux (auth, movies, etc.)
│ │ │ └── middleware/ # Middleware Redux personalizzato
│ │ ├── services/ # Layer di servizio API
│ │ ├── hooks/ # Hook React personalizzati
│ │ ├── utils/ # Funzioni di utilità
│ │ │ └── errors/ # Utilità gestione errori
│ │ └── constants/ # Costanti e configurazione
│ ├── __tests__/ # File di test
│ └── package.json
│
├── server/ # Backend Node.js
│ ├── src/
│ │ ├── config/ # File di configurazione
│ │ ├── controllers/ # Controller delle route
│ │ ├── middleware/ # Middleware Express
│ │ ├── models/ # Modelli database (query SQL)
│ │ ├── routes/ # Route API
│ │ ├── services/ # Logica di business
│ │ ├── utils/ # Funzioni di utilità
│ │ │ └── errors/ # Classi e handler errori
│ │ └── server.js # Entry point app Express
│ ├── db/ # File database
│ │ └── init.sql # Script inizializzazione database
│ ├── __tests__/ # File di test
│ └── package.json
│
├── docker-compose.yml # Configurazione Docker
├── .gitignore
└── README.md
POST /api/auth/register- Registra nuovo utentePOST /api/auth/login- Login utenteGET /api/auth/me- Ottieni utente corrente (protetto)
GET /api/movies/popular- Ottieni film popolariGET /api/movies/search?query=- Cerca filmGET /api/movies/:id- Ottieni dettagli film
GET /api/favorites- Ottieni preferiti utente (protetto)POST /api/favorites- Aggiungi ai preferiti (protetto)DELETE /api/favorites/:movieId- Rimuovi dai preferiti (protetto)
GET /api/reviews/user- Ottieni recensioni utente (protetto)GET /api/reviews/movie/:movieId- Ottieni recensioni per un filmPOST /api/reviews- Crea recensione (protetto)PUT /api/reviews/:id- Aggiorna recensione (protetto)DELETE /api/reviews/:id- Elimina recensione (protetto)
- React 18 - Libreria UI
- Redux Toolkit - Gestione dello stato
- React Router - Routing
- Axios - Client HTTP
- Tailwind CSS - Styling
- Vite - Build tool
- Jest & React Testing Library - Testing
- Node.js - Runtime
- Express - Framework web
- PostgreSQL - Database
- pg - Client PostgreSQL
- JWT - Autenticazione
- bcrypt - Hashing password
- Jest & Supertest - Testing
- Docker - Containerizzazione
- Docker Compose - Orchestrazione multi-container
I contributi sono benvenuti! Sentiti libero di inviare una Pull Request.
Questo progetto è open source e disponibile sotto la Licenza MIT.
- GitHub: @giancarminesantoro
- TMDB per l'API gratuita dei film
- Tailwind CSS per il framework di styling
- Redux Toolkit per la gestione dello stato
⭐ Se hai trovato questo progetto utile, considera di dargli una stella!
A full-stack movie exploration application built with React, Redux, Node.js, Express, and PostgreSQL. This project demonstrates modern web development practices including state management, RESTful APIs, authentication, and Docker containerization.
- 🔐 User Authentication - Register, login with JWT tokens
- 🎥 Movie Browsing - Explore popular and trending movies from TMDB API
- 🔍 Search - Find movies by title
- 📄 Movie Details - View detailed information, cast, and ratings
- ⭐ Favorites - Save your favorite movies (persisted in PostgreSQL)
- ✍️ Reviews & Ratings - Write reviews and rate movies (1-5 stars)
- 🌙 Dark Mode - Toggle between light and dark themes
- 🎨 Responsive Design - Works seamlessly on desktop and mobile
- Redux Toolkit for state management (auth, movies, favorites, reviews, UI)
- Error Handling - Comprehensive error handling on frontend and backend
- Testing - Unit and integration tests with Jest and React Testing Library
- Docker - PostgreSQL database containerization
- Raw SQL - Direct SQL queries for database operations
- Tailwind CSS - Modern utility-first styling
Before you begin, ensure you have the following installed:
- Node.js (v16 or higher)
- npm or yarn
- Docker and Docker Compose
- Git
git clone https://github.com/your-username/movies-explorer.git
cd movies-explorer- Go to TMDB Website
- Create a free account and verify your email
- Navigate to Settings → API → Request API Key
- Choose "Developer" option
- Fill in the required information
- Copy your API Key (v3 auth)
cd server
cp .env.example .envEdit server/.env and add your configuration:
# TMDB API
TMDB_API_KEY=your_tmdb_api_key_here
TMDB_BASE_URL=https://api.themoviedb.org/3
# Database
DB_USER=postgres
DB_PASSWORD=postgres123
DB_HOST=localhost
DB_PORT=5432
DB_NAME=movies_explorer
# JWT
JWT_SECRET=your_super_secret_jwt_key_change_this_in_production
JWT_EXPIRES_IN=7d
# Server
PORT=5000
NODE_ENV=developmentcd ../client
cp .env.example .envEdit client/.env:
VITE_API_URL=http://localhost:5000/apiFrom the root directory:
docker-compose up -dThis will start a PostgreSQL container and automatically initialize the database schema.
Verify the database is running:
docker pscd server
npm installcd ../client
npm installcd server
npm run devBackend will run on http://localhost:5000
cd client
npm run devFrontend will run on http://localhost:5173
Open your browser and navigate to:
http://localhost:5173
cd server
npm testcd client
npm test# Backend
cd server
npm run test:coverage
# Frontend
cd client
npm run test:coveragemovies-explorer/
├── client/ # React Frontend
│ ├── public/ # Static assets
│ ├── src/
│ │ ├── components/ # React components
│ │ │ ├── auth/ # Login, Register
│ │ │ ├── common/ # Reusable components (Button, Card, etc.)
│ │ │ ├── layout/ # Header, Footer, Sidebar
│ │ │ └── movies/ # Movie-related components
│ │ ├── pages/ # Page components
│ │ ├── store/ # Redux store
│ │ │ ├── slices/ # Redux slices (auth, movies, etc.)
│ │ │ └── middleware/ # Custom Redux middleware
│ │ ├── services/ # API service layer
│ │ ├── hooks/ # Custom React hooks
│ │ ├── utils/ # Utility functions
│ │ │ └── errors/ # Error handling utilities
│ │ └── constants/ # Constants and configuration
│ ├── __tests__/ # Test files
│ └── package.json
│
├── server/ # Node.js Backend
│ ├── src/
│ │ ├── config/ # Configuration files
│ │ ├── controllers/ # Route controllers
│ │ ├── middleware/ # Express middleware
│ │ ├── models/ # Database models (SQL queries)
│ │ ├── routes/ # API routes
│ │ ├── services/ # Business logic
│ │ ├── utils/ # Utility functions
│ │ │ └── errors/ # Error classes and handlers
│ │ └── server.js # Express app entry point
│ ├── db/ # Database files
│ │ └── init.sql # Database initialization script
│ ├── __tests__/ # Test files
│ └── package.json
│
├── docker-compose.yml # Docker configuration
├── .gitignore
└── README.md
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current user (protected)
GET /api/movies/popular- Get popular moviesGET /api/movies/search?query=- Search moviesGET /api/movies/:id- Get movie details
GET /api/favorites- Get user's favorites (protected)POST /api/favorites- Add to favorites (protected)DELETE /api/favorites/:movieId- Remove from favorites (protected)
GET /api/reviews/user- Get user's reviews (protected)GET /api/reviews/movie/:movieId- Get reviews for a moviePOST /api/reviews- Create review (protected)PUT /api/reviews/:id- Update review (protected)DELETE /api/reviews/:id- Delete review (protected)
- React 18 - UI library
- Redux Toolkit - State management
- React Router - Routing
- Axios - HTTP client
- Tailwind CSS - Styling
- Vite - Build tool
- Jest & React Testing Library - Testing
- Node.js - Runtime
- Express - Web framework
- PostgreSQL - Database
- pg - PostgreSQL client
- JWT - Authentication
- bcrypt - Password hashing
- Jest & Supertest - Testing
- Docker - Containerization
- Docker Compose - Multi-container orchestration
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
- GitHub: @giancarminesantoro
- TMDB for the free movie API
- Tailwind CSS for the styling framework
- Redux Toolkit for state management
⭐ If you found this project helpful, please consider giving it a star!