VS
VS
WWasp-lang
Created by Sven on 11/14/2024 in #đŸ™‹questions
Do i need to set client env vars every deploy?
Definitely, I'm headed on vacation tomorrow, but I will definitely do this, there's so much I've learned. Wasp is awesome, Where is you all's by you a coffee link?
15 replies
WWasp-lang
Created by Sven on 11/14/2024 in #đŸ™‹questions
Do i need to set client env vars every deploy?
Yes! This was the issue, I'll remove that part as well from the deployment file, the workflow works and I can see it in Google analytics. I need to adjust the workflow as well so it doesn't download the newest wasp version as well. Thanks for your review, and hope I'm giving some good code for others
15 replies
WWasp-lang
Created by Sven on 11/14/2024 in #đŸ™‹questions
Do i need to set client env vars every deploy?
jk solved! Here's a github action that will work
name: appname

on:
push:
branches:
- "prod"
jobs:
deploy:
name: Deploy with Wasp
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Create .env.client file
run: |
echo "REACT_APP_GOOGLE_ANALYTICS_ID=${{ secrets.GOOGLE_ANALYTICS_ID }}" > .env.client

- uses: wasp-lang/deploy-action@main
env:
REACT_APP_GOOGLE_ANALYTICS_ID: ${{ secrets.GOOGLE_ANALYTICS_ID }}
with:
fly-token: ${{ secrets.FLY_TOKEN }}
name: appname

on:
push:
branches:
- "prod"
jobs:
deploy:
name: Deploy with Wasp
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Create .env.client file
run: |
echo "REACT_APP_GOOGLE_ANALYTICS_ID=${{ secrets.GOOGLE_ANALYTICS_ID }}" > .env.client

- uses: wasp-lang/deploy-action@main
env:
REACT_APP_GOOGLE_ANALYTICS_ID: ${{ secrets.GOOGLE_ANALYTICS_ID }}
with:
fly-token: ${{ secrets.FLY_TOKEN }}
15 replies
WWasp-lang
Created by Sven on 11/14/2024 in #đŸ™‹questions
Do i need to set client env vars every deploy?
@miho ah would you mind just sanity checking this? I would image this would work, but I only see it working on my localhost (I see analytics on localhost, but not on my website)
15 replies
WWasp-lang
Created by varo on 10/23/2024 in #đŸ™‹questions
Change auth UI text (Different language)
For others, this is the exact code to put in your css .relative.z-10.flex-auto.bg-primary.px-4.py-10.shadow-2xl h2[class^="c-"] { display: none !important; margin-top: -2rem; }
18 replies
WWasp-lang
Created by chilled_techie on 11/15/2024 in #đŸ™‹questions
Landing Page doesn't display
did you turn off ublock origin?
13 replies
WWasp-lang
Created by Sven on 11/14/2024 in #đŸ™‹questions
Do i need to set client env vars every deploy?
(I'll test this a few times and report back)
15 replies
WWasp-lang
Created by Killshot on 3/6/2024 in #đŸ™‹questions
Need Recommendations
at anyone who is interested, react- email is actually a great substitute rather than pasting pure html in your code. The emails.ts is a bit annoying as the email only accepts a Promise, but got it to work by this code
import { type GetVerificationEmailContentFn, type GetPasswordResetEmailContentFn } from 'wasp/server/auth';
import { VerificationEmail } from './templates/VerificationEmail';
import { PasswordResetEmail } from './templates/PasswordResetEmail';
import { render } from '@react-email/render';
import React from 'react';

let VERIFICATION_TEMPLATE: string;
let PASSWORD_RESET_TEMPLATE: string;

// Initialize templates
Promise.all([
render(React.createElement(VerificationEmail, { verificationLink: '{{VERIFICATION_LINK}}' })),
render(React.createElement(PasswordResetEmail, { passwordResetLink: '{{PASSWORD_RESET_LINK}}' }))
]).then(([verificationHtml, passwordResetHtml]) => {
VERIFICATION_TEMPLATE = verificationHtml.toString();
PASSWORD_RESET_TEMPLATE = passwordResetHtml.toString();
});

export const getVerificationEmailContent: GetVerificationEmailContentFn = ({ verificationLink }) => {
if (!VERIFICATION_TEMPLATE) {
throw new Error('Email template not initialized');
}
const html = VERIFICATION_TEMPLATE.replace('{{VERIFICATION_LINK}}', verificationLink);

import { type GetVerificationEmailContentFn, type GetPasswordResetEmailContentFn } from 'wasp/server/auth';
import { VerificationEmail } from './templates/VerificationEmail';
import { PasswordResetEmail } from './templates/PasswordResetEmail';
import { render } from '@react-email/render';
import React from 'react';

let VERIFICATION_TEMPLATE: string;
let PASSWORD_RESET_TEMPLATE: string;

// Initialize templates
Promise.all([
render(React.createElement(VerificationEmail, { verificationLink: '{{VERIFICATION_LINK}}' })),
render(React.createElement(PasswordResetEmail, { passwordResetLink: '{{PASSWORD_RESET_LINK}}' }))
]).then(([verificationHtml, passwordResetHtml]) => {
VERIFICATION_TEMPLATE = verificationHtml.toString();
PASSWORD_RESET_TEMPLATE = passwordResetHtml.toString();
});

export const getVerificationEmailContent: GetVerificationEmailContentFn = ({ verificationLink }) => {
if (!VERIFICATION_TEMPLATE) {
throw new Error('Email template not initialized');
}
const html = VERIFICATION_TEMPLATE.replace('{{VERIFICATION_LINK}}', verificationLink);

I made an admin page where you can see the email template you use, before you send them. This has the benefits of react-email and of sendgrid's analytics
15 replies
WWasp-lang
Created by Sven on 11/14/2024 in #đŸ™‹questions
Do i need to set client env vars every deploy?
Would this github action work?
name: myapp

on:
push:
branches:
- "prod"
jobs:
deploy:
name: Deploy with Wasp
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Create .env.client file
run: |
echo "REACT_APP_GOOGLE_ANALYTICS_ID=${{ secrets.GOOGLE_ANALYTICS_ID }}" > .env.client

- uses: wasp-lang/deploy-action@main
with:
fly-token: ${{ secrets.FLY_TOKEN }}
name: myapp

on:
push:
branches:
- "prod"
jobs:
deploy:
name: Deploy with Wasp
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Create .env.client file
run: |
echo "REACT_APP_GOOGLE_ANALYTICS_ID=${{ secrets.GOOGLE_ANALYTICS_ID }}" > .env.client

- uses: wasp-lang/deploy-action@main
with:
fly-token: ${{ secrets.FLY_TOKEN }}
Claude says Value: Your Google Analytics ID (e.g., G-1234567890) The workflow will now: Checkout your code Create a .env.client file with your Google Analytics ID from GitHub secrets Deploy using the Wasp deploy action This way, your analytics ID will be securely stored in GitHub secrets and automatically included during each deployment, without being committed to your repository. Make sure to add .env.client to your .gitignore file if you haven't already to prevent any local versions from being committed:
15 replies
WWasp-lang
Created by Killshot on 3/6/2024 in #đŸ™‹questions
Need Recommendations
Mmm I don't think I agree, your website is great -- you're definitely a developer now! Also, the defining an html and so I don't think is clean, but maybe that's the way to go for the start. Claude is pushing down the path to use react-email which I guess I will use, but I really don't like the idea of making email campaigns in my codebase - I don't think it's a clean situation.
15 replies
WWasp-lang
Created by Killshot on 3/6/2024 in #đŸ™‹questions
Need Recommendations
Hmm still I think we're going down two paths, simply put how do you interact with your database and sendgrid to send emails and newsletters? You could define html and send that in wasp, but I find that rather low level
15 replies
WWasp-lang
Created by NEROX on 11/14/2024 in #đŸ™‹questions
Navigating with /names/ instead /ids/
Also to add maybe some things like these as well if (!post) { throw new HttpError(404, 'Exam not found'); } // Check if the user has permission to view this exam if (exam.userId !== context.user?.id ) { if (!token) { throw new HttpError(403, 'You do not have permission to view this post'); } } return post; };
14 replies
WWasp-lang
Created by Killshot on 3/6/2024 in #đŸ™‹questions
Need Recommendations
Oh perhaps this is different that what I mean, the user has newsletter activated by default, or subscribes to the newsletter. I should somehow make a newsletter campaign and send email without having to do to work in the email.ts file that comes via wasp or? I think that's a bit low level. Defining the html there and sending it via a job Also keeping track of newsletter unsubscribe and so is not things I've thought about
15 replies
WWasp-lang
Created by Killshot on 3/6/2024 in #đŸ™‹questions
Need Recommendations
Do you all manually dump your database to a csv to find out who subscribed to your newsletter, or how did you that?
15 replies
WWasp-lang
Created by NEROX on 11/13/2024 in #đŸ™‹questions
migrate found failed migrations in the target
I don't understand your question for dev it is dummy for prod it is SendGrid
48 replies
WWasp-lang
Created by NEROX on 11/13/2024 in #đŸ™‹questions
migrate found failed migrations in the target
Sure, i would recommend to use the GitHub action for prod and then when you have to nuke then use the commands I sent - did you get further with the google Analytics api?
48 replies
WWasp-lang
Created by NEROX on 11/13/2024 in #đŸ™‹questions
migrate found failed migrations in the target
You will need these commands when you make breaking changes fly ssh console -a yourappname-server find where schema.prisma is (cd .. to db) npx prisma migrate reset --force npx prisma migrate dev --name init npx prisma migrate deploy This resets your database and forces a new migration. Don't do this when you have data you need to save, this removes all users too. I'm still in development and make breaking changes quite often where I have to nuke my local database, this is to nuke your prod database too
48 replies
WWasp-lang
Created by NEROX on 11/13/2024 in #đŸ™‹questions
migrate found failed migrations in the target
When you push to prod it would auto update your website and run that command (database merge) via GitHub actions
48 replies
WWasp-lang
Created by NEROX on 11/13/2024 in #đŸ™‹questions
migrate found failed migrations in the target
You don't use the GitHub action?
48 replies
WWasp-lang
Created by NEROX on 11/6/2024 in #đŸ™‹questions
Error calculating daily stats Production
If you want to make a guide when you've integrated everything - i wouldn't oppose đŸ‘€đŸ‘€
71 replies