- Clerk is used for authentication.
- The
ClerkProvider
wraps the application inapp/providers.tsx
. - Middleware in
middleware.ts
handles authentication routes. useSession
hook inlib/utils.ts
provides authentication state.
- Convex is used as the database and backend.
- Convex schema is defined in
convex/schema.ts
. - Convex functions (queries, mutations, actions) are in separate files in the
convex
directory. - The
ConvexProviderWithClerk
wraps the application inapp/providers.tsx
. - Custom hooks like
authQuery
,authMutation
, andauthAction
inconvex/util.ts
handle authenticated Convex operations.
- Stripe is used for payment processing.
- Stripe integration is primarily handled in
convex/stripe.ts
. - The
pay
action initiates the payment process. - Webhook handling for Stripe events is in
convex/http.ts
.
- Next.js 14 app directory structure is used.
- Pages are in
app
directory. - Components are in
components
directory. - Convex functions and schema are in the
convex
directory.
- Server Components: Most pages are server components (no "use client" directive).
- Client Components: Components that need interactivity use the "use client" directive.
- Convex Queries and Mutations: Used throughout the application for data fetching and manipulation.
- Authentication Checks: Many components and pages check authentication status before rendering or performing actions.
- Environment Variables: Sensitive information and API keys are stored in environment variables.
convex/schema.ts
: Defines the database schema.convex/users.ts
: Handles user-related operations.convex/stripe.ts
: Manages Stripe integration.app/providers.tsx
: Sets up global providers (Convex, Clerk, Theme).middleware.ts
: Handles authentication middleware.lib/utils.ts
: Contains utility functions and hooks.
- Tailwind CSS is used for styling.
- Global styles are in
app/globals.css
. - Tailwind config is in
tailwind.config.ts
.
- The application is configured for deployment on Vercel.
- Environment variables need to be set for Convex, Clerk, and Stripe in the deployment environment.
When working with this codebase, focus on these key areas and patterns to maintain consistency and leverage the existing infrastructure.