-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 69de6f9
Showing
13 changed files
with
5,265 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Tweet Generator | ||
|
||
This app generates engaging tweets for your brand. | ||
|
||
This project is built using Nextjs. It utilizes the OpenAI GPT for chat completion, and Dall-E for image generation. | ||
|
||
<img src="tweet-generator-demo.gif" alt="app demo" width=600> | ||
|
||
## Getting Started | ||
|
||
First, duplicate the `.env` file into a new file named `.env.local`. Update the value of your OpenAI API key there. | ||
|
||
The first time you are running this project, you will need to install the dependencies. Run this command in your terminal: | ||
|
||
```bash | ||
yarn | ||
``` | ||
|
||
To start the app, run: | ||
|
||
```bash | ||
yarn dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
body { | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", | ||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
body { | ||
background-color: rgb(21, 32, 43); | ||
} | ||
|
||
:root { | ||
--twitter-blue: #1da1f2; | ||
} | ||
|
||
.container { | ||
max-width: 1500px; | ||
margin: 50px auto; | ||
padding: 20px; | ||
font-family: Arial, sans-serif; | ||
} | ||
|
||
h1 { | ||
font-size: 50px; | ||
text-align: center; | ||
margin: 0 auto; | ||
color: #fff; | ||
} | ||
|
||
.highlight { | ||
color: var(--twitter-blue); | ||
} | ||
|
||
button:disabled, | ||
button:disabled:hover { | ||
background-color: #b7aeb9; | ||
border-color: #b7aeb9; | ||
color: white; | ||
cursor: not-allowed; | ||
opacity: 0.5; | ||
} | ||
|
||
.loading-wrapper { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 24px; | ||
} | ||
|
||
.loading-spinner { | ||
display: inline-block; | ||
width: 50px; | ||
height: 50px; | ||
border: 5px solid #fff; | ||
border-radius: 50%; | ||
border-top-color: var(--twitter-blue); | ||
animation: spin 1s ease-in-out infinite; | ||
-webkit-animation: spin 1s ease-in-out infinite; | ||
} | ||
|
||
.loading-wrapper span { | ||
font-weight: 700; | ||
color: var(--twitter-blue); | ||
text-align: center; | ||
} | ||
|
||
@keyframes spin { | ||
to { | ||
-webkit-transform: rotate(360deg); | ||
} | ||
} | ||
|
||
@-webkit-keyframes spin { | ||
to { | ||
-webkit-transform: rotate(360deg); | ||
} | ||
} | ||
|
||
@media screen and (max-width: 640px) { | ||
h1 { | ||
font-size: 36px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import "./globals.css"; | ||
import type { Metadata } from "next"; | ||
import "@fortawesome/fontawesome-svg-core/styles.css"; | ||
import { config } from "@fortawesome/fontawesome-svg-core"; | ||
config.autoAddCss = false; | ||
|
||
export const metadata: Metadata = { | ||
title: "AI Tweet Generator", | ||
description: | ||
"A Tweet Generator that uses AI to generate tweets based on a topic and style.", | ||
}; | ||
|
||
export default function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<html lang="en"> | ||
<body> | ||
<main>{children}</main> | ||
</body> | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"use client"; | ||
|
||
import Image from "next/image"; | ||
import TweetGenerator from "./components/TweetGenerator"; | ||
|
||
export default function Home() { | ||
return ( | ||
<div className="container"> | ||
<h1> | ||
<span className="highlight">Generate</span> your next | ||
<br /> <span className="highlight">Tweet</span> using{" "} | ||
<span className="highlight">AI</span> | ||
</h1> | ||
|
||
<TweetGenerator /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
images: { | ||
remotePatterns: [ | ||
{ | ||
protocol: "https", | ||
hostname: "**", | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
module.exports = nextConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "codebender-ai-nextjs", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start", | ||
"lint": "next lint" | ||
}, | ||
"dependencies": { | ||
"@fortawesome/fontawesome-svg-core": "^6.5.1", | ||
"@fortawesome/free-solid-svg-icons": "^6.5.1", | ||
"@fortawesome/react-fontawesome": "^0.2.0", | ||
"@types/node": "20.5.1", | ||
"@types/react": "18.2.20", | ||
"@types/react-dom": "18.2.7", | ||
"ai": "^2.2.31", | ||
"autoprefixer": "10.4.15", | ||
"eslint": "8.47.0", | ||
"eslint-config-next": "13.4.19", | ||
"next": "13.4.19", | ||
"openai": "^4.24.2", | ||
"postcss": "8.4.28", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"typescript": "5.1.6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
plugins: { | ||
autoprefixer: {}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"strict": true, | ||
"noEmit": true, | ||
"esModuleInterop": true, | ||
"module": "esnext", | ||
"moduleResolution": "bundler", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"jsx": "preserve", | ||
"incremental": true, | ||
"plugins": [ | ||
{ | ||
"name": "next" | ||
} | ||
], | ||
"paths": { | ||
"@/*": ["./*"] | ||
} | ||
}, | ||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], | ||
"exclude": ["node_modules"] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.