-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/personal site #13
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
Changes from all commits
a547259
0a3d029
4d588be
aff6076
6a93e58
345d5e8
d0c8b8b
30b1556
e8907c0
931154c
5ac20cc
411866f
25fb3ea
a5de68f
b6cd897
64b82cd
1d13259
2fd2e01
3c9901b
dfb0f93
ec5447f
c1ce876
ca848d8
da8e7a2
5f22768
783ec1b
d27bea4
faef3b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,3 +5,4 @@ dist/ | |
| *.log | ||
| .DS_Store | ||
| .vercel | ||
| .env*.local | ||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # String Design System | ||
|
|
||
| ## Color Palette | ||
|
|
||
| ### Primary Colors | ||
| - **String Mint**: `#75F8CC` (RGB: 117, 248, 204) | ||
| - **String Dark**: `#33373B` (RGB: 51, 55, 59) | ||
| - **String Light**: `#C0F4FB` (RGB: 192, 244, 251) | ||
| - **White**: `#FFFFFF` | ||
|
|
||
| ### Usage Guidelines | ||
| - **String Mint**: Primary accent, buttons, highlights, active states | ||
| - **String Dark**: Text, backgrounds, headers | ||
| - **String Light**: Secondary accents, subtle backgrounds | ||
| - **White**: Main backgrounds, cards | ||
|
|
||
| ## Component Patterns | ||
|
|
||
| ### Buttons | ||
| ```tsx | ||
| // Primary Button | ||
| className="bg-string-mint text-string-dark hover:bg-string-mint-light px-4 py-2 rounded-xl font-medium transition-colors" | ||
|
|
||
| // Secondary Button | ||
| className="bg-white border border-gray-200 text-string-dark hover:bg-gray-50 px-4 py-2 rounded-xl font-medium transition-colors" | ||
|
|
||
| // Text Button | ||
| className="text-string-mint hover:text-string-mint-light font-medium transition-colors" | ||
| ``` | ||
|
|
||
| ### Cards | ||
| ```tsx | ||
| className="bg-white rounded-xl p-6 shadow-sm border border-gray-100 hover:border-string-mint transition-colors" | ||
| ``` | ||
|
|
||
| ### Headers | ||
| ```tsx | ||
| // Main Header | ||
| className="text-3xl font-bold text-string-dark" | ||
|
|
||
| // Section Header | ||
| className="text-xl font-semibold text-string-dark" | ||
|
|
||
| // Card Header | ||
| className="text-lg font-medium text-string-dark" | ||
| ``` | ||
|
|
||
| ### Interactive Elements | ||
| - **Hover states**: Use `hover:border-string-mint` for subtle interactions | ||
| - **Active states**: Use `border-string-mint text-string-mint` for selection | ||
| - **Transitions**: Always include `transition-colors` or `transition-all duration-200` | ||
|
|
||
| ## Layout Standards | ||
|
|
||
| ### Spacing | ||
| - **Container max-width**: `max-w-4xl` or `max-w-7xl` | ||
| - **Section spacing**: `space-y-6` or `space-y-8` | ||
| - **Card padding**: `p-6` or `p-8` | ||
| - **Button padding**: `px-4 py-2` or `px-6 py-3` | ||
|
|
||
| ### Border Radius | ||
| - **Cards**: `rounded-xl` | ||
| - **Buttons**: `rounded-xl` | ||
| - **Small elements**: `rounded-lg` | ||
| - **Avatars**: `rounded-2xl` | ||
|
|
||
| ### Typography | ||
| - **Display**: `text-3xl font-bold` | ||
| - **Heading**: `text-xl font-semibold` | ||
| - **Subheading**: `text-lg font-medium` | ||
| - **Body**: `text-sm` or `text-base` | ||
| - **Caption**: `text-xs` | ||
|
|
||
| ## Theme Support | ||
| Components should support both light and dark themes using the `t()` helper function: | ||
|
|
||
| ```tsx | ||
| const t = (light: string, dark: string) => isDark ? dark : light; | ||
|
|
||
| // Usage | ||
| className={`${t('bg-white', 'bg-string-dark')} ${t('text-string-dark', 'text-white')}`} | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import { neon } from '@neondatabase/serverless'; | ||
| import { drizzle } from 'drizzle-orm/neon-http'; | ||
| import { appSubmissions } from '../src/db/schema'; | ||
| import { appSubmissions, users } from '../src/db/schema'; | ||
| import { eq, desc } from 'drizzle-orm'; | ||
|
|
||
| // Edge runtime configuration | ||
|
|
@@ -61,18 +61,35 @@ export default async function handler(request: Request) { | |
| ); | ||
| } | ||
|
|
||
| // Ensure user exists in database before creating submission | ||
| const existingUser = await db | ||
| .select() | ||
| .from(users) | ||
| .where(eq(users.id, submittedByUserId)) | ||
| .limit(1); | ||
|
|
||
| if (existingUser.length === 0) { | ||
| // Create user if doesn't exist | ||
| await db.insert(users).values({ | ||
| id: submittedByUserId, | ||
| email: submittedByEmail, | ||
| name: null, | ||
| slug: null, | ||
| }); | ||
| } | ||
|
|
||
| // Insert submission | ||
| await db.insert(appSubmissions).values({ | ||
| name, | ||
| url, | ||
| description, | ||
| logoUrl, | ||
| category, | ||
| description: description || null, | ||
| logoUrl: logoUrl || null, | ||
| category: category || null, | ||
| submittedByUserId, | ||
| submittedByEmail, | ||
| status: 'pending' | ||
| }); | ||
|
|
||
|
|
||
| return new Response( | ||
| JSON.stringify({ success: true, message: 'App submitted for review' }), | ||
| { | ||
|
|
@@ -123,7 +140,10 @@ export default async function handler(request: Request) { | |
| } catch (error) { | ||
| console.error('Database error:', error); | ||
| return new Response( | ||
| JSON.stringify({ error: 'Internal server error' }), | ||
| JSON.stringify({ | ||
| error: 'Internal server error', | ||
| details: error instanceof Error ? error.message : 'Unknown error' | ||
| }), | ||
|
Comment on lines
140
to
+146
|
||
| { | ||
| status: 500, | ||
| headers: { ...corsHeaders, 'Content-Type': 'application/json' }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating a placeholder user with
slug: nullcan permanently break profile routing:api/users.tsonly generates a slug when the user does not already exist, and does not backfill a missing slug on updates. If a user is inserted here first, they may never get a slug. Suggest reusing the same slug-generation/upsert logic asapi/users.ts(or update existing users whereslug IS NULL).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback