Skip to content

Commit 20be866

Browse files
Wardbox/revamp (#52)
* Add claude.md, update wasp version to 0.19.x * Sets up core project structure Initializes the basic project layout with authentication, payments, UI components, and animations. Adds a landing page with feature showcases and a call to action. Configures Stripe for subscription payments. Includes authentication flow. Sets up a default theme. * Update src/client/components/CLAUDE.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Enhances landing page accessibility and updates node version Improves the landing page's accessibility by disabling animations for users who prefer reduced motion. Updates the Node.js version used in the format workflow. * Updates documentation for motion and payment Updates documentation to improve clarity and provide better instructions for setting up webhooks. * Simplifies landing page animations Refactors animation logic on the landing page for improved clarity and maintainability. Removes the explicit fadeIn animation variant and leverages staggerItem for a more cohesive animation strategy across different sections. This also reduces animation code duplication. * use reduced motion component * Simplifies motion handling on landing page Removes the `useReducedMotion` check from the landing page component, relying instead on the global `MotionConfig` within the `MotionProvider`. This change centralizes motion reduction logic, making the landing page code cleaner and easier to maintain. * Dynamically renders landing page features Replaces static feature cards with a dynamically rendered list. This makes it easier to add, remove, or modify features on the landing page. --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 33f30fc commit 20be866

25 files changed

+10774
-6488
lines changed

.github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
- uses: actions/setup-node@v4.1.0
1919
with:
20-
node-version: '20.x'
20+
node-version: '22.x'
2121
cache: 'npm'
2222

2323
- name: Setup Wasp

CLAUDE.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with
4+
code in this repository.
5+
6+
## Project Overview
7+
8+
Roke is a Wasp starter template with shadcn/ui components, Motion animations,
9+
and TypeScript support. It uses Wasp ^0.19.x as the full-stack framework.
10+
11+
## Development Commands
12+
13+
```bash
14+
# Start database (required first)
15+
wasp db start
16+
17+
# Run migrations
18+
wasp db migrate-dev
19+
20+
# Start development server
21+
wasp start
22+
23+
# Format code
24+
npm run format
25+
```
26+
27+
## Architecture
28+
29+
### Wasp Configuration
30+
31+
- `main.wasp` - Central configuration for routes, pages, actions, queries, and
32+
APIs
33+
- `schema.prisma` - Database entities (Prisma models)
34+
- Always define operations in `main.wasp` first, then implement in feature's
35+
`operations.ts`
36+
37+
### Feature-Based Structure
38+
39+
```
40+
src/
41+
├── auth/ # Authentication pages and logic
42+
├── landing/ # Landing page
43+
├── payment/ # Stripe integration
44+
│ └── stripe/ # Stripe operations, webhooks, service
45+
├── root-components/ # Global components (nav, footer, theme)
46+
├── client/components/ui/ # shadcn/ui components
47+
├── motion/ # Motion animation config and components
48+
├── hooks/ # Custom React hooks
49+
└── lib/ # Utilities and setup
50+
```
51+
52+
Each feature folder typically contains:
53+
54+
- `FeaturePage.tsx` - Page components
55+
- `operations.ts` - Actions and queries
56+
- `components/` - Feature-specific components
57+
58+
### Creating New Operations
59+
60+
When adding new queries/actions:
61+
62+
1. Define in `main.wasp` first:
63+
64+
```wasp
65+
query getSomething {
66+
fn: import { getSomething } from "@src/feature/operations",
67+
entities: [Entity1, Entity2]
68+
}
69+
```
70+
71+
2. Implement in `feature/operations.ts`:
72+
73+
```typescript
74+
import { HttpError } from 'wasp/server'
75+
import type { GetSomething } from 'wasp/server/operations'
76+
77+
export const getSomething = (async (args, context) => {
78+
if (!context.user) {
79+
throw new HttpError(401, 'Unauthorized')
80+
}
81+
82+
return context.entities.Something.findMany()
83+
}) satisfies GetSomething
84+
85+
// Export response type for components
86+
export type GetSomethingResponse = Awaited<ReturnType<typeof getSomething>>
87+
```
88+
89+
**Critical points:**
90+
91+
- Use `satisfies GetSomething` pattern (not `GetSomething = async`)
92+
- Export response type with `Awaited<ReturnType<...>>` for component props
93+
- Include authorization checks when needed
94+
95+
### Wasp Conventions
96+
97+
- Add new entities to `schema.prisma`, not `main.wasp`
98+
- Store operations in `feature/operations.ts` files
99+
- Use Wasp's `Link` component for internal navigation
100+
- Organize by features, not technical layers
101+
102+
## Key Conventions
103+
104+
### Imports
105+
106+
- Wasp: `import { Entity } from 'wasp/entities'`,
107+
`import { type Op } from 'wasp/server/operations'`
108+
- Motion: `import { motion } from 'motion/react'` (not framer-motion)
109+
- React hooks directly: `import { useState } from 'react'` (no React default
110+
import)
111+
- Use relative imports in src (no @ alias)
112+
113+
### Styling
114+
115+
- Tailwind CSS with semantic color naming (e.g., `text-destructive` not
116+
`text-red-500`)
117+
- Icons: `@phosphor-icons/react`
118+
- Mobile-first approach
119+
120+
### Forms
121+
122+
- React Hook Form with Zod validation
123+
- shadcn/ui Form components
124+
125+
### Code Style
126+
127+
- No semicolons, single quotes, JSX single quotes
128+
- No comments unless describing complex logic
129+
- Dependencies via `npm install` (not in main.wasp)
130+
131+
### Database Changes
132+
133+
- Forward-only migrations (never rename fields directly)
134+
- Run `wasp db migrate-dev` after schema.prisma changes

README.md

Lines changed: 80 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,107 @@
22

33
A Wasp starter with sensible defaults.
44

5-
## What's he building in there?
5+
## What's Included
66

7-
I built Roke because I was tired of repeating the same setup ritual for every
8-
new Wasp project. Instead of continuing that cycle, I created the starting point
9-
I always wished I had.
10-
11-
## Philosophy
12-
13-
While most starters give you an empty canvas, Roke provides opinionated defaults
14-
that reflect how modern web apps are actually built. It embraces shadcn/ui's
15-
principles of being "Accessible. Customizable. Open Source." and extends them to
16-
the entire project structure.
17-
18-
The goal isn't just to give you boilerplate - it's to provide a foundation that
19-
makes web development more enjoyable and accessible. Batteries included, but
20-
replaceable.
7+
- **Authentication** - Email/password with verification and password reset
8+
- **Payments** - Stripe subscriptions with checkout and customer portal
9+
- **UI Components** - shadcn/ui components (Button, Card, Dropdown, Sheet, etc.)
10+
- **Animations** - Motion spring animations with presets (snappy, bouncy, heavy)
11+
- **Dark Mode** - Theme toggle with system preference support
12+
- **TypeScript** - Full type safety throughout
2113

2214
## Getting Started
2315

24-
Click "Use this template" button at the top of the repository
16+
1. Click "Use this template" button at the top of the repository
17+
2. Clone your new repository
18+
3. Install dependencies and start:
2519

2620
```bash
27-
# Start the development server
21+
npm install
2822
wasp db start
2923
wasp db migrate-dev
3024
wasp start
3125
```
3226

33-
Visit [roke.dev](https://roke.dev) for comprehensive documentation.
34-
<br /> ![Format & Lint pipeline status](https://github.com/wardbox/roke/actions/workflows/format.yml/badge.svg)
35-
![Deployment pipeline status](https://github.com/wardbox/roke/actions/workflows/deploy.yml/badge.svg?branch=deploy)
27+
## Project Structure
28+
29+
```
30+
src/
31+
├── auth/ # Login, signup, password reset
32+
├── payment/ # Stripe subscriptions
33+
├── motion/ # Animation presets and provider
34+
├── landing/ # Home page (customize this!)
35+
├── client/components/ # shadcn/ui components
36+
└── root-components/ # Nav, footer, theme
37+
```
38+
39+
Each directory has a `CLAUDE.md` file explaining its purpose and how to
40+
customize it.
41+
42+
## Customization Checklist
43+
44+
1. **Landing page** - Edit `src/landing/LandingPage.tsx`
45+
2. **App name** - Set `REACT_APP_NAME` in `.env.client`
46+
3. **Meta tags** - Update `head` section in `main.wasp`
47+
4. **Auth emails** - Edit templates in `src/auth/email.ts`
48+
5. **Stripe** - Add keys to `.env.server` (see `src/payment/CLAUDE.md`)
49+
6. **Email provider** - Change from `Dummy` to SendGrid/Mailgun in `main.wasp`
50+
51+
## Key Files
52+
53+
| File | Purpose |
54+
| ---------------------------------- | -------------------------------------- |
55+
| `main.wasp` | Routes, pages, auth config, operations |
56+
| `schema.prisma` | Database models |
57+
| `src/landing/LandingPage.tsx` | Home page content |
58+
| `src/auth/email.ts` | Email templates |
59+
| `src/motion/transitionPresets.tsx` | Animation variants |
60+
61+
## Adding Features
62+
63+
### New Page
3664

37-
## Contributing
65+
1. Add route and page in `main.wasp`
66+
2. Create component in `src/`
67+
3. Add to nav if needed in `src/root-components/nav.tsx`
3868

39-
We welcome contributions! Whether it's:
69+
### New Database Model
4070

41-
- 🐛 Bug fixes
42-
- ✨ New features
43-
- 📝 Documentation improvements
44-
- 💡 Suggestions
71+
1. Add model to `schema.prisma`
72+
2. Run `wasp db migrate-dev`
73+
3. Create operations in `main.wasp` and implement in `src/`
4574

46-
Feel free to open an issue or submit a pull request.
75+
### New UI Component
76+
77+
```bash
78+
npx shadcn@latest add [component-name]
79+
```
80+
81+
## Environment Variables
82+
83+
### Client (`.env.client`)
84+
85+
```
86+
REACT_APP_NAME=Your App Name
87+
```
88+
89+
### Server (`.env.server`)
90+
91+
```
92+
DATABASE_URL=postgresql://...
93+
STRIPE_SECRET_KEY=sk_...
94+
STRIPE_PUBLISHABLE_KEY=pk_...
95+
STRIPE_PRICE_ID=price_...
96+
STRIPE_WEBHOOK_SECRET=whsec_...
97+
```
4798

4899
## Learn More
49100

50-
- [Documentation](https://roke.dev)
51101
- [Wasp Documentation](https://wasp-lang.dev)
52102
- [shadcn/ui](https://ui.shadcn.com)
53103
- [Motion](https://motion.dev)
104+
- [Phosphor Icons](https://phosphoricons.com)
54105

55106
## License
56107

57-
MIT License - feel free to use this in your own projects!
108+
MIT License - use this in your own projects!

main.wasp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
app roke {
22
wasp: {
3-
version: "^0.16.4"
3+
version: "^0.19.1"
44
},
55
title: "Roke: A Full-Stack Wasp Starter with Modern UI Components",
66
head: [
77
"<meta name='description' content='A comprehensive Wasp starter template featuring shadcn/ui components, Motion animations, and TypeScript support for building modern full-stack web applications.'>",
8-
8+
99
"<meta property='og:url' content='https://example.com'>",
1010
"<meta property='og:type' content='website'>",
1111
"<meta property='og:title' content='Roke: A Full-Stack Wasp Starter with Modern UI Components'>",
1212
"<meta property='og:description' content='A comprehensive Wasp starter template featuring shadcn/ui components, Motion animations, and TypeScript support for building modern full-stack web applications.'>",
1313
"<meta property='og:image' content='https://example.com/example.png'>",
14-
14+
1515
"<meta name='twitter:card' content='summary_large_image'>",
1616
"<meta property='twitter:domain' content='example.com'>",
1717
"<meta property='twitter:url' content='https://example.com'>",
@@ -50,7 +50,6 @@ app roke {
5050
}
5151
}
5252

53-
//#region Routes
5453
route Landing { path: "/", to: Landing }
5554
route Profile { path: "/profile", to: ProfilePage }
5655
route SubscriptionRoute { path: "/subscription", to: SubscriptionPage }
@@ -61,9 +60,7 @@ route RequestPasswordResetRoute { path: "/request-password-reset", to: RequestPa
6160
route PasswordResetRoute { path: "/password-reset", to: PasswordResetPage }
6261
route EmailVerificationRoute { path: "/email-verification", to: EmailVerificationPage }
6362
route NotFoundRoute { path: "*", to: NotFoundPage }
64-
//#endregion
6563

66-
//#region Pages
6764
page Landing {
6865
component: import Landing from "@src/landing/LandingPage",
6966
}
@@ -105,9 +102,7 @@ page CheckoutResultPage {
105102
page NotFoundPage {
106103
component: import NotFound from "@src/404Page"
107104
}
108-
//#endregion
109105

110-
//#region Stripe Actions
111106
action createCheckoutSession {
112107
fn: import { createCheckoutSession } from "@src/payment/stripe/operations",
113108
entities: [User]
@@ -117,13 +112,10 @@ action createCustomerPortalSession {
117112
fn: import { createCustomerPortalSession } from "@src/payment/stripe/operations",
118113
entities: [User]
119114
}
120-
//#endregion
121115

122-
//#region Stripe API
123116
api stripeWebhook {
124-
fn: import { handleStripeWebhook } from "@src/payment/stripe/webhooks.ts",
117+
fn: import { handleStripeWebhook } from "@src/payment/stripe/webhooks",
125118
middlewareConfigFn: import { stripeWebhookMiddlewareConfigFn } from "@src/payment/stripe/webhooks",
126119
httpRoute: (POST, "/stripe-webhooks"),
127120
entities: [User]
128121
}
129-
//#endregion

0 commit comments

Comments
 (0)