-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: move all nextjs code to www directory * Migrate config files over to www * Setup turbo * Update docs * Merge branch 'main' into feat-monorepo * Delete duplicate actions * Merge branch 'main' of github.com:alexghirelli/projectx into feat-monorepo * chore: update paths * chore: update paths --------- Co-authored-by: Connor Littleton <[email protected]>
- Loading branch information
1 parent
4659cbd
commit 7e82cbf
Showing
349 changed files
with
13,673 additions
and
2,102 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 |
---|---|---|
|
@@ -42,4 +42,7 @@ next-env.d.ts | |
.vscode | ||
.contentlayer | ||
|
||
venv | ||
venv | ||
|
||
# Turbo | ||
.turbo |
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
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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,45 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
.env*.local | ||
.env | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
/.react-email/ | ||
|
||
.vscode | ||
.contentlayer | ||
|
||
venv |
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,3 @@ | ||
module.exports = { | ||
...require("../../prettier.config.js"), | ||
}; |
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,37 @@ | ||
// actions/get-user-workspaces.js | ||
"use server"; | ||
|
||
import { prisma } from "@/lib/db"; | ||
import { getCurrentUser } from "@/lib/session"; | ||
|
||
export async function getUserWorkspaces() { | ||
const user = await getCurrentUser(); | ||
const userId = user?.id; | ||
|
||
// console.log(`Request received to get workspaces for User ID: ${userId}`); | ||
|
||
try { | ||
const workspaceData = await prisma.workspace.findMany({ | ||
where: { userId }, | ||
select: { | ||
id: true, | ||
name: true, | ||
// Include other fields as needed | ||
}, | ||
}); | ||
|
||
// Transform the workspace data | ||
const transformedWorkspaces = workspaceData.map((ws) => ({ | ||
workspaceName: ws.name, | ||
email: user?.name, | ||
icon: "vercel", | ||
name: user?.name, | ||
})); | ||
|
||
// console.log(`Workspaces retrieved successfully for user ID: ${userId}`); | ||
return { success: true, workspaces: transformedWorkspaces }; | ||
} catch (error) { | ||
console.error(`Error retrieving workspaces for user ID: ${userId}`, error); | ||
return { success: false, error: error.message }; | ||
} | ||
} |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,47 @@ | ||
// app/api/ai/generateDescription/route.ts | ||
import { NextRequest, NextResponse } from "next/server"; | ||
import axios from "axios"; | ||
|
||
export async function POST(request: NextRequest) { | ||
const requestBody = await request.json(); | ||
const { allResponses, text } = requestBody; | ||
|
||
// Construct messages for the chat completion request | ||
const messages = allResponses.map(response => { | ||
return { | ||
role: "user", | ||
content: `Options: ${response.options.join(", ")}.` | ||
}; | ||
}); | ||
|
||
console.log(messages); | ||
|
||
// Add the specific request text | ||
messages.push({ role: "system", content: "I need you to act like a real estate agent and write a description for this house. I need a title and a description" }); | ||
messages.push({ role: "user", content: text }); | ||
|
||
try { | ||
const openaiResponse = await axios.post( | ||
"https://api.openai.com/v1/chat/completions", | ||
{ | ||
model: "gpt-4", | ||
messages: messages | ||
}, | ||
{ | ||
headers: { | ||
'Authorization': `Bearer ${process.env.OPENAI_API_KEY}`, | ||
'Content-Type': 'application/json' | ||
} | ||
} | ||
); | ||
|
||
// Extracting the assistant's response | ||
const completion = openaiResponse.data.choices[0].message.content; | ||
|
||
// Send the assistant's response back to the client | ||
return NextResponse.json({ description: completion }); | ||
} catch (error) { | ||
console.error("Error in generating description:", error); | ||
return NextResponse.json({ error: "Failed to generate description" }, { status: 500 }); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,32 @@ | ||
import { Button } from "@/components/ui/button" | ||
import { | ||
Dialog, | ||
DialogContent, | ||
DialogDescription, | ||
DialogHeader, | ||
DialogTitle, | ||
DialogTrigger, | ||
} from "@/components/ui/dialog" | ||
import { UploadDropZone } from "../fileupload/UploadDropZone" | ||
|
||
export function AddFilesButton({propertyId, slug}) { | ||
|
||
return ( | ||
<Dialog> | ||
<DialogTrigger asChild> | ||
<Button variant="outline">Upload</Button> | ||
</DialogTrigger> | ||
<DialogContent className="md:w-fit grid justify-center max-h-[100%] max-sm:px-0"> | ||
<DialogHeader> | ||
<DialogTitle>Upload your files</DialogTitle> | ||
<DialogDescription> | ||
Upload all your photos for your property | ||
</DialogDescription> | ||
</DialogHeader> | ||
<div className="grid gap-4 py-4"> | ||
<UploadDropZone slug={slug} propertyId={propertyId} /> | ||
</div> | ||
</DialogContent> | ||
</Dialog> | ||
) | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -60,4 +60,4 @@ export function AccountSwitcher({ | |
</SelectContent> | ||
</Select> | ||
); | ||
} | ||
} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
apps/www/components/properties/PropertyImageWithOptions.tsx
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,26 @@ | ||
// components/properties/PropertyImageWithOptions.js | ||
import PropertyPicture from './PropertyPicture'; | ||
import { SelectInputForm } from '../forms/select-input-form'; | ||
|
||
const PropertyImageWithOptions = ({ image }) => { | ||
console.log(image) | ||
// Transform the image options into the correct format for SelectInputForm | ||
const options = [ | ||
{ key: 'option1', label: 'Option 1', description: image.option1, imageId: image.id, selectedOption: image.selectedOption }, | ||
{ key: 'option2', label: 'Option 2', description: image.option2, imageId: image.id, selectedOption: image.selectedOption }, | ||
{ key: 'option3', label: 'Option 3', description: image.option3, imageId: image.id, selectedOption: image.selectedOption }, | ||
].filter(option => option.description); // Filter out options without a description | ||
|
||
return ( | ||
<div className="lg:flex min-lg:flex-col justify-center max-lg:space-y-4 gap-x-4"> | ||
<div className="lg:w-1/2"> | ||
<PropertyPicture src={image.url} alt={image.description} /> | ||
</div> | ||
<div className="lg:w-1/2"> | ||
<SelectInputForm image={image} options={options} /> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PropertyImageWithOptions; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.