A NestJS-based backend service for managing and serving curated cat videos from YouTube. This service handles video fetching, categorization, and delivery through a RESTful API.
- YouTube video integration and management
- Channel-based content organization
- Automated video fetching and updates
- RESTful API endpoints
- Database seeding and management
- Scheduled tasks support
- PostgreSQL database integration
- NestJS (v10)
- TypeScript
- PostgreSQL with TypeORM
- YouTube Data API v3
- Class Validator & Transformer
- Swagger/OpenAPI
- Jest for testing
- Node.js (Latest LTS version)
- pnpm (v9.9.0 or higher)
- PostgreSQL
- YouTube API Key
- Install dependencies:
pnpm install- Configure environment variables:
cp .env.example .envEdit .env with your configuration:
- Database credentials
- YouTube API key
- Other environment-specific settings
- Start the database:
./start-database.sh- Run database migrations:
pnpm migration:runpnpm start:devpnpm build
pnpm start:prod- Generate:
pnpm migration:generate - Run:
pnpm migration:run - Revert:
pnpm migration:revert - Show status:
pnpm migration:show
- Seed database:
pnpm seed - Clean data:
pnpm seed:clean - Export data:
pnpm seed:export
src/
├── channel/ # Channel management module
├── video/ # Video management module
├── youtube/ # YouTube API integration
├── config/ # Configuration files
├── database/ # Database related files
│ └── seeders/ # Database seeding
├── middleware/ # Custom middleware
└── migrations/ # TypeORM migrations
- Video management and retrieval
- Category-based organization
- Pagination and filtering support
- Channel information management
- Video-channel relationships
- Channel metadata handling
# Unit tests
pnpm test
# e2e tests
pnpm test:e2e
# Test coverage
pnpm test:covThe project uses ESLint and Prettier for code formatting:
# Format code
pnpm format
# Lint code
pnpm lintAPI documentation is available through Swagger UI at /api when running the server.
This project is MIT licensed.
Created with