Skip to content

Conversation

RoboXGamer
Copy link

@RoboXGamer RoboXGamer commented Feb 8, 2025

This PR introduces TypeScript to the frontend and backend, and refactors the server for better organization.

Key changes:

  • Frontend (React/Vite):

    • Converted JavaScript codebase to TypeScript.
    • Migrated all .js/.jsx components to .tsx.
    • Updated Vite configuration for TypeScript.
  • Backend (Express):

    • Moved the Express server to a dedicated server folder.
    • Converted server-side JavaScript to TypeScript.
    • Implemented Nodemon for automatic server restarts during development.

These changes improve code maintainability, developer experience, and pave the way for future features.

@RoboXGamer RoboXGamer marked this pull request as ready for review February 11, 2025 05:50
"@langchain/openai": "^0.3.16",
"@radix-ui/react-slot": "^1.1.2",
"@tanstack/react-router": "^1.97.0",
"@tanstack/react-router": "^1.102.1",
Copy link

@kinggoesgaming kinggoesgaming Feb 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO updating random dependencies that are not part of the scope of the PR is not good.

If Shurti is fine with this that's fine

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

"dotenv": "^16.4.7",
"express": "^4.21.2",
"langchain": "^0.3.8",
"convex": "^1.19.0",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

"react": "18.3.1",
"react-dom": "18.3.1",
"react-error-boundary": "^5.0.0",
"react": "^19.0.0",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tanstack router is not compatible with v19 AFAIK

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets not upgrade React as of now.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay downgrading it back. I did not notice, it happened to upgrade automatically

Copy link
Owner

@shrutikapoor08 shrutikapoor08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for the effort to convert this to TS. I appreciate you helping out.
This PR is a few different things, and as such it makes it difficult to test and review. I would recommend splitting this out to keep the changes to only converting to TS.
You can break this PR down into multiple PRs to make it easy to review, test and separate concerns.

"css": "src/App.css",
"baseColor": "zinc",
"css": "src/index.css",
"baseColor": "slate",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

"@langchain/openai": "^0.3.16",
"@radix-ui/react-slot": "^1.1.2",
"@tanstack/react-router": "^1.97.0",
"@tanstack/react-router": "^1.102.1",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

"react": "18.3.1",
"react-dom": "18.3.1",
"react-error-boundary": "^5.0.0",
"react": "^19.0.0",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets not upgrade React as of now.

@@ -0,0 +1,7 @@
{
"singleQuote": false,
"trailingComma": "es5",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets remove prettier config in this PR. Lets limit the scope to TS. .

},
handler: async (ctx, args) => {
const embeddings = await generateEmbeddings(args.property);
// @ts-expect-error - by_embedding is the vector index name
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what was the error here?

<Link to="/details/$propertyId" params={{ propertyId: zpid }}>
<img
src={imgSrc}
alt="Property Image"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a good idea to keep components in its own folder. You can undo this change.


const root = createRoot(document.getElementById("root")!);
root.render(
<StrictMode>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strict mode is not needed yet.

darkMode: ["class"],
content: ["./index.html", "./src/**/*.{html,js,jsx}"],
darkMode: ["class"],
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove html?

proxy: {
"/api": {
target: "http://localhost:3001",
target: "http://localhost:8000/",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change port?

// https://vite.dev/config/
export default defineConfig({
plugins: [react(), TanStackRouterVite()],
plugins: [TanStackRouterVite({ autoCodeSplitting: true }), react()],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this sequence break build. Can you test it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants