JLegendz
WWasp-lang
β’Created by JLegendz on 7/20/2024 in #πquestions
Deployment Questions
Hi! I'm getting very close to deploying, and I have a few questions before I do. As a bit of context, I'm an experienced web developer but I've never launched my own application.
1. Updates: Is there a recommended way to push updates to the live version of the wasp application? Currently I'm hosting everything on github, and would like to use my main branch as the deployed version of the app. What's best practice here?
2. Prisma DB Studio access for deployed app. How would I go about accessing this to manage the data for my app?
3. Substituting NGROK. Currently, I'm using Ngrok to test my endpoints from a mobile version of my app, but I'll need to swap that out for whatever will replace my port 3000 and 3001. I'm not sure what to expect when I cross that road.
I plan to deploy in the next two days and I'm excited! But I know I'll need to be able to keep pushing updates and I'm not sure how that all works just yet. Thanks!
9 replies
WWasp-lang
β’Created by JLegendz on 6/2/2024 in #πquestions
Stripe event for onMonthlyContinuation of subscription?
In the open-saas template there's the one time payment option to receive 10 credits. I'm making one of my tiers come with 50 credits per month. What's the recommended way to check for if the payment for the next month has been received so that I can add 50 more credits to the user's account?
6 replies
WWasp-lang
β’Created by JLegendz on 5/31/2024 in #πquestions
useQuery server side?
I am trying to use one of my queries inside of my websocket server but when I do, the context.user doesn't exist. Even if I make sure that I'm calling this query after the user is authenticated. I'm not sure why context.user isn't populated, but it got me to thinking if maybe I should only be using the queries from the client side? Surely there's a way to do it server side though?
I have this query:
app/src/server/queries.ts
and in my ws-server.ts I'm attempting to use it like this.
The end goal of all this is to emit a signal when the user is authenticated, so that I can make sure that context.user exists, and then I can add the user back into any websocket rooms they belong to as a way to persist that connection between server restarts during development.
I always get a 401 no matter what though, and context.user just doesn't exist. Any suggestions here? I'm not sure what I'm doing wrong.
7 replies
WWasp-lang
β’Created by JLegendz on 5/30/2024 in #πquestions
Safe to do major prisma update?
My console informed me that there is a major Prima update available. Is it safe to update?
8 replies
WWasp-lang
β’Created by JLegendz on 5/28/2024 in #πquestions
API Authentication
Is there a good example of how to add an api endpoint for authentication? I'm primarily using username and password for now but eventually I'd like make use of all the authentication methods provided by wasp, but through an api.
64 replies
WWasp-lang
β’Created by JLegendz on 5/28/2024 in #πquestions
Accessing API endpoing from postman
After following the API tutorial, I attempted to post a GET request to http://localhost:3000/foo/bar and the response is just the web-app/index.html file.
When following the tutorial example of using the api from the client, I successfully get my data:
import React, { useEffect } from "react";
import { api } from "wasp/client/api";
async function fetchCustomRoute() {
const res = await api.get("/foo/bar");
console.log(res.data);
}
export const Foo = () => {
useEffect(() => {
fetchCustomRoute();
}, []);
return <>// ...</>;
};
But I'm still not able to get it from postman, am I misunderstanding something?
14 replies
WWasp-lang
β’Created by JLegendz on 5/27/2024 in #πquestions
websocket definition?
I've been trying to follow along with https://wasp-lang.dev/blog/2023/08/09/build-real-time-voting-app-websockets-react-typescript and https://wasp-lang.dev/docs/advanced/web-sockets to get websockets working with the open-saas demo app template.
When I attempt to use
in my app/src/server/ws-server.ts file, it's not able to find wasp/websocket. I searched and it doesn't appear to exist but I'm hoping I'm wrong.
Are websockets setup to work on the open saas template?
10 replies
WWasp-lang
β’Created by JLegendz on 5/27/2024 in #πquestions
New user fields not recognized
I'm attempting to add some attributes to my user entity that have a relation to other entity attributes.
subscriptions and claims are the new addition I'm adding.
On one of my pages where I'm already reading user.credits, I'm also trying to read user.subscriptions, but I get the following error:
[ Wasp ] ext-src/client/app/ListingDetailsPage.tsx(61,25): error TS2551: Property 'subscriptions' does not exist on type 'AuthUser'. Did you mean 'subscriptionTier'?
40 replies
WWasp-lang
β’Created by JLegendz on 5/26/2024 in #πquestions
React Native Integration
My SAAS app will have a mobile version. I'm using the dummy starter project for the web app, but when the time comes, I'll need to be able to do crud operations from my react native app. I know open-saas has a lot under the hood that makes web app development faster, but can I leverage any of this for my react-native app? I'm worried about how I might connect the mobile app to this one.
6 replies
WWasp-lang
β’Created by JLegendz on 5/26/2024 in #πquestions
adding node packages
Are there any special considerations when adding node packages to the dummy app starter template? Do I just wrong the npm install cli command and Iβm good or is there more that I need to do? Asking before I make a mess lol.
6 replies
WWasp-lang
β’Created by JLegendz on 5/26/2024 in #πquestions
New Wasp Entity Attributes Not included in CreateEntityName function
I have an Entity that I've added new attributes to. I've done this several times without any issues. But now, I've added a few attributes and i've run the command to refresh the db. But when I attempt to use the createEntityName function elsewhere, my new attributes aren't allowed as arguments.
12 replies
WWasp-lang
β’Created by JLegendz on 5/25/2024 in #πquestions
Get Download URL After Upload
Using the provided template, I'm having a hard time figuring out a good way to get the download url after uploading a file to s3. I know the template lists all of a user's files with a download button, but the logic there is a little confusing to follow. I have a form that uses the file upload functionality and that works fine, but I need to capture the download url before the form "submits". Could someone give me a hand with this? Lol even chatgpt doesn't handle this so well.
For context, I have a form to upload a post. The image for it needs to upload, provide a download link, that I can then store when I createPost(). Thanks in advance. And sorry if it's a noob question.
24 replies
WWasp-lang
β’Created by JLegendz on 5/24/2024 in #πquestions
File Upload (Tutorial Follow Along)
Hi! I'm following along with the tutorial https://docs.opensaas.sh/guides/file-uploading/ and I'm getting a 403 error after adding my IAM and S3 credentials to my .env.server
15 replies