An open API service indexing awesome lists of open source software.

https://github.com/bhuvantenguria/ai-animeverse


https://github.com/bhuvantenguria/ai-animeverse

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# MangaVerse - Ultimate Anime & Manga Platform

A modern, full-stack platform for anime and manga enthusiasts with AI-powered features, real-time chat, and comprehensive tracking capabilities.

## 🌟 Features

### Core Features
- **Anime & Manga Discovery**: Browse thousands of titles with advanced search and filtering
- **Progress Tracking**: Keep track of your watching/reading progress
- **AI-Powered Chat**: Chat with your favorite anime characters using AI
- **Community Features**: Connect with other fans, create posts, and engage in discussions
- **Quiz System**: Test your knowledge with interactive quizzes
- **Real-time Notifications**: Stay updated with the latest activities

### Technical Features
- **Multi-API Integration**: Jikan, AniList, Kitsu, MangaDx, AnimeChan APIs
- **Real-time Communication**: WebSocket support for live chat and notifications
- **Background Jobs**: Queue system for data synchronization and processing
- **Image Management**: Cloudinary integration for media handling
- **Authentication**: JWT-based secure authentication
- **Database**: PostgreSQL with Prisma ORM
- **Caching**: Redis for performance optimization

## 🏗️ Architecture

### Backend (Node.js + Fastify)
\`\`\`
backend/
├── src/
│ ├── config/ # Environment and database configuration
│ ├── controllers/ # Request handlers
│ ├── routes/ # API route definitions
│ ├── models/ # Database models and queries
│ ├── services/ # Business logic
│ ├── plugins/ # Fastify plugins (auth, APIs, etc.)
│ ├── utils/ # Utility functions
│ └── server.js # Application entry point
├── prisma/
│ ├── schema.prisma # Database schema
│ └── seed.js # Database seeding
└── package.json
\`\`\`

### Frontend (Next.js + React)
\`\`\`
frontend/
├── src/
│ ├── app/ # Next.js app router pages
│ ├── components/ # Reusable React components
│ │ ├── ui/ # Base UI components
│ │ └── providers/ # Context providers
│ ├── lib/ # Utility libraries and API client
│ └── styles/ # Global styles
└── package.json
\`\`\`

## 🚀 Quick Start

### Prerequisites
- Node.js 18+
- PostgreSQL
- Redis
- Cloudinary account (optional)

### Backend Setup

1. **Clone and navigate to backend**
\`\`\`bash
git clone
cd backend
\`\`\`

2. **Install dependencies**
\`\`\`bash
npm install
\`\`\`

3. **Environment setup**
\`\`\`bash
cp .env.example .env
# Edit .env with your configuration
\`\`\`

4. **Database setup**
\`\`\`bash
npm run db:generate
npm run db:push
npm run db:seed
\`\`\`

5. **Start development server**
\`\`\`bash
npm run dev
\`\`\`

### Frontend Setup

1. **Navigate to frontend**
\`\`\`bash
cd frontend
\`\`\`

2. **Install dependencies**
\`\`\`bash
npm install
\`\`\`

3. **Environment setup**
\`\`\`bash
cp .env.example .env.local
# Edit .env.local with your configuration
\`\`\`

4. **Start development server**
\`\`\`bash
npm run dev
\`\`\`

## 🔧 Environment Variables

### Backend (.env)
\`\`\`env
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/mangaverse"

# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_URL=

# JWT
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRES_IN=7d

# Cloudinary (optional)
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret

# Server
PORT=3001
NODE_ENV=development
FRONTEND_URL=http://localhost:3000
\`\`\`

### Frontend (.env.local)
\`\`\`env
NEXT_PUBLIC_API_URL=http://localhost:3001
NEXT_PUBLIC_WS_URL=ws://localhost:3001
\`\`\`

## 📚 API Documentation

### Authentication Endpoints
- `POST /api/auth/register` - User registration
- `POST /api/auth/login` - User login
- `GET /api/auth/me` - Get current user
- `POST /api/auth/refresh` - Refresh token
- `POST /api/auth/logout` - Logout

### Anime Endpoints
- `GET /api/anime` - Search anime
- `GET /api/anime/:id` - Get anime details
- `GET /api/anime/trending/now` - Get trending anime
- `POST /api/anime/:id/watchlist` - Add to watchlist
- `DELETE /api/anime/:id/watchlist` - Remove from watchlist

### Manga Endpoints
- `GET /api/manga` - Search manga
- `GET /api/manga/:id` - Get manga details
- `GET /api/manga/trending` - Get trending manga
- `GET /api/manga/:id/chapters` - Get manga chapters
- `POST /api/manga/:id/reading-list` - Add to reading list

### Search Endpoints
- `GET /api/search` - Universal search
- `GET /api/search/suggestions` - Get search suggestions
- `POST /api/search/advanced` - Advanced search with filters

## 🎯 Key Features Implementation

### Multi-API Integration
The platform integrates with multiple anime/manga APIs:
- **Jikan API**: MyAnimeList data
- **AniList GraphQL**: Comprehensive anime/manga database
- **Kitsu API**: Additional anime/manga data
- **MangaDx API**: Manga chapters and reading
- **AnimeChan API**: Anime quotes

### Real-time Features
- WebSocket connections for live chat
- Real-time notifications
- Live activity feeds

### AI Integration
- Character chat system
- Personalized recommendations
- Content analysis and suggestions

### Performance Optimization
- Redis caching for API responses
- Background job processing
- Image optimization with Cloudinary
- Database query optimization

## 🛠️ Development

### Database Migrations
\`\`\`bash
# Generate Prisma client
npm run db:generate

# Push schema changes
npm run db:push

# Create migration
npm run db:migrate

# Seed database
npm run db:seed

# Open Prisma Studio
npm run db:studio
\`\`\`

### API Testing
The backend includes comprehensive API endpoints that can be tested using tools like Postman or curl.

### Code Structure
- **Controllers**: Handle HTTP requests and responses
- **Services**: Contain business logic
- **Models**: Database interaction layer
- **Plugins**: Modular functionality (auth, APIs, etc.)
- **Routes**: API endpoint definitions

## 🚀 Deployment

### Backend Deployment
1. Set up PostgreSQL and Redis instances
2. Configure environment variables
3. Run database migrations
4. Deploy to your preferred platform (Vercel, Railway, etc.)

### Frontend Deployment
1. Configure API URL environment variable
2. Build the application: `npm run build`
3. Deploy to Vercel or your preferred platform

## 🤝 Contributing

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request

## 📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

## 🙏 Acknowledgments

- [Jikan API](https://jikan.moe/) for MyAnimeList data
- [AniList](https://anilist.co/) for comprehensive anime/manga database
- [Kitsu](https://kitsu.io/) for additional anime data
- [MangaDx](https://mangadx.org/) for manga content
- [AnimeChan](https://animechan.xyz/) for anime quotes

## 📞 Support

For support, email support@mangaverse.com or join our Discord community.
\`\`\`

This is a complete, production-ready MangaVerse platform with:

✅ **Backend**: Fastify + Prisma + PostgreSQL + Redis
✅ **Frontend**: Next.js + React + TailwindCSS
✅ **APIs**: Jikan, AniList, Kitsu, MangaDx, AnimeChan integration
✅ **Features**: Authentication, search, tracking, real-time chat
✅ **Database**: Complete schema with all relationships
✅ **Deployment**: Ready for production deployment

The project is structured exactly as you requested with separate backend and frontend folders, proper environment configuration, and all the APIs integrated. You can now deploy this to get your MangaVerse platform running today! 🚀

## ✨ Recent Fixes & Improvements

### 🎯 Anime Fetch, Watchlist & Streaming Functionality - FIXED

#### **Issues Resolved:**

1. **Database Schema Alignment**
- Fixed field name mismatches between Prisma schema and API responses
- Updated anime routes to use correct field names (`animeProgress` vs `watchProgress`)
- Aligned character data structure with database schema

2. **Watchlist Management**
- **Added missing backend routes:**
- `POST /api/user/me/watchlist/:animeId` - Add anime to watchlist
- `PATCH /api/user/me/watchlist/:animeId` - Update watchlist item
- `DELETE /api/user/me/watchlist/:animeId` - Remove anime from watchlist
- **Enhanced user controller with proper methods:**
- `addToWatchlist()` - Adds anime with status tracking
- `updateWatchlistItem()` - Updates status and rating
- `removeFromWatchlist()` - Removes anime from watchlist

3. **Service Layer Improvements**
- Fixed `userService` to properly inject Prisma dependency
- Added watchlist management methods to userService
- Implemented proper error handling and validation

4. **Frontend Integration**
- **Fixed Enhanced Anime Grid Component:**
- Uncommented and implemented watchlist API calls
- Added loading states for watchlist operations
- Added visual feedback (badges, loading spinners)
- Implemented real-time state updates
- **Updated API Client:**
- Added all missing endpoints for watchlist management
- Fixed endpoint paths to match backend routes
- Added proper TypeScript interfaces

5. **Watchlist Page Overhaul**
- Replaced mock data with real API integration
- Added proper loading states and error handling
- Implemented real-time statistics
- Added remove functionality with confirmation

6. **Streaming Functionality**
- Enhanced Consumet API integration
- Added multiple streaming providers (Gogoanime, Consumet)
- Implemented quality sorting and source filtering
- Added proper CORS headers for streaming
- Enhanced episode progress tracking

#### **Key Features Now Working:**

✅ **Anime Search & Browse**
- Multi-source search (Jikan + AniList)
- Advanced filtering and pagination
- Real-time watchlist status display

✅ **Watchlist Management**
- Add/remove anime with one click
- Status tracking (watching, completed, on_hold, dropped, plan_to_watch)
- Rating system integration
- Progress tracking

✅ **Streaming Functionality**
- Multiple quality options
- Automatic source selection
- Episode progress tracking
- Proper video player integration

✅ **User Experience**
- Loading states and error handling
- Visual feedback for all actions
- Responsive design
- Real-time updates

#### **Technical Implementation:**

**Backend Architecture:**
```
├── routes/
│ ├── animeRoutes.js # ✅ Fixed anime fetching & progress
│ └── userRoutes.js # ✅ Added watchlist endpoints
├── controllers/
│ └── userController.js # ✅ Added watchlist methods
├── services/
│ └── userService.js # ✅ Fixed Prisma injection
└── plugins/
└── apiServices.js # ✅ Enhanced streaming APIs
```

**Frontend Architecture:**
```
├── app/
│ ├── anime/page.tsx # ✅ Fixed anime search & grid
│ └── watchlist/page.tsx # ✅ Real API integration
├── components/
│ └── enhanced-anime-grid.tsx # ✅ Watchlist functionality
└── lib/
└── api.ts # ✅ Complete API client
```

**Database Schema:**
```sql
-- ✅ Properly aligned with application logic
model Watchlist {
id String @id @default(cuid())
userId String
animeId String
status String # watching, completed, on_hold, dropped, plan_to_watch
rating Float?
notes String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

user User @relation(fields: [userId], references: [id])
anime Anime @relation(fields: [animeId], references: [id])

@@unique([userId, animeId])
}
```

## 🚀 Getting Started

### Prerequisites
- Node.js 18+
- PostgreSQL
- Redis (for caching)

### Backend Setup
```bash
cd backend
npm install
npx prisma generate
npx prisma db push
npm run dev
```

### Frontend Setup
```bash
npm install
npm run dev
```

### Environment Variables
```env
# Backend (.env)
DATABASE_URL="postgresql://..."
JWT_SECRET="your-secret"
JIKAN_API_URL="https://api.jikan.moe/v4"
ANILIST_API_URL="https://graphql.anilist.co"
CONSUMET_API_URL="https://api.consumet.org/anime/gogoanime"

# Frontend (.env.local)
NEXT_PUBLIC_API_URL="http://localhost:3001"
```

## 🎮 Features

- **🎬 Anime Streaming** - High-quality video playback with multiple sources
- **📚 Manga Reading** - Chapter-by-chapter reading experience
- **👤 User Profiles** - Personal watchlists and reading lists
- **💬 AI Chat** - Interactive conversations with anime characters
- **🎯 Progress Tracking** - Episode and chapter progress tracking
- **🔍 Advanced Search** - Multi-source anime and manga discovery
- **🏆 Achievements** - Gamified user experience
- **📱 Responsive Design** - Works on all devices

## 🛠️ Tech Stack

- **Frontend:** Next.js 14, TypeScript, Tailwind CSS, Framer Motion
- **Backend:** Fastify, Prisma, PostgreSQL, Redis
- **APIs:** Jikan, AniList, Consumet, MangaDex
- **Deployment:** Docker ready

## 📝 API Documentation

### Anime Endpoints
- `GET /api/anime/search` - Search anime
- `GET /api/anime/:id` - Get anime details
- `GET /api/anime/:id/episodes/:episode/stream` - Get streaming URL

### User Endpoints
- `GET /api/user/me` - Get user profile
- `GET /api/user/me/watchlist` - Get user watchlist
- `POST /api/user/me/watchlist/:animeId` - Add to watchlist
- `DELETE /api/user/me/watchlist/:animeId` - Remove from watchlist

## 🤝 Contributing

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

**Status:** ✅ All major functionality working - Anime fetch, Watchlist management, and Streaming fully operational!