Organized 'users' functionality vertically. (#226)

This commit is contained in:
Martin Šošić
2024-07-11 12:57:30 +02:00
committed by GitHub
parent 0e4e76ae88
commit a348a85660
16 changed files with 220 additions and 213 deletions

View File

@@ -26,7 +26,7 @@ To control which pages require users to be authenticated to access them, you can
route AccountRoute { path: "/account", to: AccountPage }
page AccountPage {
authRequired: true,
component: import Account from "@src/client/app/AccountPage"
component: import Account from "@src/user/AccountPage"
}
```

View File

@@ -64,9 +64,9 @@ Go to https://dashboard.stripe.com/test/settings/billing/portal in the Stripe Da
REACT_APP_STRIPE_CUSTOMER_PORTAL=<your-test-customer-portal-link>
```
Your Stripe customer portal link is imported into `src/client/app/AccountPage.tsx` and used to redirect users to the Stripe customer portal when they click the `Manage Subscription` button.
Your Stripe customer portal link is imported into `src/user/AccountPage.tsx` and used to redirect users to the Stripe customer portal when they click the `Manage Subscription` button.
```tsx title="src/client/app/AccountPage.tsx" {5} "import.meta.env.REACT_APP_STRIPE_CUSTOMER_PORTAL"
```tsx title="src/user/AccountPage.tsx" {5} "import.meta.env.REACT_APP_STRIPE_CUSTOMER_PORTAL"
function CustomerPortalButton() {
const handleClick = () => {
try {
@@ -115,4 +115,4 @@ You should see a message like this:
> Ready! You are using Stripe API Version [2023-08-16]. Your webhook signing secret is whsec_8a... (^C to quit)
```
copy this secret to your `.env.server` file under `STRIPE_WEBHOOK_SECRET=`.
copy this secret to your `.env.server` file under `STRIPE_WEBHOOK_SECRET=`.

View File

@@ -63,11 +63,12 @@ If you are using a version of the OpenSaaS template with Wasp `v0.11.x` or below
│   ├── server/ # Your server code (NodeJS) goes here.
│   ├── auth/ # All auth-related pages/components and logic.
│   ├── file-upload/ # Logic for uploading files to S3.
│   ── payment/ # Logic for handling Stripe payments and webhooks.
│   ── payment/ # Logic for handling Stripe payments and webhooks.
│   └── user/ # Logic related to users and their accounts.
├── .env.server # Dev environment variables for your server code.
├── .env.client # Dev environment variables for your client code.
├── .prettierrc # Prettier configuration.
├── tailwind.config.js # TailwindCSS configuration.
├── tailwind.config.js # TailwindCSS configuration.
├── package.json
├── package-lock.json
@@ -131,7 +132,7 @@ All you have to do is define your server-side functions in the `main.wasp` file,
  ├── workers # Functions that run in the background as Wasp Jobs, e.g. daily stats calculation.
  ├── actions.ts # Your server-side write/mutation functions.
   ├── queries.ts # Your server-side read functions.
   └── utils.ts
   └── utils.ts
```
## Main Features