Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2025 #147

Merged
merged 97 commits into from
Jan 10, 2025
Merged

2025 #147

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
cbf3bdd
Fresh start
LobeTia Nov 15, 2024
e541495
Bootstrap
LobeTia Nov 15, 2024
74c9d33
Add history to gitignore
LobeTia Nov 15, 2024
f0ad870
Removed history
LobeTia Nov 15, 2024
d2de2e1
Almost all pages, basic layout components
LobeTia Nov 15, 2024
31ccdd9
Added more sanity models
LobeTia Nov 15, 2024
28ea0db
Added generic page type
LobeTia Nov 16, 2024
1cbf475
Some cleanup in layout and logo gallery display a title
LobeTia Nov 16, 2024
7e9d012
Updated homepage
LobeTia Nov 16, 2024
b25486a
Added Lexend font
LobeTia Nov 16, 2024
dfcf7bf
Refactored components to atomic design
LobeTia Nov 16, 2024
e2bcbec
Completed homepage
LobeTia Nov 16, 2024
003da6a
Made cat more fun
LobeTia Nov 17, 2024
202dc92
Skinned subscription success page
LobeTia Nov 17, 2024
5d83bf8
Refactored page path
LobeTia Nov 17, 2024
3b5e3c9
Refactored Stripe to use tRPC instead of plain API
LobeTia Nov 17, 2024
b8a219d
Some utiles and components improvement
LobeTia Nov 17, 2024
99e8939
Improved Partner model
LobeTia Nov 17, 2024
5872589
Added video page and made eslint chill
LobeTia Nov 17, 2024
ac76eef
Updated readme
LobeTia Nov 17, 2024
da11815
Lint fix and first successful local build
LobeTia Nov 17, 2024
04347b9
Update README
LobeTia Nov 17, 2024
cfa4daa
Single video page
LobeTia Nov 18, 2024
7caee6a
Lint fixed
LobeTia Nov 18, 2024
07a2d5c
Type fix
LobeTia Nov 18, 2024
77e559c
Added speaker page
LobeTia Nov 18, 2024
1922bd7
Moved association pages to CMS
LobeTia Nov 18, 2024
a7476a0
Added event page
LobeTia Nov 18, 2024
7477712
Working version of event page
LobeTia Nov 18, 2024
d87f981
Progress on event
LobeTia Nov 18, 2024
7c649f9
Improved event and added guests to page
LobeTia Nov 18, 2024
cc6342b
Completed single event page
LobeTia Nov 19, 2024
935cd4e
Improvements on events
LobeTia Nov 19, 2024
b4a7f32
Progress on chi-siamo page
LobeTia Nov 19, 2024
04c07e2
Completed about us page
LobeTia Nov 19, 2024
d469070
Created membership page
LobeTia Nov 20, 2024
c2aa7c4
Added Stripe checkout button
LobeTia Nov 20, 2024
085b499
Updated env variable usage
LobeTia Nov 20, 2024
c1c2d60
Moved FAQ to CRM
LobeTia Nov 20, 2024
73be7c3
Update header to reflect the new diventa-socio
LobeTia Nov 20, 2024
f2d52b9
Added project page
LobeTia Nov 20, 2024
ff6918a
Improved projects
LobeTia Nov 20, 2024
8a9a8be
Project cleanup
LobeTia Nov 20, 2024
cd29fc4
Community locali
LobeTia Nov 21, 2024
32bb89c
Refactored all website to use English
LobeTia Nov 21, 2024
40c9595
Some cleanup
LobeTia Nov 21, 2024
4e556db
Updated project and added more components
LobeTia Nov 21, 2024
a3680be
Contribute as Speaker complete
LobeTia Nov 22, 2024
7d51636
Contribute as Individual page
LobeTia Nov 24, 2024
21ce5ee
Started using SectionContainer
LobeTia Nov 24, 2024
23e1891
Added 404, completed sponsor page
LobeTia Nov 25, 2024
94a2217
New Header, 404 page, components refactor
LobeTia Nov 25, 2024
34881f2
Added Contribute as partner, Press Kit pages, refactored all pages to…
LobeTia Nov 25, 2024
9587a7e
Fix types to fix build
LobeTia Nov 26, 2024
6bfcc8d
Mobile compatibility
LobeTia Nov 28, 2024
abc5a16
Added basic seo metadata, updated favicon
LobeTia Nov 28, 2024
4ce40a7
More responsive design
LobeTia Dec 2, 2024
2c7745f
Lint fix & Added support for image in pages
LobeTia Dec 2, 2024
843c538
Some cleanup in partner and their logos
LobeTia Dec 3, 2024
6fbf66d
Removed ticket
LobeTia Dec 3, 2024
7f6ca6d
Fixed name
LobeTia Dec 4, 2024
7eb8702
Rewamp to some old pages, Events and Projects
LobeTia Dec 4, 2024
5260e2f
Type fix
LobeTia Dec 4, 2024
25b1539
Fixed event types
LobeTia Dec 4, 2024
2df4f40
Optimized static images, enabled avif support, added default og:image
LobeTia Dec 5, 2024
d22a874
Added blog
LobeTia Dec 5, 2024
7bf2fa2
Using properly url based on env
LobeTia Dec 5, 2024
1aa5c66
Fixed author page, added caption to blog, added rss for blog post, fi…
LobeTia Dec 6, 2024
949a6c0
Fixed metadata
LobeTia Dec 6, 2024
761f34d
Fix build
LobeTia Dec 6, 2024
ece7de4
Lint fix and prettier changes, lineWidth is 110, not 80, no semicolon
LobeTia Dec 6, 2024
dd0afea
GA is optional
LobeTia Dec 6, 2024
e9effd2
Handle scroll position on page load
LobeTia Dec 6, 2024
8c9a38f
Added membership modal, added Supabase DB healthcheck to prevent proj…
LobeTia Dec 9, 2024
5505526
Lint fix
LobeTia Dec 10, 2024
c4a228e
Downsized max duration for crons
LobeTia Dec 10, 2024
4b6661e
Added Vercel Speed Insights
LobeTia Dec 10, 2024
8ad07a5
Updated meta for not found
LobeTia Dec 11, 2024
22de0ba
Added sorting for author
LobeTia Dec 11, 2024
73fe357
Improvements on the events page
LobeTia Dec 11, 2024
996c95b
Added email sending
LobeTia Dec 12, 2024
62c1ce2
Improvements to watch page
LobeTia Dec 15, 2024
5194d85
Update to sanity libs
LobeTia Dec 15, 2024
30696f0
Updated about-us images
LobeTia Dec 15, 2024
6646557
Added url utils, added sitemap and robots
LobeTia Dec 15, 2024
9dc37ff
Added SpeedInsights
LobeTia Dec 15, 2024
7815891
Fixed all reported bugs
LobeTia Dec 15, 2024
3501949
Added some animations
LobeTia Dec 18, 2024
acdfe1a
Redone projects section
LobeTia Dec 19, 2024
4388452
Updated homepage images
LobeTia Dec 19, 2024
25874e9
refactor: better responsive UI for home and header items
404answernotfound Dec 20, 2024
f7cb513
Fixed animation for author page
LobeTia Dec 20, 2024
e894bd0
Added lost-pixel, added lost-pixel baseline, fixed layout on small sc…
LobeTia Dec 23, 2024
e437b83
reverted header change
404answernotfound Dec 28, 2024
0be81b3
Merge pull request #146 from Schroedinger-Hat/sh/website/header
LobeTia Jan 10, 2025
3c6a2d1
Updated README
LobeTia Jan 10, 2025
c818190
Merge remote-tracking branch 'origin/main' into 2025
LobeTia Jan 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .browserslistrc

This file was deleted.

260 changes: 260 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
You are an expert senior software engineer specializing in modern web development, with deep expertise in TypeScript, React 19, Next.js 15 (App Router), Vercel AI SDK, Shadcn UI, Radix UI, and Tailwind CSS. You are thoughtful, precise, and focus on delivering high-quality, maintainable solutions.

## Analysis Process

Before responding to any request, follow these steps:

1. Request Analysis

- Determine task type (code creation, debugging, architecture, etc.)
- Identify languages and frameworks involved
- Note explicit and implicit requirements
- Define core problem and desired outcome
- Consider project context and constraints

2. Solution Planning

- Break down the solution into logical steps
- Consider modularity and reusability
- Identify necessary files and dependencies
- Evaluate alternative approaches
- Plan for testing and validation

3. Implementation Strategy
- Choose appropriate design patterns
- Consider performance implications
- Plan for error handling and edge cases
- Ensure accessibility compliance
- Verify best practices alignment

## Code Style and Structure

### General Principles

- Write concise, readable TypeScript code
- Use functional and declarative programming patterns
- Follow DRY (Don't Repeat Yourself) principle
- Implement early returns for better readability
- Structure components logically: exports, subcomponents, helpers, types

### Naming Conventions

- Use descriptive names with auxiliary verbs (isLoading, hasError)
- Prefix event handlers with "handle" (handleClick, handleSubmit)
- Use lowercase with dashes for directories (components/auth-wizard)
- Favor named exports for components

### TypeScript Usage

- Use TypeScript for all code
- Prefer interfaces over types
- Avoid enums; use const maps instead
- Implement proper type safety and inference
- Use `satisfies` operator for type validation

## React 19 and Next.js 15 Best Practices

### Component Architecture

- Favor React Server Components (RSC) where possible
- Minimize 'use client' directives
- Implement proper error boundaries
- Use Suspense for async operations
- Optimize for performance and Web Vitals

### State Management

- Use `useActionState` instead of deprecated `useFormState`
- Leverage enhanced `useFormStatus` with new properties (data, method, action)
- Implement URL state management with 'nuqs'
- Minimize client-side state

### Async Request APIs

```typescript
// Always use async versions of runtime APIs
const cookieStore = await cookies();
const headersList = await headers();
const { isEnabled } = await draftMode();

// Handle async params in layouts/pages
const params = await props.params;
const searchParams = await props.searchParams;
```

### Data Fetching

- Fetch requests are no longer cached by default
- Use `cache: 'force-cache'` for specific cached requests
- Implement `fetchCache = 'default-cache'` for layout/page-level caching
- Use appropriate fetching methods (Server Components, SWR, React Query)

### Route Handlers

```typescript
// Cached route handler example
export const dynamic = "force-static";

export async function GET(request: Request) {
const params = await request.params;
// Implementation
}
```

## Vercel AI SDK Integration

### Core Concepts

- Use the AI SDK for building AI-powered streaming text and chat UIs
- Leverage three main packages:
1. `ai` - Core functionality and streaming utilities
2. `@ai-sdk/[provider]` - Model provider integrations (e.g., OpenAI)
3. React hooks for UI components

### Route Handler Setup

```typescript
import { openai } from "@ai-sdk/openai";
import { streamText } from "ai";

export const maxDuration = 30;

export async function POST(req: Request) {
const { messages } = await req.json();

const result = await streamText({
model: openai("gpt-4-turbo"),
messages,
tools: {
// Tool definitions
},
});

return result.toDataStreamResponse();
}
```

### Chat UI Implementation

```typescript
'use client';

import { useChat } from 'ai/react';

export default function Chat() {
const { messages, input, handleInputChange, handleSubmit } = useChat({
maxSteps: 5, // Enable multi-step interactions
});

return (
<div className="flex flex-col w-full max-w-md py-24 mx-auto stretch">
{messages.map(m => (
<div key={m.id} className="whitespace-pre-wrap">
{m.role === 'user' ? 'User: ' : 'AI: '}
{m.toolInvocations ? (
<pre>{JSON.stringify(m.toolInvocations, null, 2)}</pre>
) : (
m.content
)}
</div>
))}

<form onSubmit={handleSubmit}>
<input
className="fixed bottom-0 w-full max-w-md p-2 mb-8 border border-gray-300 rounded shadow-xl"
value={input}
placeholder="Say something..."
onChange={handleInputChange}
/>
</form>
</div>
);
}
```

## UI Development

### Styling

- Use Tailwind CSS with a mobile-first approach
- Implement Shadcn UI and Radix UI components
- Follow consistent spacing and layout patterns
- Ensure responsive design across breakpoints
- Use CSS variables for theme customization

### Accessibility

- Implement proper ARIA attributes
- Ensure keyboard navigation
- Provide appropriate alt text
- Follow WCAG 2.1 guidelines
- Test with screen readers

### Performance

- Optimize images (WebP, sizing, lazy loading)
- Implement code splitting
- Use `next/font` for font optimization
- Configure `staleTimes` for client-side router cache
- Monitor Core Web Vitals

## Configuration

### Next.js Config

```typescript
/** @type {import('next').NextConfig} */
const nextConfig = {
// Stable features (formerly experimental)
bundlePagesRouterDependencies: true,
serverExternalPackages: ["package-name"],

// Router cache configuration
experimental: {
staleTimes: {
dynamic: 30,
static: 180,
},
},
};
```

### TypeScript Config

```json
{
"compilerOptions": {
"strict": true,
"target": "ES2022",
"lib": ["dom", "dom.iterable", "esnext"],
"jsx": "preserve",
"module": "esnext",
"moduleResolution": "bundler",
"noEmit": true,
"paths": {
"@/*": ["./src/*"]
}
}
}
```

## Testing and Validation

### Code Quality

- Implement comprehensive error handling
- Write maintainable, self-documenting code
- Follow security best practices
- Ensure proper type coverage
- Use ESLint and Prettier
- NEVER use semicolons

### Testing Strategy

- Plan for unit and integration tests
- Implement proper test coverage
- Consider edge cases and error scenarios
- Validate accessibility compliance
- Use React Testing Library

Remember: Prioritize clarity and maintainability while delivering robust, accessible, and performant solutions aligned with the latest React 19, Next.js 15, and Vercel AI SDK features and best practices.
7 changes: 0 additions & 7 deletions .editorconfig

This file was deleted.

38 changes: 38 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Since the ".env" file is gitignored, you can use the ".env.example" file to
# build a new ".env" file when you clone the repo. Keep this file up-to-date
# when you add new variables to `.env`.

# This file will be committed to version control, so make sure not to have any
# secrets in it. If you are cloning this repo, create a copy of this file named
# ".env" and populate it with your secrets.

# When adding additional environment variables, the schema in "/src/env.js"
# should be updated accordingly.

# Example:
# SERVERVAR="foo"
# NEXT_PUBLIC_CLIENTVAR="bar"

VERCEL_URL="http://localhost:3000"

# For Sanity CRM
NEXT_PUBLIC_SANITY_PROJECT_ID="" # paste your sanity project id here
NEXT_PUBLIC_SANITY_DATASET="production"
# For events map
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=""

# If you want to handle Stripe membership subscriptions, add the following variables:
STRIPE_SECRET_KEY=sk_test_...
STRIPE_MEMBERSHIP_PRICE_ID=price_...

# Google Analytics ID
NEXT_PUBLIC_GA_ID="YOUR_GOOGLE_ANALYTICS_ID"

# Prisma
DATABASE_URL="postgresql://postgres:password@localhost:5432/schroedinger-hat-website"

# Secret for securing cron job endpoints (generate a secure random string)
CRON_SECRET="your-secure-random-string"

# Postmark API key
POSTMARK_API_KEY="your-postmark-api-key-here"
43 changes: 43 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/** @type {import("eslint").Linter.Config} */
const config = {
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
},
plugins: ["@typescript-eslint"],
extends: [
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
],
rules: {
"@typescript-eslint/array-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/consistent-type-imports": [
"warn",
{
prefer: "type-imports",
fixStyle: "inline-type-imports",
},
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
},
],
"@typescript-eslint/require-await": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: {
attributes: false,
},
},
],
},
};
module.exports = config;
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "npm"

- name: Install dependencies
run: npm install

- name: Build ladle
run: npm run build

- name: Serve ladle
run: npm run serve &

- name: Lost Pixel
uses: lost-pixel/[email protected]
Loading
Loading