An AI-powered application that generates short history reels for sports celebrities using OpenAI and presents them in a TikTok-style UI.
- AI-generated scripts using OpenAI GPT-4
- Text-to-speech conversion using Amazon Polly
- Video generation with FFmpeg
- AWS S3 storage for videos
- TikTok-style vertical scroll UI
- Mobile-friendly design
- Node.js 18+ and npm
- OpenAI API key
- AWS account with S3 access
- FFmpeg installed locally
Create a .env.local
file in the root directory with the following variables:
# OpenAI
OPENAI_API_KEY=your_openai_api_key
# AWS
AWS_REGION=your_aws_region
AWS_ACCESS_KEY_ID=your_aws_access_key_id
AWS_SECRET_ACCESS_KEY=your_aws_secret_access_key
AWS_S3_BUCKET=your_s3_bucket_name
- Go to OpenAI's API Key Page.
- Create a new API key.
- Copy the key and paste it into your
.env.local
file as the value forOPENAI_API_KEY
.
- Clone the repository:
git clone <repository-url>
cd ai-sports
- Install dependencies:
npm install
- Set up environment variables:
- Copy
.env.example
to.env.local
- Fill in your API keys and credentials
- Run the development server:
npm run dev
src/
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ └── page.tsx # Main page
├── components/ # React components
│ ├── Reel.tsx # Individual reel component
│ └── ReelFeed.tsx # Reel feed component
└── utils/ # Utility functions
└── videoGenerator.ts # Video generation utilities
GET /api/reels
- Get list of available reelsPOST /api/reels/generate
- Generate a new reel
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
MIT
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.