Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Build stage
FROM node:18-alpine AS builder

WORKDIR /app

COPY package*.json ./
RUN npm ci

COPY . .
RUN npm run build

# Production stage
FROM node:18-alpine

WORKDIR /app

# Define default values
ARG NODE_ENV=production
ARG PORT=3000
ARG CACHE_TYPE=memory

# Set environment variables
ENV NODE_ENV=${NODE_ENV}
ENV HOST=0.0.0.0
ENV PORT=${PORT}
ENV CACHE_TYPE=${CACHE_TYPE}

# Copy only production dependencies
COPY package*.json ./
RUN npm ci --only=production

# Copy built application
COPY --from=builder /app/dist ./dist

# Create non-root user
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001

USER nodejs

EXPOSE ${PORT}

CMD ["node", "dist/server.js"]
80 changes: 44 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# CinePro Core 🎬

## _🌟 Please star this repository! 🌟_
## _🌟 Star this repository to support us! 🌟_

**OMSS-compliant streaming backend powering the CinePro ecosystem.**</br> Built with [@omss/framework](https://www.npmjs.com/package/@omss/framework) for extensible, type-safe media scraping and streaming.

Expand All @@ -23,11 +23,13 @@ Built on the [OMSS template](https://github.com/omss-spec/template), this backen
- 🎯 **OMSS-Compliant** – Follows the Open Media Streaming Standard specification
- 🔌 **Modular Providers** – Drop-in provider system with auto-discovery
- 🛡️ **Type-Safe** – Full TypeScript implementation with strict types
- ⚡ **Production-Ready** – Redis caching, Docker support (soon), error handling
- ⚡ **Production-Ready** – Redis caching, Docker support, error handling
- 🎬 **Multi-Source** – Support for movies and TV shows from multiple providers
- 🔄 **Hot Reload** – Development mode with automatic restarts
- 📦 **CineHome Integration** – Compatible with CineHome download automation and any other CinePro ecosystem products

✨Please star this repository if you find it useful! It helps us gain visibility and continue improving the project!✨

---

## 🚀 Quick Start
Expand Down Expand Up @@ -76,6 +78,46 @@ npm run build
npm start
```

### Docker Deployment

#### With Docker Compose (includes Redis)

```bash
# Create .env file with your TMDB_API_KEY
cp .env.example .env
# Edit .env and add your TMDB_API_KEY

# Start services
docker-compose up -d

# Server runs at http://localhost:3000 or whatever you set in .env
```

#### Standalone Docker

```bash
# Build image
docker build -t cinepro-core:latest .

# Run with memory cache
docker run -p 3000:3000 \
-e TMDB_API_KEY=your_tmdb_api_key_here \
-e CACHE_TYPE=memory \
cinepro-core:latest
```

#### Custom Configuration

```bash
# Custom port and Redis
docker run -p 8080:8080 \
-e PORT=8080 \
-e TMDB_API_KEY=your_key \
-e CACHE_TYPE=redis \
-e REDIS_HOST=your-redis-host \
cinepro-core:latest
```

---

## 📁 Project Structure
Expand All @@ -93,40 +135,6 @@ core/

---

## 🔌 Adding Providers

CinePro Core uses an extensible provider system. Each provider implements the `BaseProvider` interface to supply streaming sources.

### Create a New Provider

```typescript
// src/providers/mysite.ts
import { BaseProvider } from '@omss/framework';

export class MySiteProvider extends BaseProvider {
readonly id = 'mysite';
readonly name = 'My Streaming Site';
readonly BASE_URL = 'https://mysite.com';
readonly capabilities = {
supportedContentTypes: ['movies', 'tv']
};

async getMovieSources(tmdbId: string) {
// Implementation
}

async getTVSources(tmdbId: string, season: number, episode: number) {
// Implementation
}
}
```

### Auto-Discovery

Place your provider in `src/providers/` and restart the server. The framework automatically discovers and registers new providers.

---

## ⚙️ Configuration

### Environment Variables
Expand Down
36 changes: 36 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
services:
cinepro-core:
build: .
ports:
- '3000:3000'
environment:
- HOST=0.0.0.0
- PORT=3000
- NODE_ENV=production
- TMDB_API_KEY=${TMDB_API_KEY}
- TMDB_CACHE_TTL=86400
- CACHE_TYPE=redis
- REDIS_HOST=redis
- REDIS_PORT=6379
depends_on:
- redis
restart: unless-stopped
networks:
- omss-network

redis:
image: redis:7-alpine
ports:
- '6379:6379'
volumes:
- redis-data:/data
restart: unless-stopped
networks:
- omss-network

volumes:
redis-data:

networks:
omss-network:
driver: bridge
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.