Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Level up the type definition from the parameters. #92

Open
wants to merge 95 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
7719d4c
added testimonials section
Nutlope Mar 4, 2023
0580567
added counter for how many rooms generate in /dream page
Nutlope Mar 4, 2023
f81c1c4
tracking room IDs in localstorage for future features
Nutlope Mar 4, 2023
70410d2
updated numbers
Nutlope Mar 4, 2023
f27b048
Fix typo in ratelimit popup
CarboxyDev Mar 4, 2023
8a35d26
Merge pull request #8 from CarboxyDev/patch-1
Nutlope Mar 5, 2023
8a7acc4
added link to my newsletter
Nutlope Mar 5, 2023
f9d8d31
Merge branch 'main' of https://github.com/Nutlope/roomGPT
Nutlope Mar 5, 2023
1643cb4
dropped allowed requests to 3
Nutlope Mar 5, 2023
6e45975
limiting generations to 1 per day
Nutlope Mar 5, 2023
a8b8c39
improved error message for too many generations
Nutlope Mar 5, 2023
e611fe1
increased generations to 3 per day and replaced screenshot in README
Nutlope Mar 5, 2023
b33b016
added redirects to github and vercel as url shortcuts
Nutlope Mar 6, 2023
ae852cf
hide temporary message when photo is generated
Nutlope Mar 7, 2023
792b4e6
updated redis DB env vars
Nutlope Mar 8, 2023
e48270e
add auth with next-auth and neon
Nutlope Mar 9, 2023
78e3def
auth fixes, ran prisma migration
Nutlope Mar 10, 2023
0749a84
Merge pull request #27 from Nutlope/add-auth
Nutlope Mar 10, 2023
52e5270
fixed # of generations left in UI
Nutlope Mar 10, 2023
b3a5525
adding kitchen type
Nutlope Mar 10, 2023
0207447
Merge pull request #28 from Nutlope/add-kitchen
Nutlope Mar 10, 2023
36f5bc0
optimization to not upload if user ran out of generations already
Nutlope Mar 10, 2023
fc29856
cleaned up README
Nutlope Mar 10, 2023
1fcc814
fix for connection pooling
Nutlope Mar 10, 2023
cba9bd5
Update README to clarify project purpose
Nutlope Mar 10, 2023
1614864
added debug: true to next auth
Nutlope Mar 10, 2023
40ddaf5
added experiencing some issues message
Nutlope Mar 10, 2023
ad23a63
show coming soon message
Nutlope Mar 10, 2023
f3e63dc
decreased generations to 2 temporarily
Nutlope Mar 10, 2023
a2282c7
fix for uploads
Nutlope Mar 10, 2023
4a2bb40
remove next-auth debug mode, increased generations to 3
Nutlope Mar 10, 2023
d6e6b26
fixed reset timing for generations
Nutlope Mar 11, 2023
6954332
minor copy change
Nutlope Mar 12, 2023
58a2e9b
applied a migration, changed some other things
Nutlope Mar 17, 2023
335ea05
replaced images in homepage
Nutlope Mar 17, 2023
0cce6f6
Updated deploy instructions
Nutlope Mar 18, 2023
3c7b82d
Merge branch 'main' into room-dashboard
Nutlope Mar 19, 2023
f9b5677
added a dashboard
Nutlope Mar 19, 2023
72f113b
small changes
Nutlope Mar 19, 2023
957ba8b
removed extra pic
Nutlope Mar 19, 2023
c799fb1
Merge pull request #34 from Nutlope/room-dashboard
Nutlope Mar 19, 2023
2ea99f3
first script
Nutlope Mar 19, 2023
7ed6843
added direct database URL
Nutlope Mar 19, 2023
2f6df64
Merge pull request #36 from Nutlope/fix-migration
Nutlope Mar 19, 2023
d8e26db
Update dashboard
Nutlope Mar 20, 2023
8fe80b2
pricing finally working!
Nutlope Mar 22, 2023
760a040
fully working pricing with test data
Nutlope Mar 22, 2023
2160f20
added additional dropdowns
Nutlope Mar 22, 2023
51be6c7
refactoring
Nutlope Mar 22, 2023
0cbcac0
refactoring
Nutlope Mar 22, 2023
fb4b448
minor copy change
Nutlope Mar 22, 2023
d575785
changed gaming prompt
Nutlope Mar 22, 2023
3177aeb
replaced pricing table with live one
Nutlope Mar 23, 2023
57a1335
README change
Nutlope Mar 23, 2023
ed809da
minor
Nutlope Mar 23, 2023
5dff185
small change to header
Nutlope Mar 23, 2023
dee0fc4
change
Nutlope Mar 23, 2023
da8bd46
updated stripe version
Nutlope Mar 23, 2023
21b9dc3
removed package-lock
Nutlope Mar 23, 2023
8eac6cf
added package-lock
Nutlope Mar 23, 2023
23d6a85
minor change
Nutlope Mar 23, 2023
9684004
update README
Nutlope Mar 23, 2023
39168bd
accounting for checkout session complete
Nutlope Mar 23, 2023
32cc516
fixed webhook
Nutlope Mar 23, 2023
06ae7d9
changed header
Nutlope Mar 23, 2023
096a141
included email
Nutlope Mar 23, 2023
ab45c9d
fresh package-lock
Nutlope Mar 23, 2023
93a8f2d
Merge pull request #45 from Nutlope/pricing-3
Nutlope Mar 23, 2023
4741152
minor changes
Nutlope Mar 23, 2023
3ad7baa
small changes
Nutlope Mar 23, 2023
f64af79
updated pricing
Nutlope Mar 23, 2023
55cca69
fixed header positioning on different pages
Nutlope Mar 23, 2023
298af65
added tags to upload to know if free or paid user
Nutlope Mar 23, 2023
2e88282
add PPP
Nutlope Mar 23, 2023
a0e4904
Update buy-credits.tsx
Nutlope Mar 23, 2023
e1655ca
trying ppp pricing
Nutlope Mar 23, 2023
875661f
minor updates
Nutlope Mar 23, 2023
7c3e742
redirecting to /dream if user is not logged in and visits pricing page
Nutlope Mar 24, 2023
0103594
decreased default generations to 3 credits
Nutlope Mar 24, 2023
cc792bb
Merge pull request #46 from Nutlope/decrease-default-generations
Nutlope Mar 24, 2023
3e18e3f
removed middleware
Nutlope Mar 24, 2023
550facd
improved prompt
Nutlope Mar 24, 2023
f559f2d
delete getUsersEmail API route
Nutlope Mar 25, 2023
12cd915
v1, testing
Nutlope Mar 25, 2023
9909381
added prisma query to update location
Nutlope Mar 25, 2023
7cb161e
added env var
Nutlope Mar 25, 2023
015b718
cleaned up page
Nutlope Mar 25, 2023
567ba23
Merge pull request #47 from Nutlope/add-locations
Nutlope Mar 25, 2023
61a70b4
price change
Nutlope Mar 26, 2023
91dec45
removed rel=noreferrer
Nutlope Mar 29, 2023
0471764
switch to faster model
anotherjesse Apr 12, 2023
c938b16
Merge pull request #67 from anotherjesse/new-model
Nutlope Apr 17, 2023
5be64e4
working with new version of API
Nutlope May 9, 2023
fba8141
revert back to controlnet-hough
Nutlope May 9, 2023
2da65c5
:cyclone: Defined type for props
alamenai Jun 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,18 @@ REPLICATE_API_KEY=
# Optional, if you're doing rate limiting
UPSTASH_REDIS_REST_URL=
UPSTASH_REDIS_REST_TOKEN=

# Optional, if you're planning to use Upload.io (you need to if you have 100+ uploads)
NEXT_PUBLIC_UPLOAD_API_KEY=

# Optional, if you want to add auth + DB
NEXTAUTH_SECRET=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
DATABASE_URL=
SHADOW_DATABASE_URL=
NEXTAUTH_URL=

# Pricing
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts
.env

# Scripts
getUsersEmails.ts
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [roomGPT.io](https://roomGPT.io)

This project generates designs of your room with AI.
roomGPT helps design rooms in seconds with AI.

[![Room GPT](./public/screenshot.png)](https://roomGPT.io)

Expand Down Expand Up @@ -42,8 +42,21 @@ Then, run the application in the command line and it will be available at `http:
npm run dev
```

## Auth setup

1. Use `openssl rand -base64 32` to generate NEXTAUTH_SECRET
2. Add DB URL and SHADOW DB URL from Neon
3. Create a new project in console.cloud.google.com
4. Click configure consent screen in API credentials page and click external
5. Add an app name, do not upload logo, add authorized domain
6. Publish app
7. Create credentials -> Oauth client ID
8. Run npx prisma db push && prisma migrate dev && prisma generate

## One-Click Deploy

Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=vercel-examples):

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/Nutlope/roomGPT&env=REPLICATE_API_KEY&project-name=room-GPT&repo-name=roomGPT)
> Note: You will need to configure auth by following the setup above by using Neon and next-auth and Stripe for payments in order to deploy with Vercel.

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/Nutlope/roomGPT&env=REPLICATE_API_KEY,NEXTAUTH_SECRET,GOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRET,DATABASE_URL,SHADOW_DATABASE_URL,NEXTAUTH_URL&project-name=room-GPT&repo-name=roomGPT)
1 change: 0 additions & 1 deletion components/DropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ interface DropDownProps {
themes: themeType[] | roomType[];
}

// TODO: Change names since this is a generic dropdown now
export default function DropDown({ theme, setTheme, themes }: DropDownProps) {
return (
<Menu as="div" className="relative block text-left">
Expand Down
10 changes: 7 additions & 3 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,28 @@ export default function Footer() {
<a
href="https://replicate.com/"
target="_blank"
rel="noreferrer"
className="font-bold hover:underline transition hover:text-gray-300 underline-offset-2"
>
Replicate,{" "}
</a>
<a
href="https://upload.io"
target="_blank"
rel="noreferrer"
className="font-bold hover:underline hover:text-gray-300 transition underline-offset-2"
>
Upload,{" "}
</a>
<a
href="https://loops.so"
target="_blank"
className="font-bold hover:underline hover:text-gray-300 transition underline-offset-2"
>
Loops,{" "}
</a>
and{" "}
<a
href="https://vercel.com/"
target="_blank"
rel="noreferrer"
className="font-bold hover:underline transition hover:text-gray-300 underline-offset-2"
>
Vercel.
Expand Down
71 changes: 45 additions & 26 deletions components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import Image from "next/image";
import Link from "next/link";

export default function Header() {
export default function Header({
photo,
email,
}: {
photo?: string;
email?: string;
}) {
return (
<header className="flex flex-col xs:flex-row justify-between items-center w-full mt-3 border-b pb-7 sm:px-4 px-2 border-gray-500 gap-2">
<Link href="/" className="flex space-x-2">
<Link href="/dream" className="flex space-x-2">
<Image
alt="header text"
src="/bed.svg"
Expand All @@ -16,30 +22,43 @@ export default function Header() {
roomGPT.io
</h1>
</Link>
<a
className="flex max-w-fit items-center justify-center space-x-2 rounded-full border border-blue-600 text-white px-5 py-2 text-sm shadow-md hover:bg-blue-500 bg-blue-600 font-medium transition"
href="https://github.com/Nutlope/roomGPT"
target="_blank"
rel="noopener noreferrer"
>
<Github />
<p>Star on GitHub</p>
</a>
{email ? (
<div className="flex items-center space-x-4">
<Link
href="/dashboard"
className="border-r border-gray-300 pr-4 flex space-x-2 hover:text-blue-400 transition"
>
<div>Dashboard</div>
</Link>
<Link
href="/buy-credits"
className="border-r border-gray-300 pr-4 flex space-x-2 hover:text-blue-400 transition"
>
<div>Buy Credits</div>
<div className="text-blue-500 bg-blue-200 rounded-full px-2 text-xs flex justify-center items-center font-bold">
New
</div>
</Link>
{photo ? (
<Image
alt="Profile picture"
src={photo}
className="w-10 rounded-full"
width={32}
height={28}
/>
) : (
<div className="w-10 h-10 rounded-full bg-white" />
)}
</div>
) : (
<Link
className="flex max-w-fit items-center justify-center space-x-2 rounded-lg border border-blue-600 text-white px-5 py-2 text-sm shadow-md hover:bg-blue-400 bg-blue-600 font-medium transition"
href="/dream"
>
<p>Sign Up </p>
</Link>
)}
</header>
);
}

function Github({ className }: { className?: string }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
height="20"
fill="currentColor"
viewBox="0 0 24 24"
className={className}
>
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" />
</svg>
);
}
31 changes: 15 additions & 16 deletions components/LoadingDots.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import styles from "../styles/loading-dots.module.css";
import styles from '../styles/loading-dots.module.css';

const LoadingDots = ({
color = "#000",
style = "small",
}: {
color: string;
style: string;
}) => {
return (
<span className={style == "small" ? styles.loading2 : styles.loading}>
<span style={{ backgroundColor: color }} />
<span style={{ backgroundColor: color }} />
<span style={{ backgroundColor: color }} />
</span>
);
interface IProps {
color: string;
style: string;
}

const LoadingDots = ({ color = '#000', style = 'small' }: IProps) => {
return (
<span className={style == 'small' ? styles.loading2 : styles.loading}>
<span style={{ backgroundColor: color }} />
<span style={{ backgroundColor: color }} />
<span style={{ backgroundColor: color }} />
</span>
);
};

export default LoadingDots;

LoadingDots.defaultProps = {
style: "small",
style: 'small',
};
36 changes: 36 additions & 0 deletions components/RoomGenerator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import Image from "next/image";

export function RoomGeneration({
original,
generated,
}: {
original: string;
generated: string;
}) {
return (
<div className="flex flex-col space-y-10 mt-4 mb-4 border px-8 pb-8 pt-2 border-gray-600 rounded-xl">
<div className="flex sm:space-x-8 sm:flex-row flex-col pb-5">
<div>
<h3 className="mb-1 font-medium text-lg">Original</h3>
<Image
alt="Original room"
src={original}
className="rounded-2xl h-full"
width={400}
height={400}
/>
</div>
<div className="sm:mt-0 mt-8">
<h3 className="mb-1 font-medium text-lg">Generated</h3>
<Image
alt="Generated room"
width={400}
height={400}
src={generated}
className="rounded-2xl h-full sm:mt-0 mt-2"
/>
</div>
</div>
</div>
);
}
136 changes: 136 additions & 0 deletions components/Testimonials.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
import Image from "next/image";

const testimonials = [
[
{
content: "So good! I need this right now. Congrats on the launch!",
link: "https://twitter.com/eveporcello/status/1631438728999899136",
author: {
name: "Eve Porcello",
role: "Engineer & Author",
image: "/eve.jpg",
},
},

{
content:
"Finally! Something to help me get over my indecisiveness when decorating my house!",
link: "https://twitter.com/arthur_dvorkin/status/1631402865209274369",
author: {
name: "Arthur Dvorkin",
role: "Engineer",
image: "/arthur.jpg",
},
},
],
[
{
content:
"This is incredible, you don't need an interior designer anymore.",
link: "https://www.tiktok.com/@thenubians/video/7206088336044313861?q=roomgpt.io&t=1677909079689",
author: {
name: "Ade Dada",
role: "Startup Founder",
image: "/ade.jpeg",
},
},
{
content:
"I haven't changed my room layout for 5 years, but this app may change that. Great job.",
link: "https://twitter.com/RobAttfield/status/1631545265281974273",
author: {
name: "Rob Attfield",
role: "Software Engineer",
image: "/rob.jpg",
},
},
],
[
{
content:
"This is fantastic. I've already decided on a new wall color from a generated image and repainting it is now my weekend project.",
link: "https://twitter.com/Music4UsAll/status/1631622608595607552",
author: {
name: "Music",
role: "Some dude on the internet",
image: "/music.jpg",
},
},
{
content: "🤯",
link: "https://twitter.com/github/status/1631821360619028482",
author: {
name: "GitHub",
role: "The one and only",
image: "/github.jpg",
},
},
],
];

export function Testimonials() {
return (
<section
id="testimonials"
aria-label="What our customers are saying"
className="py-10"
>
<div className="mx-auto px-4 sm:px-6 lg:px-8 md:px-7">
<div className="mx-auto md:text-center">
<h1 className="mx-auto max-w-4xl font-display text-4xl font-bold tracking-normal text-gray-300 sm:text-6xl">
Loved by many worldwide.
</h1>
<p className="mx-auto mt-6 max-w-xl text-lg sm:text-gray-400 text-gray-500 leading-7">
See what our over 1 million users are saying about the product.
</p>
</div>
<ul
role="list"
className="mx-auto mt-16 grid max-w-2xl grid-cols-1 gap-6 sm:gap-8 lg:mt-16 lg:max-w-none lg:grid-cols-3"
>
{testimonials.map((column, columnIndex) => (
<li key={columnIndex}>
<ul role="list" className="flex flex-col gap-y-6 sm:gap-y-8">
{column.map((testimonial, testimonialIndex) => (
<li
key={testimonialIndex}
className="hover:scale-105 transition duration-300 ease-in-out "
>
<a href={testimonial.link} target="_blank" rel="noreferrer">
<figure className="relative rounded-2xl bg-gray-600 p-6 shadow-xl shadow-slate-900/10">
<blockquote className="relative">
<p className="text-lg tracking-tight text-white">
"{testimonial.content}"
</p>
</blockquote>
<figcaption className="relative mt-6 flex items-center justify-between border-t border-slate-100 pt-6">
<div>
<div className="font-display text-base text-white">
{testimonial.author.name}
</div>
<div className="mt-1 text-sm text-gray-400">
{testimonial.author.role}
</div>
</div>
<div className="overflow-hidden rounded-full bg-slate-50">
<Image
className="h-14 w-14 object-cover"
src={testimonial.author.image}
alt="picture of the testimonial author"
width={56}
height={56}
/>
</div>
</figcaption>
</figure>
</a>
</li>
))}
</ul>
</li>
))}
</ul>
</div>
</section>
);
}
Loading