A responsive single-page application (SPA) built with Angular that provides users with access to information about different movies, directors, and genres. Users can sign up, update their personal information, and create a list of their favorite movies.
This Angular client-side application interfaces with the myFlix REST API to provide a complete movie database experience. The app is built using Angular 19 with TypeScript and follows modern Angular best practices.
- User Registration: New users can sign up with username, password, email, and birthday
- User Authentication: Secure login/logout functionality with JWT token authentication
- Profile Management: Users can view and update their profile information
- Account Deletion: Users can delete their account
- Browse Movies: View all available movies in the database
- Movie Details: Get detailed information about individual movies
- Director Information: Learn about movie directors and their filmography
- Genre Information: Explore different movie genres and their characteristics
- Add to Favorites: Users can add movies to their personal favorites list
- Remove from Favorites: Remove movies from the favorites list
- View Favorites: Display all favorited movies in one place
- Framework: Angular 19.2.0
- Language: TypeScript 5.7.2
- HTTP Client: Angular HttpClient with RxJS
- Styling: SCSS
- State Management: Local Storage for user session
- Authentication: JWT Token-based authentication
The application integrates with a REST API that provides the following endpoints:
POST /users- User registrationPOST /login- User loginGET /users/{username}- Get user detailsPUT /users/{username}- Update user informationDELETE /users/{username}- Delete user account
GET /movies- Get all moviesGET /movies/{title}- Get specific movie detailsGET /movies/director/{name}- Get director informationGET /movies/genre/{name}- Get genre information
POST /users/{username}/movies/{movieId}- Add movie to favoritesDELETE /users/{username}/movies/{movieId}- Remove movie from favorites
- Node.js (v18 or higher)
- npm (v8 or higher)
- Angular CLI (v19.2.19)
- Clone the repository:
git clone https://github.com/yourusername/myFlix-Angular-client.git
cd myFlix-Angular-client- Install dependencies:
npm install- Start the development server:
ng serve- Open your browser and navigate to
http://localhost:4200/
To build the project for production:
ng build --prodThe build artifacts will be stored in the dist/ directory.
This project is configured for deployment to GitHub Pages using the docs/ directory:
- Build for GitHub Pages:
ng build --configuration production --base-href "/MyFlix-Angular-Client/"- Copy build to docs directory:
cp -r dist/myflix-angular-client/* docs/- Commit and push:
git add docs/
git commit -m "Deploy to GitHub Pages"
git push origin main- Configure GitHub Pages:
- Go to your repository settings on GitHub
- Navigate to Pages section
- Set source to "Deploy from a branch"
- Select "main" branch and "/docs" folder
- Save settings
The docs/ directory contains the production build of the application and serves as the source for GitHub Pages hosting. This allows the application to be publicly accessible at your GitHub Pages URL.
Live Demo: View the deployed application
Generate a new component:
ng generate component component-nameGenerate a new service:
ng generate service service-nameFor more scaffolding options:
ng generate --helpExecute unit tests:
ng testsrc/
├── app/
│ ├── fetch-api-data.service.ts # API service for all HTTP requests
│ ├── app.component.* # Root component
│ ├── app.config.ts # Application configuration
│ └── app.routes.ts # Application routing
├── index.html # Main HTML file
├── main.ts # Application bootstrap
└── styles.scss # Global styles
docs/ # GitHub Pages deployment directory
├── index.csr.html # Production build entry point
├── main-*.js # Bundled application code
├── styles-*.css # Compiled styles
└── */ # Route-specific assets
dist/ # Local build output directory
The FetchApiDataService handles all communication with the backend API. It includes:
- Authentication Management: Token-based authentication with automatic header injection
- Error Handling: Comprehensive error handling for all HTTP requests
- Response Processing: Data extraction and transformation
- Local Storage Integration: Automatic user session management
userRegistration(userDetails)- Register new useruserLogin(userDetails)- Authenticate usergetAllMovies()- Fetch all moviesgetOneMovie(title)- Get specific moviegetDirector(name)- Get director informationgetGenre(name)- Get genre informationaddFavouriteMovie(movieId)- Add to favoritesdeleteFavouriteMovie(movieId)- Remove from favoriteseditUser(userData)- Update user profiledeleteUser()- Delete user account
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is part of the CareerFoundry Full-Stack Web Development Program.
- GitHub: @yourusername
- Email: your.email@example.com
- Built as part of the CareerFoundry Full-Stack Web Development Program
- Uses the myFlix REST API backend
- Angular framework and community for excellent documentation and tools