The Movie Recommendation App is a web application built with Next.js that allows users to browse trending movies, receive personalized recommendations, and save their favorite movies. The app integrates with external movie APIs to fetch real-time data and provides an engaging user experience.
- Technical Stack
- Running the App Locally
- Architecture Overview
- Feature Breakdown
- Development Timeline
- API Integration Guide
- Component Structure
- Testing Strategy
- Deployment Plan
- Next.js: Server-side rendering and dynamic routing
- TypeScript: Type safety and maintainability
- Styled Components: Styling and theming
- React Query: API data fetching, caching, and state management
- Framer Motion: Animations and transitions
- Jest & React Testing Library: Unit and integration testing
- ESLint & Prettier: Code quality and formatting
- Node.js (v18 or higher)
- npm or yarn
-
Clone the repository:
git clone https://github.com/Donald-Edinam/sankofa-flix.git cd sankofa-flix -
Install dependencies:
npm install
-
Set up the environment variables:
-
Create a
.envfile in the root directory of the project. -
Add the following environment variable:
NEXT_PUBLIC_API_BASE_URL=http://localhost:8000/api
-
-
Run the development server:
npm run dev
-
Open the app in your browser:
- Navigate to
http://localhost:3000
- Navigate to
-
Build for production (optional):
npm run build npm start
The application follows a modular architecture with clear separation of concerns:
/app
/api # API route handlers
/components # Reusable UI components
/ui # Basic UI elements
/layout # Layout components
/movie # Movie-specific components
/contexts # React contexts for state management
/hooks # Custom hooks
/lib # Utility functions and API clients
/pages # Page components and routes
/public # Static assets
/styles # Global styles and theme configurations
/types # TypeScript type definitions
- Components:
MovieCard,TrendingSection,RecommendationSection - Features: Fetch trending movies, infinite scrolling for recommendations, skeleton loaders
- Components:
MovieHeader,MovieDetails,RelatedMovies - Features: Dynamic routing, server-side rendering, SEO optimization
- Components:
FavoriteButton,FavoritesPage - Features: Save/remove favorites, local storage persistence, backend API integration
- Components:
SearchBar,SearchResults - Features: Debounced search, API handler, filtering by genre, release year
- Day 1-2: Setup Next.js, API integration, folder structure
- Day 3-4: Implement Movie Dashboard UI, trending movies section
- Day 5-6: Create dynamic movie details pages
- Day 7: Code review, refactor, document API integration
- Day 8-9: Implement favorites management
- Day 10-11: Build search functionality, animations
- Day 12-13: Testing and optimization
- Day 14: Documentation and deployment
- Implement auth context for user sessions
- Create interceptors for API requests
/api/movies/trending- Fetch trending movies/api/movies/recommended- Get recommendations/api/movies/{id}- Fetch movie details/api/user/favorites- Manage user favorites/api/search- Search functionality
- Global error utility
- Retry logic for failed requests
- User-friendly error messages
- Use The Movie Database (TMDB) API
- Service layer for API calls
- Implement caching to reduce API calls
interface MovieCardProps {
movie: Movie;
variant: 'poster' | 'horizontal' | 'detailed';
onFavoriteToggle: (id: string) => void;
isFavorite: boolean;
}interface MovieGridProps {
movies: Movie[];
loading: boolean;
error?: string;
onLoadMore?: () => void;
hasMore?: boolean;
}interface FavoriteButtonProps {
movieId: string;
isFavorite: boolean;
onToggle: (id: string) => void;
}- Test components in isolation
- Mock API responses
- Verify behavior with different props
- Test interactions between components
- Verify context and API usage
- Simulate user journeys
- Ensure core functionality and responsiveness
- Run final tests
- Verify API endpoints
- Optimize assets for production
- Build for production
- Deploy to Vercel/Netlify
- Configure environment variables
- Monitor errors and performance
- Validate all features in production
Sections: Header, Hero Banner, Trending Movies, Recommendations, Categories, Footer
Key Components: <Navbar />, <SearchBar />, <HeroBanner />, <MovieCarousel />, <MovieGrid />
Sections: Movie Hero, Overview, Cast, Media, Reviews, Similar Movies
Key Components: <MovieBackdrop />, <MovieInfo />, <RatingDisplay />, <CastCarousel />
Sections: Favorites Hero, Empty State, Favorites Grid
Key Components: <FavoritesGrid />, <FavoriteMovieCard />, <SortDropdown />
Sections: Search Input, Search Results
Key Components: <SearchBar />, <SearchResults />, <GenreFilter />
The Movie Recommendation App is designed for an engaging and seamless user experience, utilizing Next.js for performance optimization, React Query for state management, and TMDB API for real-time data. The structured development approach ensures maintainability and scalability.
- Implement user authentication for personalized recommendations
- Add watchlist feature for users
- Improve AI-based recommendations using machine learning
- Implement progressive web app (PWA) features for offline access