A modern React-based anime gallery application with cart functionality, user authentication, and download management.
- Anime Gallery: Browse and view anime cards with beautiful animations
- Shopping Cart: Add anime images to your cart for later download
- Image Download: Download your favorite anime images
- User Authentication: Firebase email link authentication
- Responsive Design: Fully responsive UI with Tailwind CSS
- Smooth Animations: Powered by Framer Motion and GSAP
- First Download Free: Users can download one image without logging in
- Login Required: Subsequent downloads require user authentication
- Auto-redirect: After login, users are automatically redirected back to complete their download
- Frontend Framework: React 18 with TypeScript
- Routing: React Router DOM
- State Management: Redux Toolkit
- Styling: Tailwind CSS
- Animations:
- Framer Motion
- GSAP with ScrollTrigger
- Authentication: Firebase Auth (Email Link)
- Build Tool: Vite
src/
├── app/
│ └── hooks.ts # Redux hooks
├── components/
│ └── LoginCard.tsx # Login modal component
├── features/
│ └── cart/
│ └── cartSlice.ts # Cart state management
├── pages/
│ ├── Intro.tsx # Landing page
│ ├── HomePage.tsx # Main home page
│ ├── Cart.tsx # Cart page with download functionality
│ ├── AnimeGallery.tsx # Gallery view
│ └── Layout.tsx # App layout wrapper
├── utils/
├── firebase.ts # Firebase configuration
└── App.tsx # Main app component
- Clone the repository:
git clone <repository-url>
cd <project-name>- Install dependencies:
npm install-
Set up Firebase:
- Create a Firebase project at Firebase Console
- Enable Email/Password authentication
- Copy your Firebase config to
src/firebase.ts
-
Start the development server:
npm run dev- Navigate to the anime gallery
- Click on an anime card to add it to your cart
- View your cart by clicking the cart icon
- Go to your cart
- Click the "Download" button on any image
- First download: Image downloads immediately
- Second download: Login modal appears
- Complete login via email link
- Download proceeds automatically after login
- Click login when prompted
- Enter your email address
- Check your email for the magic link
- Click the link to complete authentication
- You'll be redirected back to complete your action
Manages the shopping cart with the following features:
- Display cart items
- Remove items from cart
- Download images with authentication check
- Persist download state using localStorage
- Handle post-login redirects
Main application component that:
- Handles Firebase email link authentication
- Manages routing
- Processes redirect parameters after login
Create a .env file in the root directory:
VITE_FIREBASE_API_KEY=your_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_auth_domain
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_storage_bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id# Development
npm run dev
# Build
npm run build
# Preview production build
npm run preview
# Lint
npm run lintThe application uses localStorage to track if a user has downloaded an image:
-
First Download:
- No authentication required
- Sets
hasDownloadedOnceflag in localStorage - Image downloads immediately
-
Subsequent Downloads:
- Checks for
hasDownloadedOnceflag - If flag exists and user is not authenticated → shows login
- After login → redirects back with download parameters
- Download proceeds automatically
- Checks for
- Add favorites functionality
- Implement image sharing
- Add user profile page
- Include download history
- Add image categories and filters
- Implement search functionality
- Fork the repository
- Create your 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 licensed under the MIT License.
- Anime artwork from various sources
- Firebase for authentication
- Framer Motion for smooth animations
- Tailwind CSS for styling