Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Aug 29, 2024
1 parent 46e08a4 commit 7b7eac4
Show file tree
Hide file tree
Showing 68 changed files with 1,140 additions and 2,046 deletions.
48 changes: 48 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Code Style and Structure:
- Write concise, technical TypeScript code with accurate examples
- Use functional and declarative programming patterns; avoid classes
- Prefer iteration and modularization over code duplication
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
- Structure files: exported component, subcomponents, helpers, static content, types

Naming Conventions:
- Use lowercase with dashes for directories (e.g., components/auth-wizard)
- Favor named exports for components

TypeScript Usage:
- Use TypeScript for all code; prefer interfaces over types
- Avoid enums; use maps instead
- Use functional components with TypeScript interfaces

Syntax and Formatting:
- Use the "function" keyword for pure functions
- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements
- Use declarative JSX

Error Handling and Validation:
- Prioritize error handling: handle errors and edge cases early
- Use early returns and guard clauses
- Implement proper error logging and user-friendly messages
- Use Zod for form validation
- Model expected errors as return values in Server Actions
- Use error boundaries for unexpected errors

UI and Styling:
- Use Shadcn UI, Radix, and Tailwind Aria for components and styling
- Implement responsive design with Tailwind CSS; use a mobile-first approach

Performance Optimization:
- Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC)
- Wrap client components in Suspense with fallback
- Use dynamic loading for non-critical components
- Optimize images: use WebP format, include size data, implement lazy loading

Key Conventions:
- Use 'nuqs' for URL search parameter state management
- Optimize Web Vitals (LCP, CLS, FID)
- Limit 'use client':
- Favor server components and Next.js SSR
- Use only for Web API access in small components
- Avoid for data fetching or state management

Follow Next.js docs for Data Fetching, Rendering, and Routing
38 changes: 30 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
node_modules
.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage
coverage

# next.js
/.next/
/out/
.next/
out/
next-env.d.ts

# expo
.expo/
dist/

# production
/build
build

# misc
.DS_Store
Expand All @@ -24,13 +28,31 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# turbo
.turbo

# react-email
.react-email
packages/email/public
!packages/email/public/.gitkeep
!packages/email/.react-email/.gitkeep

# Storybook
storybook-static
tailwind.css

# Supabase
.branches
.temp
27 changes: 27 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"editor.defaultFormatter": "biomejs.biome",
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
"editor.formatOnSave": true,
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.autoImportFileExcludePatterns": [
"next/router.d.ts",
"next/dist/client/router.d.ts"
],
"terminal.integrated.localEchoStyle": "dim",
"search.exclude": {
"**/node_modules": true
}
}
21 changes: 1 addition & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
![hero](hero.png)

## Getting Started

Expand All @@ -15,22 +15,3 @@ bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
3 changes: 3 additions & 0 deletions apps/api/.env-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PROJECT_ID=
GOOGLE_CLIENT_ID=
GOOGLE_SECRET=
11 changes: 11 additions & 0 deletions apps/api/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@v1/api",
"private": true,
"scripts": {
"dev": "supabase start",
"login": "supabase login"
},
"dependencies": {
"supabase": "^1.191.3"
}
}
36 changes: 36 additions & 0 deletions apps/api/supabase/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
project_id = "create-v1"

[api]
enabled = true
port = 54321
schemas = ["public", "storage"]
extra_search_path = ["public"]
max_rows = 100

[auth]
site_url = "http://localhost:3000"
additional_redirect_urls = ["https://localhost:3000", "http://localhost:54321/auth/v1/callback"]
jwt_expiry = 36000

[db]
port = 54322

[studio]
port = 54323

[auth.external.google]
enabled = true
client_id = "env(GOOGLE_CLIENT_ID)"
secret = "env(GOOGLE_SECRET)"
redirect_uri = "http://localhost:54321/auth/v1/callback"

[auth.email]
double_confirm_changes = true
enable_confirmations = true
enable_signup = true

[analytics]
enabled = true
port = 54327
vector_port = 54328
backend = "postgres"
Empty file.
Empty file.
Empty file added apps/mobile/README.md
Empty file.
24 changes: 24 additions & 0 deletions apps/web/.env-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Supabase
NEXT_PUBLIC_SUPABASE_URL=http://127.0.0.1:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_KEY=

# Resend
RESEND_API_KEY=

# Upstash
UPSTASH_REDIS_REST_URL=
UPSTASH_REDIS_REST_TOKEN=

# Dub
DUB_API_KEY=

# OpenPanel
NEXT_PUBLIC_OPENPANEL_CLIENT_ID=
OPENPANEL_SECRET_KEY=

# Sentry
SENTRY_AUTH_TOKEN=
NEXT_PUBLIC_SENTRY_DSN=
SENTRY_ORG=
SENTRY_PROJECT=
19 changes: 19 additions & 0 deletions apps/web/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import "./src/env.mjs";
import { withSentryConfig } from "@sentry/nextjs";

/** @type {import('next').NextConfig} */
const nextConfig = {
transpilePackages: ["@v1/kv", "@v1/supabase"],
experimental: {
instrumentationHook: process.env.NODE_ENV === "production",
},
};

export default withSentryConfig(nextConfig, {
silent: !process.env.CI,
telemetry: false,
widenClientFileUpload: true,
hideSourceMaps: true,
disableLogger: true,
tunnelRoute: "/monitoring",
});
32 changes: 32 additions & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "@v1/web",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@v1/kv": "workspace:*",
"@v1/supabase": "workspace:*",
"@v1/ui": "workspace:*",
"next": "14.2.7",
"next-safe-action": "^7.7.1",
"next-themes": "^0.3.0",
"react": "^18",
"react-dom": "^18",
"zod": "^3.23.8"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^22",
"@types/react": "^18",
"@types/react-dom": "^18",
"@sentry/nextjs": "^8",
"@supabase/sentry-js-integration": "^0.2.0",
"postcss": "^8",
"tailwindcss": "^3.4.10"
}
}
File renamed without changes.
Binary file added apps/web/public/favicon.ico
Binary file not shown.
Binary file added apps/web/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions apps/web/sentry.client.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as Sentry from "@sentry/nextjs";
import { supabaseIntegration } from "@supabase/sentry-js-integration";
import { createClient } from "@v1/supabase/client";

const client = createClient();

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 1,
debug: false,
enabled: process.env.NODE_ENV === "production",
integrations: [
supabaseIntegration(client, Sentry, {
tracing: true,
breadcrumbs: true,
errors: true,
}),
],
});
8 changes: 8 additions & 0 deletions apps/web/sentry.edge.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import * as Sentry from "@sentry/nextjs";

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
enabled: process.env.NODE_ENV === "production",
tracesSampleRate: 1,
debug: false,
});
19 changes: 19 additions & 0 deletions apps/web/sentry.server.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as Sentry from "@sentry/nextjs";
import { supabaseIntegration } from "@supabase/sentry-js-integration";
import { createClient } from "@v1/supabase/client";

const client = createClient();

Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 1,
debug: false,
enabled: process.env.NODE_ENV === "production",
integrations: [
supabaseIntegration(client, Sentry, {
tracing: true,
breadcrumbs: true,
errors: true,
}),
],
});
Loading

0 comments on commit 7b7eac4

Please sign in to comment.