An open-source subscription-based movie streaming platform designed to serve a diverse audience with multi-language content support and AI-powered subtitle translation.
Film Mania is a modern, production-ready streaming platform that enables users to watch films from various languages including Tamil, Malayalam, Hindi, English, Korean, Japanese, and Anime. The platform features AI-powered English-to-Sinhala subtitle translation, making content accessible to a broader audience.
- π₯ Multi-Language Content: Support for Tamil, Malayalam, Hindi, English, Korean, Japanese, and Anime
- π€ AI Subtitle Translation: Automatic English-to-Sinhala subtitle conversion using AI models
- π³ Subscription Management: Flexible monthly/yearly subscription plans via Stripe
- π Secure Authentication: JWT-based authentication with refresh tokens
- π Admin Dashboard: Admin tools for funding user subscriptions and managing API credits
- π― Content Discovery: Advanced search, filtering, and categorization
- π Self-Hosted: Full Docker Compose setup for easy deployment
- π± Responsive Design: Modern UI built with Next.js and React
Frontend:
- Next.js 14+ (App Router)
- React 18+
- TypeScript
- Tailwind CSS (optional)
Backend:
- Node.js 18+
- Express.js
- TypeScript
- PostgreSQL with Sequelize ORM
- JWT Authentication
- Stripe Integration
Infrastructure:
- Docker & Docker Compose
- Nginx Reverse Proxy
- PostgreSQL Database
- NX Monorepo
External Services:
- Stripe (Payment Processing)
- TMDB (Movie Metadata)
- VidAPI/StreamAPI (Streaming Links)
- AI Model (Subtitle Translation)
film-mania/
βββ apps/
β βββ api/ # Backend API (Express/TypeScript)
β β βββ src/
β β β βββ config/ # Configuration (app.config.ts, database.ts)
β β β βββ controllers/ # API controllers
β β β βββ middleware/ # Auth, validation, error handling
β β β βββ models/ # Sequelize database models
β β β βββ routes/ # API routes (auth, movies, subscriptions, etc.)
β β β βββ services/ # Business logic (auth, stripe, movie)
β β β βββ main.ts # Application entry point
β β βββ Dockerfile
β β
β βββ web/ # Frontend (Next.js/React)
β βββ src/
β β βββ app/ # Next.js App Router pages
β β βββ components/ # React components
β β βββ lib/ # Utilities and API client
β βββ Dockerfile
β
βββ libs/
β βββ shared/ # Shared TypeScript types and interfaces
β βββ src/
β βββ interfaces/ # TypeScript interfaces (IMovie, etc.)
β βββ dtos/ # Data Transfer Objects
β βββ enums/ # Enumerations
β
βββ database/
β βββ schema.sql # PostgreSQL database schema
β
βββ docker/
β βββ nginx/ # Nginx configuration
β βββ nginx.conf
β
βββ docs/
β βββ requirements.md # Detailed requirements document
β βββ technical-feasibility.md # Technical architecture document
β
βββ scripts/ # Deployment and utility scripts
β βββ deploy.sh
β βββ setup-vps.sh
β βββ ...
β
βββ docker-compose.yml # Docker Compose configuration
βββ nx.json # NX configuration
βββ package.json # Root package.json
- Node.js 18.x or higher
- Yarn 4.x (via Corepack)
- Docker and Docker Compose
- PostgreSQL 14+ (or use Docker)
- Git
-
Clone the repository
git clone <your-repo-url> cd film-mania
-
Enable Corepack and install dependencies
corepack enable yarn install -
Set up environment variables
Create
apps/api/.env:NODE_ENV=development PORT=3000 # Database DB_HOST=localhost DB_PORT=5432 DB_NAME=film_mania DB_USERNAME=postgres DB_PASSWORD=postgres # JWT JWT_SECRET=your-secret-key-change-in-production JWT_REFRESH_SECRET=your-refresh-secret-key-change-in-production JWT_EXPIRY=24h JWT_REFRESH_EXPIRY=7d # Stripe STRIPE_SECRET_KEY=sk_test_... STRIPE_WEBHOOK_SECRET=whsec_... # TMDB TMDB_API_KEY=your-tmdb-api-key # CORS CORS_ORIGIN=http://localhost:3001,http://localhost:3000
Create
apps/web/.env.local:NEXT_PUBLIC_API_URL=http://localhost:3000
-
Set up the database
# Start PostgreSQL with Docker docker-compose up -d postgres # Or use your existing PostgreSQL instance # Then run the schema psql -U postgres -d film_mania -f database/schema.sql
-
Start the development servers
In one terminal, start the API:
yarn api:dev
API will run on http://localhost:3000
In another terminal, start the web app:
yarn web:dev
Web app will run on http://localhost:3001
-
Access the application
- Frontend: http://localhost:3001
- API: http://localhost:3000
- Health Check: http://localhost:3000/health
# Build and start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop all services
docker-compose downThe application will be available at:
- API: http://localhost:3000
- Web: http://localhost:3001
- Nginx (if configured): http://localhost
POST /api/auth/register- Register a new userPOST /api/auth/login- Login userPOST /api/auth/refresh- Refresh access tokenGET /api/auth/me- Get current user info
GET /api/movies- Get movies list (with filters)GET /api/movies/:id- Get movie detailsGET /api/movies/categories/list- Get available categoriesGET /api/movies/category/:category- Get movies by categoryGET /api/movies/search/:query- Search movies
GET /api/subscriptions/current- Get current subscriptionPOST /api/subscriptions/create- Create subscriptionPOST /api/subscriptions/cancel- Cancel subscription
POST /api/admin/fund-subscription- Fund user subscription (3 months)GET /api/admin/api-credits- Get API creditsPOST /api/admin/api-credits- Add API creditsGET /api/admin/funding/stats- Get funding statistics
See apps/api/env.example for all available environment variables.
The database schema includes:
- Users and authentication
- Subscriptions and payments
- Movies and categories
- Subtitles
- API credits and usage tracking
- Admin funding records
See database/schema.sql for the complete schema.
- User authentication and authorization
- Subscription management with Stripe
- Movie catalog with multi-language support
- Admin dashboard for funding subscriptions
- API credit tracking
- AI subtitle translation (English to Sinhala)
- Video player with subtitle support
- User watchlist and favorites
- Movie recommendations
- Advanced search filters
- Mobile app (React Native)
- Social features (reviews, ratings)
- β JWT-based authentication with refresh tokens
- β Password hashing with bcrypt
- β Helmet.js for security headers
- β CORS configuration
- β Input validation and sanitization
- β Rate limiting (via Nginx)
- β SQL injection prevention (Sequelize ORM)
- β Environment variable management
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Ensure all tests pass and linting is clean
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Write meaningful commit messages
- Update documentation for new features
- Add tests for new functionality
- Ensure code passes ESLint checks
This project is licensed under the MIT License - see the LICENSE file for details.
- TMDB for movie metadata API
- Stripe for payment processing
- The open-source community for amazing tools and libraries
For issues, questions, or contributions:
- Open an issue on GitHub
- Check the documentation folder for detailed information
- Review the requirements document
Coming soon! The application will be deployed and available for public access.
Built with β€οΈ using NX Monorepo, TypeScript, and modern web technologies