-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from codegasms/feat/unify-validations
Unify api validations and setup consistent prettier formatting
- Loading branch information
Showing
83 changed files
with
2,764 additions
and
1,678 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"semi": true, | ||
"singleQuote": false, | ||
"tabWidth": 2, | ||
"trailingComma": "es5", | ||
"printWidth": 80, | ||
"bracketSpacing": true, | ||
"arrowParens": "always", | ||
"endOfLine": "lf", | ||
"bracketSameLine": false, | ||
"jsxSingleQuote": false, | ||
"quoteProps": "as-needed", | ||
"useTabs": false, | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"options": { | ||
"parser": "typescript" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Check Prettier Formatting | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Check formatting | ||
run: npm run format:check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
.next | ||
build | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
import { NextResponse } from 'next/server'; | ||
import { db } from '@/db/drizzle'; | ||
import { sql } from 'drizzle-orm'; | ||
import { NextResponse } from "next/server"; | ||
import { db } from "@/db/drizzle"; | ||
import { sql } from "drizzle-orm"; | ||
|
||
export async function GET() { | ||
try { | ||
// Test DB connection | ||
await db.execute(sql`SELECT 1`); | ||
|
||
return NextResponse.json( | ||
{ status: 'healthy', timestamp: new Date().toISOString() }, | ||
{ status: 200 } | ||
{ status: "healthy", timestamp: new Date().toISOString() }, | ||
{ status: 200 }, | ||
); | ||
} catch (error) { | ||
return NextResponse.json( | ||
{ | ||
status: 'unhealthy', | ||
error: error instanceof Error ? error.message : 'Database connection failed', | ||
timestamp: new Date().toISOString() | ||
status: "unhealthy", | ||
error: | ||
error instanceof Error ? error.message : "Database connection failed", | ||
timestamp: new Date().toISOString(), | ||
}, | ||
{ status: 503 } | ||
{ status: 503 }, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { CodeEditor } from "@/components/code-editor" | ||
import { Button } from "@/components/ui/button" | ||
import { CodeEditor } from "@/components/code-editor"; | ||
import { Button } from "@/components/ui/button"; | ||
|
||
export default function CodePage() { | ||
return ( | ||
<CodeEditor /> | ||
) | ||
} | ||
return <CodeEditor />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import { ContestDetailPage } from '@/components/contest-details-table' | ||
import { ContestDetailPage } from "@/components/contest-details-table"; | ||
|
||
export default function ContestDetail() { | ||
return <ContestDetailPage /> | ||
return <ContestDetailPage />; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { CreateContest } from "@/components/create-contest" | ||
import { CreateContest } from "@/components/create-contest"; | ||
|
||
export default function CreateContestPage() { | ||
return <CreateContest /> | ||
return <CreateContest />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import { ContestListPage } from '@/components/contestlist' | ||
import { ContestListPage } from "@/components/contestlist"; | ||
|
||
export default function ContestList() { | ||
return <ContestListPage /> | ||
return <ContestListPage />; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { GroupsInfoPage } from '@/components/groups-list' | ||
import { GroupsInfoPage } from "@/components/groups-list"; | ||
|
||
export default function UsersPage() { | ||
return <GroupsInfoPage /> | ||
} | ||
return <GroupsInfoPage />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.