Actualize
Explore posts from serversCCConvex Community
•Created by Actualize on 10/17/2024 in #support-community
Run convex from AWS lambda
I have next JS application with convex back-end. I want to run my scalable code on AWS lambdas.
At first I wanted to use queues and pass data to the lambdas like that. Then I thought it might be simpler to just let each lambda access convex directly.
My convex folder is generated on my next JS project (The lambda code is a sub-project of that project)
This is the structure of my project (think I could do it better?)
project-root/
├── src/
│ ├── app/
│ │ └── (Next.js app router structure)
│ └── lambda/ (the lambda project)
│ ├── src/
│ │ ├──lambda-code.ts
│ │ └── convex-client.ts (Needs to access convex prefarably also in dev)
│ ├── deploy.js
│ ├── package.json
│ └── .env
├── convex/
│ └── (convex files and folders)
└── package.json
So, what I am really asking is what's the best way to re-use the entire convex generated folder on the lambda project? (lambda code is writing in typescript and bundled to javascript).
PS: also wondering if that's better than my original solution using queues which involves more calls to pass data. (And might be cheaper???).7 replies
CCConvex Community
•Created by Actualize on 10/8/2024 in #support-community
Convex + Nextjs using preloadQuery inside layout.tsx
Hi,
I am trying to understand if doing a preloadQuery inside a layout.tsx and share it amongst my "use client" pages through a "react context" has any advantages over using useQuery on each page (assuming the data hasn't changed). Or if it's an anti-pattern cause layout.tsx is loaded once and will not cause re-renders?
7 replies
TTCTheo's Typesafe Cult
•Created by Actualize on 6/11/2024 in #questions
Create an embedded widget out of react component used in Next.js project
I've built an application in Next.js with some components that need to run as "widgets" or "web components" on third-party websites. These components are also used in my application for demo purposes. It would be ideal to use the same components to create widgets without rewriting external libraries like react-hot-toast.
I managed to solve this by using Webpack to bundle the component along with all its dependencies (sub-components, Tailwind CSS, etc.), including React and ReactDOM, so that the client can run the components. However, I'm wondering if there's a simpler way to achieve this.
1 replies