Skip to content

Commit 3f53410

Browse files
author
Divyansh Sharma
committed
Initial commit
0 parents  commit 3f53410

654 files changed

Lines changed: 71609 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

β€Ž.cursorrulesβ€Ž

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
## πŸ§‘β€πŸ’» Development Guidelines
2+
3+
This project follows **Next.js (App Router)** and is structured using **Feature-Sliced Design (FSD)** for modularity, scalability, and clear
4+
separation of concerns.
5+
6+
Use this prompt and coding standards to ensure consistency across the codebase:
7+
8+
---
9+
10+
### πŸ”§ Code Style and Structure
11+
12+
- Write concise, expressive, and idiomatic **TypeScript**
13+
- Use **functional programming** patterns (avoid classes and side effects)
14+
- Prefer **composition** over inheritance, and modularization over duplication
15+
- Organize each `feature/`, `entity/`, or `widget/` with:
16+
17+
- model/ β†’ logic (React Query, actions, hooks)
18+
- schema/ β†’ Zod schemas for validation ui/ β†’ client components (TSX)
19+
- lib/ β†’ pure helper functions
20+
- types/ β†’ interfaces & TS types
21+
22+
- All external dependencies (**API**, `localStorage`, `Date`) must be **abstracted** in `shared/lib/`
23+
- Avoid direct calls to:
24+
- `fetch` β†’ use actions or `shared/api/`
25+
- `new Date()` β†’ use `shared/lib/date` abstraction
26+
- `localStorage` β†’ wrap in `shared/lib/storage`
27+
28+
---
29+
30+
### 🧠 Naming Conventions
31+
32+
- Use `kebab-case` for **directories** (e.g. `features/auth/signup`)
33+
- Use **named exports** (no default exports for components)
34+
- Use descriptive names with **auxiliary verbs** (e.g. `isLoading`, `hasError`, `canSubmit`)
35+
- Components:
36+
- Pure UI: `src/components/ui/`
37+
- Shared logic: `src/shared/lib/`
38+
- Composition: `src/widgets/`
39+
40+
---
41+
42+
### πŸ“ TypeScript Usage
43+
44+
- Use `interface` over `type` for objects
45+
- Avoid `enum`; use `as const` object maps instead
46+
- Use `infer` and `z.infer<typeof schema>` for accurate form types
47+
- Types live in `types/` or colocated with usage
48+
49+
---
50+
51+
### πŸ“¦ Feature Architecture
52+
53+
**Keep React component logic inside the relevant feature:**
54+
55+
features/auth/signup/ β”œβ”€β”€ model/ β†’ useSignUp.ts, signup.action.ts β”œβ”€β”€ schema/ β†’ signup.schema.ts β”œβ”€β”€ ui/ β†’ signup-form.tsx
56+
57+
If reusable between many features (e.g. `User`, `Link`, `Session`), move logic to `entities/`.
58+
59+
---
60+
61+
### πŸ§ͺ Error Handling & Validation
62+
63+
- Use **Zod** for schema validation
64+
- Prefer early returns & guard clauses
65+
- Use `ActionError` in server actions and handle them with `next-safe-action`
66+
- Wrap React components in `ErrorBoundary` (or `shared/ui/ErrorBoundaries.tsx`)
67+
- Display user-friendly errors via `toast()` or `<Alert />`
68+
69+
---
70+
71+
### πŸ’… UI & Styling
72+
73+
- Use **Shadcn UI**, **Radix**, and **Tailwind CSS** with **mobile-first** responsive design
74+
- Design theme:
75+
76+
- **Minimal**, professional with a **slightly playful touch**
77+
- Inspired by **Apple**, tailored to fitness coaches
78+
- Emphasize visuals: badges, progress bars, illustrations
79+
- Use `lucide-react` icons, subtle borders, hover feedback
80+
- Avoid drop shadows; prefer light borders and soft hover effects
81+
82+
- Animations:
83+
84+
- Elegant and performant (use `framer-motion` if needed)
85+
- Use `transition`, `duration-xxx`, and `ease-xxx` from Tailwind
86+
87+
- UX Principles:
88+
89+
- Clear hierarchy
90+
- Responsive: no overflow, no overlap
91+
- All buttons and interactive elements should provide feedback
92+
- Use @tailwind.config.ts for the theme.
93+
94+
- **UI Stack**:
95+
96+
- **Shadcn UI**, **Radix UI**, and **Tailwind CSS** (mobile-first approach)
97+
- Icons: **lucide-react**
98+
99+
- **Design Language**:
100+
101+
- 🎨 **Modern & minimalist**, inspired by **Apple’s design system**, with a **slightly more colorful palette**
102+
- Interface should be **clean**, **cohesive**, and **functional** without sacrificing features
103+
- Avoid drop shadows; prefer **subtle borders** where relevant
104+
- Ensure a **clear visual hierarchy** and **intuitive navigation**
105+
106+
- **Interactive Components**:
107+
108+
- Buttons and inputs must be **elegant**, with **subtle visual feedback** (hover, click, validation)
109+
- Use **addictive micro-interactions** sparingly to enhance engagement without clutter
110+
111+
- **Animations**:
112+
113+
- Use Tailwind’s built-in utilities: `transition`, `duration-xxx`, `ease-xxx` for basic transitions
114+
- Use `framer-motion` for advanced animations only if necessary
115+
- βœ… **Performance comes first**: animations must be smooth and lightweight
116+
117+
- **Responsiveness**:
118+
119+
- Fully responsive layout: **no overlapping**, **no overflow**
120+
- Consistent behavior across all devices, from mobile to desktop
121+
122+
- **User Experience**:
123+
- All interactive elements must provide **clear visual feedback**
124+
- Interfaces should remain **simple to navigate**, even when **feature-rich**
125+
126+
---
127+
128+
### 🧱 Rendering & Performance
129+
130+
- Favor **Server Components** (`RSC`) and SSR for pages and logic
131+
- Limit `'use client'` usage β€” only where needed:
132+
- form states, event listeners, animations
133+
- Wrap all client components in `<Suspense />` with fallback
134+
- Use dynamic import for non-critical UI (e.g. `Dialog`, `Chart`)
135+
- Optimize media:
136+
- Use **WebP** images with width/height
137+
- Enable lazy loading where possible
138+
139+
---
140+
141+
### πŸ” Data, Forms, Actions
142+
143+
- Use `@tanstack/react-query` for client state
144+
- Use `next-safe-action` for server mutations and queries
145+
- All actions should:
146+
- Have clear schema (`schema/`)
147+
- Model expected errors with `ActionError`
148+
- Return typed output
149+
- Use the clientAction from `@/shared/api/safe-actions`
150+
- Use `Form`, `FormField`, `FormMessage` from Shadcn for all forms
151+
152+
---
153+
154+
### 🧭 Routing & Navigation
155+
156+
- All routes defined in `app/`, avoid logic here
157+
- Use constants in `shared/constants/paths.ts`
158+
- For search parameters, use `nuqs` (`useQueryState`) β€” never manipulate `router.query` directly
159+
- Follow Next.js App Router standards for layouts and segments
160+
161+
---
162+
163+
- [Feature-Sliced Design](https://feature-sliced.design/)
164+
- [Shadcn UI](https://ui.shadcn.com/)
165+
- [Zod](https://zod.dev/)

β€Ž.dockerignoreβ€Ž

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# .dockerignore
2+
node_modules/
3+
.git/
4+
.dockerignore
5+
Dockerfile
6+
docker-compose.yml
7+
npm-debug.log*
8+
yarn-debug.log*
9+
yarn-error.log*
10+
.next/
11+
dist/
12+
out/
13+
build/
14+
coverage/
15+
*.tsbuildinfo
16+
.nyc_output
17+
.vscode/
18+
.idea/
19+
*.swp
20+
*.swo
21+
*~

β€Ž.env.exampleβ€Ž

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Database Configuration
2+
POSTGRES_USER=username
3+
POSTGRES_PASSWORD=password
4+
POSTGRES_DB=workout-cool
5+
DB_HOST=localhost
6+
DB_PORT=5432
7+
# Format: postgresql://USER:PASSWORD@HOST:PORT/DATABASE
8+
DATABASE_URL=postgresql://username:password@localhost:5432/workout-cool
9+
10+
# Authentication
11+
# The URL where your application is running
12+
BETTER_AUTH_URL=http://localhost:3000
13+
# Generate a secure random string using: openssl rand -base64 32
14+
BETTER_AUTH_SECRET=your-secret-key-here
15+
16+
# Google OAuth
17+
# Get these from Google Cloud Console: https://console.cloud.google.com
18+
# Required scopes: email, profile
19+
GOOGLE_CLIENT_ID="your-google-client-id.apps.googleusercontent.com"
20+
GOOGLE_CLIENT_SECRET="your-google-client-secret"
21+
22+
# OpenPanel Integration
23+
# Get these from your OpenPanel dashboard
24+
OPENPANEL_SECRET_KEY=
25+
NEXT_PUBLIC_OPENPANEL_CLIENT_ID=
26+
27+
# Environment
28+
# Options: development, production, test
29+
NODE_ENV=development
30+
31+
#SMTP Configuration
32+
# Using MailHog for example. https://github.com/mailhog/MailHog
33+
SMTP_HOST=localhost
34+
SMTP_PORT=1025
35+
SMTP_USER=
36+
SMTP_PASS=
37+
SMTP_FROM="Workout Cool <noreply@workout.cool>"
38+
SMTP_SECURE=false
39+
40+
# Whether to seed sample data on startup
41+
SEED_SAMPLE_DATA=true
42+
43+
# ========================================
44+
# BILLING CONFIGURATION
45+
# ========================================
46+
47+
# Stripe Configuration (optional)
48+
# Get these from https://dashboard.stripe.com
49+
STRIPE_SECRET_KEY="sk_test_..."
50+
STRIPE_WEBHOOK_SECRET="whsec_..."
51+
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
52+
53+
# Stripe Price IDs
54+
# Create products in Stripe Dashboard and add price IDs here
55+
NEXT_PUBLIC_STRIPE_PRICE_MONTHLY_EU="price_..."
56+
NEXT_PUBLIC_STRIPE_PRICE_YEARLY_EU="price_..."
57+
NEXT_PUBLIC_STRIPE_PRICE_MONTHLY_US="price_..."
58+
NEXT_PUBLIC_STRIPE_PRICE_YEARLY_US="price_..."
59+
NEXT_PUBLIC_STRIPE_PRICE_MONTHLY_LATAM="price_..."
60+
NEXT_PUBLIC_STRIPE_PRICE_YEARLY_LATAM="price_..."
61+
NEXT_PUBLIC_STRIPE_PRICE_MONTHLY_BR="price_..."
62+
NEXT_PUBLIC_STRIPE_PRICE_YEARLY_BR="price_..."
63+
NEXT_PUBLIC_STRIPE_PRICE_MONTHLY_RU="price_..."
64+
NEXT_PUBLIC_STRIPE_PRICE_YEARLY_RU="price_..."
65+
NEXT_PUBLIC_STRIPE_PRICE_MONTHLY_CN="price_..."
66+
NEXT_PUBLIC_STRIPE_PRICE_YEARLY_CN="price_..."
67+
68+
# RevenueCat Configuration (for mobile app integration)
69+
REVENUECAT_API_KEY=""
70+
REVENUECAT_WEBHOOK_SECRET=""
71+
REVENUECAT_SECRET_KEY="test_secret_key"
72+
73+
# Billing Mode for self-hosted
74+
# Options: DISABLED, LICENSE_KEY, SUBSCRIPTION, FREEMIUM
75+
DEFAULT_BILLING_MODE="DISABLED"
76+
77+
NEXT_PUBLIC_APP_URL=http://localhost:3000
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ""
5+
labels: ""
6+
assignees: ""
7+
---
8+
9+
**Describe the bug** A clear and concise description of what the bug is.
10+
11+
**To Reproduce** Steps to reproduce the behavior:
12+
13+
1. Go to '...'
14+
2. Click on '....'
15+
3. Scroll down to '....'
16+
4. See error
17+
18+
**Expected behavior** A clear and concise description of what you expected to happen.
19+
20+
**Screenshots** If applicable, add screenshots to help explain your problem.
21+
22+
**Desktop (please complete the following information):**
23+
24+
- OS: [e.g. iOS]
25+
- Browser [e.g. chrome, safari]
26+
- Version [e.g. 22]
27+
28+
**Smartphone (please complete the following information):**
29+
30+
- Device: [e.g. iPhone6]
31+
- OS: [e.g. iOS8.1]
32+
- Browser [e.g. stock browser, safari]
33+
- Version [e.g. 22]
34+
35+
**Additional context** Add any other context about the problem here.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: πŸ’¬ Workout Cool Discord
4+
url: https://discord.gg/NtrsUBuHUB
5+
about: Please use our Discord server for all questions, discussions, and support.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Feature request
3+
about: Suggest a feature for this project
4+
title: ""
5+
labels: ""
6+
assignees: ""
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always
10+
frustrated when [...]
11+
12+
**Describe the solution you'd like** A clear and concise description of what you want to happen.
13+
14+
**Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered.
15+
16+
**Additional context** Add any other context or screenshots about the feature request here.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## πŸ“ Description
2+
3+
<!-- Briefly describe the changes made -->
4+
5+
## πŸ“‹ Checklist
6+
7+
- [ ] My code follows the project conventions
8+
- [ ] This PR includes breaking changes
9+
- [ ] I have updated documentation if necessary
10+
11+
## πŸ—ƒοΈ Prisma Migrations (if applicable)
12+
13+
- [ ] I have created a migration
14+
- [ ] I have tested the migration locally
15+
16+
## πŸ“Έ Screenshots (if applicable)
17+
18+
<!-- Add screenshots for visual changes -->
19+
20+
## πŸ”— Related Issues
21+
22+
<!-- Reference issues: Closes #123, Fixes #456 -->

0 commit comments

Comments
Β (0)