Codeflix is your one-stop educational platform designed exclusively for computer science students. Whether you're delving into algorithms, exploring backend development, or learning front-end frameworks, Codeflix offers an expansive collection of curated educational videos to guide your journey. With features that allow users to categorize videos, create personalized playlists, and dive deeper into specific topics, we're here to accelerate your learning process and elevate your coding skills.
Clone and set up Codeflix with these steps:
git clone https://github.com/javier-arango/codeflix.git
cd codeflix
npm install
Rename .env.example
to .env.local
and update environment variables:
# Cloudinary credentials
# https://cloudinary.com/documentation/cloudinary_credentials_tutorial#:~:text=Log%20into%20your%20Cloudinary%20Console,Secret%20and%20API%20Environment%20Variable.
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME={YOUR_CLOUD_NAME}
NEXT_PUBLIC_CLOUDINARY_API_KEY={YOUR_API_KEY}
NEXT_PUBLIC_CLOUDINARY_SECRET_KEY={YOUR_SECRET_KEY}
# Supabase credentials
DIRECT_URL={YOUR_DIRECT_URL}
DATABASE_URL={YOUR_DATABASE_URL}
# NextAuth.js credentials
# https://next-auth.js.org/configuration/options#nextauth_secret
NEXTAUTH_SECRET={YOUR_SECRET}
# Google API Key if you want to generate videos from YouTube api
GOOGLE_API_KEY={YOUR_API_KEY}
This project requires several API keys and credentials for different services. Here's how you can obtain them:
Cloudinary is used for image management. To get your Cloudinary credentials:
- Sign up for a free Cloudinary account if you don't have one.
- Log into your Cloudinary Console.
- Go to the Dashboard page.
- Here, you'll find your Cloud name, API Key, API Secret, and API Environment Variable.
For more details, refer to the Cloudinary Credentials Tutorial.
Supabase is used as the backend service for the Database. To get your Supabase API keys:
- Sign up for a free Supabase account if you don't have one.
- Create a new project.
- Go to the API section in the settings of your project.
- Here, you'll find the URL and public and secret API keys.
For more details, refer to the Supabase API Documentation.
The Google API key is used to fetch data from YouTube. To get your Google API key:
- Go to the Google Cloud Console.
- Create a new project.
- Enable the YouTube Data API v3 for your project.
- Create credentials for the YouTube Data API v3.
- Select API key in the credentials type.
For more details, refer to the Getting Started with YouTube Data API v3.
NextAuth.js requires a secret for encryption. To generate a secret:
- Open a terminal.
- Run the following command:
openssl rand -base64 32
For more details, refer to the NextAuth.js Configuration Documentation.
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 Inter, a custom Google Font.
This project is configured with Prisma, an advanced Object-Relational Mapping (ORM) to facilitate seamless database operations. Follow the steps below for both development and testing environments.
Run the migration command to establish the database schema. Prisma Migrate uses your migration files to manage the schema changes:
npm run prisma:migrate
# or
yarn prisma:migrate
Note: Prisma Migrate integrates with seeds. When it resets the development database, it automatically triggers the seeding.
Execute the seeding command to populate your database with predefined data essential for testing. Modify the prisma/seed.ts
file if you wish to make changes to the default seeding data:
npm run prisma:seed
# or
yarn prisma:seed
Prisma Studio provides a graphical interface, enabling you to visualize and manage your database records effortlessly. You can run the following command to start Prisma Studio:
npm run prisma:studio
# or
yarn prisma:studio
Visit http://localhost:5555 to access Prisma Studio and manage your database interactively.
Contributions to Codeflix are welcomed! Please refer to the CONTRIBUTING.md file for guidelines on how to make meaningful additions to our platform.
- Using Prisma with Supabase
- Prisma CRUD
- Connection management
- DB Relations
- Implicit Many to Many Relation
- Route Handlers
- Pages and Layouts
- Data Fetching, Caching, and Revalidating
- Fetching Data on the Client with third-party libraries
This project is released under the MIT License