mb23
mb23
WWasp-lang
Created by mb23 on 7/15/2024 in #đŸ™‹questions
How can I offer a free trial?
I'm using the OpenSaaS template and would like to offer a free trial. I can set up a free trial as part of a payment link but haven't found a way to link it to the code. Should I simply use the payment link JS code provided by Stripe and the replace the particular button in the app? đŸ™‚
7 replies
WWasp-lang
Created by mb23 on 7/11/2024 in #đŸ™‹questions
Updating and redeploying Postgres DB in Railway
Do I have to manually update/redeploy the Postgres database in Railway? I've reployed the app but the new Prisma schema is not reflected in the database. On top of this, I'm also having this problem after redeployment again: Access to XMLHttpRequest at 'https://server-production-....railway.app/auth/me' from origin 'https://...' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Maybe, it's somehow connected?
16 replies
WWasp-lang
Created by mb23 on 7/8/2024 in #đŸ™‹questions
Issue with creating jobs/workers
I want to create jobs/workers for functions that use external APIs such as OpenAI so they're also processed if the user closes/refrehes the page. Example: For an outline creation function I have created: 1) a job definition in the main.wasp: job createOutlineJob { executor: PgBoss, perform: { fn: import { createOutlineWorker } from "@src/server/workers/outlineWorker" }, entities: [User, Keyword, Headline, Websites] } 2) an OutlineWorker,ts file in ..\app\src\server\workers that contains all helper functions for the main createOutlineWorker function and of course the createOutlineWorker function itself: export const createOutlineWorker: CreateOutlineJob<Input, Output> = async ({ keywordId }, context) => { 3) reference on an app page: import { createOutlineJob } from 'wasp/server/jobs'; ... const handleCreateOutline = async (keywordId) => { try { await createOutlineJob.submit({ keywordId: keywordId }); } catch (error) { console.error('Failed to enqueue createOutlineJob:', error); } }; Still, I get this error and a blank page when i try to build: ReferenceError: process is not defined at config.ts:41:20 I've already read that this seems to be server code that's loaded in the client but having a hard time to figure out what to do about it :/
11 replies
WWasp-lang
Created by mb23 on 7/5/2024 in #đŸ™‹questions
user.subscriptionStatus and user.subscriptionTier are not set
I've set up Stripe and can buy the test product using the right price ID. User.StripeId and User.CheckoutSessionId are properly set in the database. I successfully get to /checkout?success=true afterwards. But user.subscriptionStatus and user.subscriptionTier are not set. I've also checked the event data in Stripe, for example the checkout.session.completed is properly shown. data[0]?.price?.id === process.env.PRO_SUBSCRIPTION_PRICE_ID is also true according to the Stripe event data. (As used here in the StripeWebhook function: if (line_items?.data[0]?.price?.id === process.env.PRO_SUBSCRIPTION_PRICE_ID) { console.log('Pro subscription purchased'); await context.entities.User.updateMany({ where: { stripeId: userStripeId, }, data: { hasPaid: true, datePaid: new Date(), subscriptionTier: TierIds.PRO, }, }); } else { response.status(404).send('Invalid product'); } ) What can I do about it? I've tried adding logs to the stripeWebhook function but they're not shown at all.
5 replies
WWasp-lang
Created by mb23 on 7/2/2024 in #đŸ™‹questions
Where can I find the code for the login form?
Where can I find the code for the login form?
8 replies
WWasp-lang
Created by mb23 on 7/2/2024 in #đŸ™‹questions
Change main font globally
I know it's probably a silly question but what's the easiest way to change the font-family globally? Through the tailwind.config.cjs?
9 replies
WWasp-lang
Created by mb23 on 6/11/2024 in #đŸ™‹questions
Server is blocked by CORS policy
No description
12 replies
WWasp-lang
Created by mb23 on 6/10/2024 in #đŸ™‹questions
Affordable server solution
Hi there, I've built my first project using the OpenSaaS template and would like to deploy it. I've read a bit about the cost of services such as Vercel and that they can explode if you're app gets a decent amount of traction. What would be an affordable solution that costs less than $50 per month for the initial phase of a project and can be scaled on a budget? đŸ™‚ Thanks in advance!
20 replies