diff --git a/opensaas-sh/app_diff/README.md.diff b/opensaas-sh/app_diff/README.md.diff index 29c3cafe..fe343f70 100644 --- a/opensaas-sh/app_diff/README.md.diff +++ b/opensaas-sh/app_diff/README.md.diff @@ -11,22 +11,24 @@ ## UI Components -@@ -8,9 +10,20 @@ +@@ -8,9 +10,22 @@ ## Development +### .env files ++ +`.env.client` file is versioned, but `.env.server` file you have to obtain by running `npm run env:pull`, since it has secrets in it. +This will generate `.env.server` based on the `.env.vault`. +We are using https://vault.dotenv.org to power this and have an account/organization up there. +If you modify .env.server and want to persist the changes (for yourself and for the other team members), do `npm run env:push`. + ### Running locally - - Make sure you have the `.env.client` and `.env.server` files with correct dev values in the root of the project. - - Run the database with `wasp start db` and leave it running. - - Run `wasp start` and leave it running. - - [OPTIONAL]: If this is the first time starting the app, or you've just made changes to your entities/prisma schema, also run `wasp db migrate-dev`. + - Make sure you have the `.env.client` and `.env.server` files with correct dev values in the root of the project. + - Run the database with `wasp start db` and leave it running. + - Run `wasp start` and leave it running. + - [OPTIONAL]: If this is the first time starting the app, or you've just made changes to your entities/prisma schema, also run `wasp db migrate-dev`. ++ +## Deployment + +This app is deployed to fly.io, Wasp org, via `wasp deploy fly deploy`. diff --git a/opensaas-sh/app_diff/package.json.diff b/opensaas-sh/app_diff/package.json.diff index b0e1ec57..5842a669 100644 --- a/opensaas-sh/app_diff/package.json.diff +++ b/opensaas-sh/app_diff/package.json.diff @@ -5,9 +5,9 @@ "name": "opensaas", "type": "module", + "scripts": { ++ "deploy": "REACT_APP_GOOGLE_ANALYTICS_ID=G-H3LSJCK95H wasp deploy fly deploy", + "env:pull": "npx dotenv-vault@latest pull development .env.server", -+ "env:push": "npx dotenv-vault@latest push development .env.server", -+ "deploy": "REACT_APP_GOOGLE_ANALYTICS_ID=G-H3LSJCK95H wasp deploy fly deploy" ++ "env:push": "npx dotenv-vault@latest push development .env.server" + }, "dependencies": { "@aws-sdk/client-s3": "^3.523.0", diff --git a/opensaas-sh/app_diff/src/admin/dashboards/users/UsersTable.tsx.diff b/opensaas-sh/app_diff/src/admin/dashboards/users/UsersTable.tsx.diff index 113ddf7d..328b919a 100644 --- a/opensaas-sh/app_diff/src/admin/dashboards/users/UsersTable.tsx.diff +++ b/opensaas-sh/app_diff/src/admin/dashboards/users/UsersTable.tsx.diff @@ -1,11 +1,11 @@ --- template/app/src/admin/dashboards/users/UsersTable.tsx +++ opensaas-sh/app/src/admin/dashboards/users/UsersTable.tsx -@@ -254,7 +254,7 @@ -

{user.subscriptionStatus}

+@@ -302,7 +302,7 @@ -
--

{user.paymentProcessorUserId}

-+

{user.subscriptionStatus}

+
+

+- {user.paymentProcessorUserId} ++ {user.subscriptionStatus} +

-
-
+
diff --git a/opensaas-sh/app_diff/src/analytics/providers/plausibleAnalyticsUtils.ts.diff b/opensaas-sh/app_diff/src/analytics/providers/plausibleAnalyticsUtils.ts.diff index 0b05d41f..fc3ae9f8 100644 --- a/opensaas-sh/app_diff/src/analytics/providers/plausibleAnalyticsUtils.ts.diff +++ b/opensaas-sh/app_diff/src/analytics/providers/plausibleAnalyticsUtils.ts.diff @@ -7,23 +7,23 @@ - `${PLAUSIBLE_BASE_URL}/v1/stats/aggregate?site_id=${PLAUSIBLE_SITE_ID}&metrics=pageviews`, + `${PLAUSIBLE_BASE_URL}/v1/stats/aggregate?site_id=${PLAUSIBLE_SITE_ID}&metrics=pageviews&with_imported=true`, { - method: 'GET', + method: "GET", headers: { -@@ -80,7 +80,7 @@ +@@ -90,7 +90,7 @@ } async function getPageviewsForDate(date: string) { - const url = `${PLAUSIBLE_BASE_URL}/v1/stats/aggregate?site_id=${PLAUSIBLE_SITE_ID}&period=day&date=${date}&metrics=pageviews`; + const url = `${PLAUSIBLE_BASE_URL}/v1/stats/aggregate?site_id=${PLAUSIBLE_SITE_ID}&period=day&date=${date}&metrics=pageviews&with_imported=true`; const response = await fetch(url, { - method: 'GET', + method: "GET", headers: headers, -@@ -93,7 +93,7 @@ +@@ -103,7 +103,7 @@ } export async function getSources() { - const url = `${PLAUSIBLE_BASE_URL}/v1/stats/breakdown?site_id=${PLAUSIBLE_SITE_ID}&property=visit:source&metrics=visitors`; + const url = `${PLAUSIBLE_BASE_URL}/v1/stats/breakdown?site_id=${PLAUSIBLE_SITE_ID}&property=visit:source&metrics=visitors&with_imported=true`; const response = await fetch(url, { - method: 'GET', + method: "GET", headers: headers, diff --git a/opensaas-sh/app_diff/src/analytics/stats.ts.diff b/opensaas-sh/app_diff/src/analytics/stats.ts.diff index 736bdca6..58361dfb 100644 --- a/opensaas-sh/app_diff/src/analytics/stats.ts.diff +++ b/opensaas-sh/app_diff/src/analytics/stats.ts.diff @@ -1,38 +1,44 @@ --- template/app/src/analytics/stats.ts +++ opensaas-sh/app/src/analytics/stats.ts -@@ -2,11 +2,9 @@ - import { type DailyStatsJob } from 'wasp/server/jobs'; - import Stripe from 'stripe'; - import { stripe } from '../payment/stripe/stripeClient'; --import { listOrders } from '@lemonsqueezy/lemonsqueezy.js'; - import { getDailyPageViews, getSources } from './providers/plausibleAnalyticsUtils'; --// import { getDailyPageViews, getSources } from './providers/googleAnalyticsUtils'; --import { paymentProcessor } from '../payment/paymentProcessor'; - import { SubscriptionStatus } from '../payment/plans'; -+// import { getDailyPageViews, getSources } from './providers/googleAnalyticsUtils'; +@@ -1,15 +1,13 @@ +-import { listOrders } from "@lemonsqueezy/lemonsqueezy.js"; + import Stripe from "stripe"; + import { type DailyStats } from "wasp/entities"; + import { type DailyStatsJob } from "wasp/server/jobs"; ++import { SubscriptionStatus } from "../payment/plans"; + import { stripe } from "../payment/stripe/stripeClient"; + import { + getDailyPageViews, + getSources, + } from "./providers/plausibleAnalyticsUtils"; + // import { getDailyPageViews, getSources } from './providers/googleAnalyticsUtils'; +-import { paymentProcessor } from "../payment/paymentProcessor"; +-import { SubscriptionStatus } from "../payment/plans"; - export type DailyStatsProps = { dailyStats?: DailyStats; weeklyStats?: DailyStats[]; isLoading?: boolean }; - -@@ -42,17 +40,7 @@ + export type DailyStatsProps = { + dailyStats?: DailyStats; +@@ -52,19 +50,7 @@ paidUserDelta -= yesterdaysStats.paidUserCount; } - let totalRevenue; - switch (paymentProcessor.id) { -- case 'stripe': +- case "stripe": - totalRevenue = await fetchTotalStripeRevenue(); - break; -- case 'lemonsqueezy': +- case "lemonsqueezy": - totalRevenue = await fetchTotalLemonSqueezyRevenue(); - break; - default: -- throw new Error(`Unsupported payment processor: ${paymentProcessor.id}`); +- throw new Error( +- `Unsupported payment processor: ${paymentProcessor.id}`, +- ); - } + let totalRevenue = await fetchTotalStripeRevenue(); const { totalViews, prevDayViewsChangePercent } = await getDailyPageViews(); -@@ -163,38 +151,3 @@ +@@ -176,38 +162,3 @@ // Revenue is in cents so we convert to dollars (or your main currency unit) return totalRevenue / 100; } @@ -67,7 +73,7 @@ - // Revenue is in cents so we convert to dollars (or your main currency unit) - return totalRevenue / 100; - } catch (error) { -- console.error('Error fetching Lemon Squeezy revenue:', error); +- console.error("Error fetching Lemon Squeezy revenue:", error); - throw error; - } -} diff --git a/opensaas-sh/app_diff/src/auth/email-and-pass/emails.ts.diff b/opensaas-sh/app_diff/src/auth/email-and-pass/emails.ts.diff deleted file mode 100644 index 94716ba7..00000000 --- a/opensaas-sh/app_diff/src/auth/email-and-pass/emails.ts.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- template/app/src/auth/email-and-pass/emails.ts -+++ opensaas-sh/app/src/auth/email-and-pass/emails.ts -@@ -1,4 +1,4 @@ --import { type GetVerificationEmailContentFn, type GetPasswordResetEmailContentFn } from 'wasp/server/auth'; -+import { type GetPasswordResetEmailContentFn, type GetVerificationEmailContentFn } from 'wasp/server/auth'; - - export const getVerificationEmailContent: GetVerificationEmailContentFn = ({ verificationLink }) => ({ - subject: 'Verify your email', diff --git a/opensaas-sh/app_diff/src/auth/userSignupFields.ts.diff b/opensaas-sh/app_diff/src/auth/userSignupFields.ts.diff index 380e0bf8..5a9cfa39 100644 --- a/opensaas-sh/app_diff/src/auth/userSignupFields.ts.diff +++ b/opensaas-sh/app_diff/src/auth/userSignupFields.ts.diff @@ -1,14 +1,14 @@ --- template/app/src/auth/userSignupFields.ts +++ opensaas-sh/app/src/auth/userSignupFields.ts -@@ -1,7 +1,5 @@ --import { z } from 'zod'; - import { defineUserSignupFields } from 'wasp/auth/providers/types'; -- --const adminEmails = process.env.ADMIN_EMAILS?.split(',') || []; -+import { z } from 'zod'; +@@ -1,8 +1,6 @@ + import { defineUserSignupFields } from "wasp/auth/providers/types"; + import { z } from "zod"; +-const adminEmails = process.env.ADMIN_EMAILS?.split(",") || []; +- const emailDataSchema = z.object({ email: z.string(), + }); @@ -16,10 +14,6 @@ const emailData = emailDataSchema.parse(data); return emailData.email; @@ -20,7 +20,7 @@ }); const githubDataSchema = z.object({ -@@ -45,14 +39,6 @@ +@@ -48,14 +42,6 @@ const githubData = githubDataSchema.parse(data); return githubData.profile.login; }, @@ -35,7 +35,7 @@ }); // We are using the first email from the list of emails returned by GitHub. -@@ -85,13 +71,6 @@ +@@ -88,13 +74,6 @@ const googleData = googleDataSchema.parse(data); return googleData.profile.email; }, @@ -49,7 +49,7 @@ }); export function getGoogleAuthConfig() { -@@ -121,13 +100,6 @@ +@@ -126,13 +105,6 @@ const discordData = discordDataSchema.parse(data); return discordData.profile.username; }, diff --git a/opensaas-sh/app_diff/src/client/Main.css.diff b/opensaas-sh/app_diff/src/client/Main.css.diff index a921b01b..819a2242 100644 --- a/opensaas-sh/app_diff/src/client/Main.css.diff +++ b/opensaas-sh/app_diff/src/client/Main.css.diff @@ -1,61 +1,69 @@ --- template/app/src/client/Main.css +++ opensaas-sh/app/src/client/Main.css -@@ -44,6 +44,15 @@ +@@ -56,6 +56,23 @@ .border-gradient-primary > * { background: hsl(var(--background)); } + + /* Radial gradient utilities */ + .bg-radial-gradient { -+ background: radial-gradient(circle at 30% 30%, hsl(var(--card-accent)/0.5) 0%, hsl(var(--accent)/0.15) 100%); ++ background: radial-gradient( ++ circle at 30% 30%, ++ hsl(var(--card-accent) / 0.5) 0%, ++ hsl(var(--accent) / 0.15) 100% ++ ); + } -+ ++ + .dark .bg-radial-gradient { -+ background: radial-gradient(circle at 30% 30%, hsl(var(--card-subtle)/0.8) 0%, hsl(var(--card)) 100%); ++ background: radial-gradient( ++ circle at 30% 30%, ++ hsl(var(--card-subtle) / 0.8) 0%, ++ hsl(var(--card)) 100% ++ ); + } } /* Here is an example of how to add a custom font. -@@ -51,6 +60,16 @@ +@@ -63,6 +80,16 @@ * They are defined first here, then need to be referenced in the tailwind.config.js file * under `theme.extend.fontFamily`, and then can be used as a tailwind class, e.g. className='font-satoshi'. */ + +/* Satoshi Font Family */ +@font-face { -+ font-family: 'Satoshi'; -+ src: url('/fonts/Satoshi-Light.woff2') format('woff2'); ++ font-family: "Satoshi"; ++ src: url("/fonts/Satoshi-Light.woff2") format("woff2"); + font-weight: 300; + font-style: normal; + font-display: swap; +} + @font-face { - font-family: 'Satoshi'; - src: url('/fonts/Satoshi-Regular.woff2') format('woff2'); -@@ -59,6 +78,30 @@ + font-family: "Satoshi"; + src: url("/fonts/Satoshi-Regular.woff2") format("woff2"); +@@ -71,6 +98,30 @@ font-display: swap; } +@font-face { -+ font-family: 'Satoshi'; -+ src: url('/fonts/Satoshi-Medium.woff2') format('woff2'); ++ font-family: "Satoshi"; ++ src: url("/fonts/Satoshi-Medium.woff2") format("woff2"); + font-weight: 500; + font-style: normal; + font-display: swap; +} + +@font-face { -+ font-family: 'Satoshi'; -+ src: url('/fonts/Satoshi-Bold.woff2') format('woff2'); ++ font-family: "Satoshi"; ++ src: url("/fonts/Satoshi-Bold.woff2") format("woff2"); + font-weight: bold; + font-style: normal; + font-display: swap; +} + +@font-face { -+ font-family: 'Satoshi'; -+ src: url('/fonts/Satoshi-Black.woff2') format('woff2'); ++ font-family: "Satoshi"; ++ src: url("/fonts/Satoshi-Black.woff2") format("woff2"); + font-weight: 900; + font-style: normal; + font-display: swap; @@ -64,21 +72,26 @@ /* third-party libraries CSS */ .tableCheckbox:checked ~ div span { -@@ -177,4 +220,17 @@ +@@ -189,4 +240,22 @@ body { @apply bg-background text-foreground; } -+ ++ + /* Global typography styles */ -+ h1, h2, h3, h4, h5, h6 { ++ h1, ++ h2, ++ h3, ++ h4, ++ h5, ++ h6 { + @apply font-satoshi font-black leading-tight; + } -+ ++ + p { + @apply font-mono text-base leading-relaxed; + } +} + +.navbar-maxwidth-transition { -+ transition: max-width 300ms cubic-bezier(0.4,0,0.2,1); ++ transition: max-width 300ms cubic-bezier(0.4, 0, 0.2, 1); } diff --git a/opensaas-sh/app_diff/src/client/components/NavBar/Announcement.tsx.diff b/opensaas-sh/app_diff/src/client/components/NavBar/Announcement.tsx.diff index 3ca1f9fa..d2e37135 100644 --- a/opensaas-sh/app_diff/src/client/components/NavBar/Announcement.tsx.diff +++ b/opensaas-sh/app_diff/src/client/components/NavBar/Announcement.tsx.diff @@ -1,43 +1,44 @@ --- template/app/src/client/components/NavBar/Announcement.tsx +++ opensaas-sh/app/src/client/components/NavBar/Announcement.tsx -@@ -1,32 +1,33 @@ --const ANNOUNCEMENT_URL = 'https://github.com/wasp-lang/wasp'; -+const ANNOUNCEMENT_URL = 'https://x.com/hot_town/status/1950117243246821770'; +@@ -1,32 +1,34 @@ +-const ANNOUNCEMENT_URL = "https://github.com/wasp-lang/wasp"; ++const ANNOUNCEMENT_URL = "https://x.com/hot_town/status/1950117243246821770"; export function Announcement() { -+ const launchDate = new Date('2025-07-29T00:00:00-07:00'); ++ const launchDate = new Date("2025-07-29T00:00:00-07:00"); + const today = new Date(); -+ const hasLaunched = today.toISOString().slice(0, 10) >= launchDate.toISOString().slice(0, 10); ++ const hasLaunched = ++ today.toISOString().slice(0, 10) >= launchDate.toISOString().slice(0, 10); + return ( --
-+
+-
++
- Support Open-Source Software! -+ 🚀 Open SaaS v2.0 {hasLaunched ? 'is here!' : 'launches tomorrow!'} ++ 🚀 Open SaaS v2.0 {hasLaunched ? "is here!" : "launches tomorrow!"} -
+
- Star Our Repo on Github ⭐️ → -+ {hasLaunched ? 'Check out the Launch 🎉' : 'Get notified! 📆'} → ++ {hasLaunched ? "Check out the Launch 🎉" : "Get notified! 📆"} → - ⭐️ Star the Our Repo and Support Open-Source! ⭐️ + 🎉 The Open SaaS v2.0 Launch is Live! 🚀 diff --git a/opensaas-sh/app_diff/src/client/components/NavBar/NavBar.tsx.diff b/opensaas-sh/app_diff/src/client/components/NavBar/NavBar.tsx.diff index 5f400ecd..d5621264 100644 --- a/opensaas-sh/app_diff/src/client/components/NavBar/NavBar.tsx.diff +++ b/opensaas-sh/app_diff/src/client/components/NavBar/NavBar.tsx.diff @@ -1,57 +1,52 @@ --- template/app/src/client/components/NavBar/NavBar.tsx +++ opensaas-sh/app/src/client/components/NavBar/NavBar.tsx @@ -3,6 +3,7 @@ - import { Link as ReactRouterLink } from 'react-router-dom'; - import { useAuth } from 'wasp/client/auth'; - import { Link as WaspRouterLink, routes } from 'wasp/client/router'; -+import { Button } from '../../../components/ui/button'; - import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from '../../../components/ui/sheet'; - import { cn } from '../../../lib/utils'; - import { throttleWithTrailingInvocation } from '../../../shared/utils'; -@@ -11,6 +12,7 @@ - import { useIsLandingPage } from '../../hooks/useIsLandingPage'; - import logo from '../../static/logo.webp'; - import DarkModeSwitcher from '../DarkModeSwitcher'; -+import RepoInfo from '../RepoInfo'; - import { Announcement } from './Announcement'; + import { Link as ReactRouterLink } from "react-router-dom"; + import { useAuth } from "wasp/client/auth"; + import { Link as WaspRouterLink, routes } from "wasp/client/router"; ++import { Button } from "../../../components/ui/button"; + import { + Sheet, + SheetContent, +@@ -17,6 +18,7 @@ + import { useIsLandingPage } from "../../hooks/useIsLandingPage"; + import logo from "../../static/logo.webp"; + import DarkModeSwitcher from "../DarkModeSwitcher"; ++import RepoInfo from "../RepoInfo"; + import { Announcement } from "./Announcement"; export interface NavigationItem { -@@ -38,7 +40,12 @@ - return ( - <> - {isLandingPage && } --
-+
+@@ -51,7 +53,7 @@ +
-