This is a Next.js project bootstrapped with create-next-app.
-
Clone the repository:
git clone https://github.com/youtube-description-text-replacer.git cd youtube-description-text-replacer -
Create a
.env.localfile in the root directory of the project. -
Add the following environment variables:
NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=your_nextauth_secret GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secretReplace
your_nextauth_secret,your_google_client_id, andyour_google_client_secretwith your actual values.To generate your Google Client ID and Secret:
- Go to the Google Cloud Console (https://console.cloud.google.com/).
- Create a new project or select an existing one.
- Navigate to "APIs & Services" > "Credentials" in the left sidebar.
- Click "Create Credentials" and select "OAuth client ID".
- Choose "Web application" as the application type.
- Set the authorized JavaScript origins to
http://localhost:3000(for development). - Set the authorized redirect URIs to
http://localhost:3000/api/auth/callback/google. - Click "Create" to generate your Client ID and Client Secret.
- Copy the generated Client ID and Client Secret to use in your .env.local file.
To create a secure NextAuth secret:
- Open a terminal or command prompt.
- Run the following command to generate a random 32-character string:
openssl rand -base64 32 - Copy the output and use it as your NEXTAUTH_SECRET in the .env.local file.
Alternatively, you can use a password generator to create a long, random string (at least 32 characters) combining uppercase and lowercase letters, numbers, and symbols.
-
Install dependencies:
npm install # or yarn install -
Run the development server:
npm run dev # or yarn dev -
Open http://localhost:3000 in your browser to see the application.
/src: Contains the main source code/app: Next.js app router files/components: Reusable React components/constants: Constant values used across the app/types: TypeScript type definitions
-
YouTube Description Replace
- Location:
src/app/youtube/description-replace/page.tsx - This feature allows users to replace text in YouTube video descriptions.
- To modify:
- Adjust the
itemsPerPageconstant to change the number of videos displayed per page. - Modify the
handleApplyChangesfunction to alter the description update logic.
- Adjust the
- Location:
-
Image Transformer
- Location:
src/app/youtube/image-transformer/page.tsx - Used to turn square images to 1920x1080 with a blurred background to prevent YouTube setting your video as a short.
- Location:
-
Authentication
- Uses NextAuth.js for authentication
- Configuration:
src/pages/api/auth/[...nextauth].ts - To add or modify authentication providers, edit this file.
-
UI Components
- Located in
src/components - To modify existing components or add new ones, create or edit files in this directory.
- Located in
-
Styling
- The project uses Tailwind CSS for styling.
- Global styles:
src/styles/globals.css - To modify styles, edit the Tailwind classes in component files or update the Tailwind configuration in
tailwind.config.js.