Skip to content

Commit fa765e6

Browse files
authored
Merge pull request #1 from 100XEnginners/v0/chat
feat: v0 of app
2 parents d9492e3 + be16bb9 commit fa765e6

56 files changed

Lines changed: 4249 additions & 99 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Deploy to Production
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 20
19+
20+
- name: Install dependencies
21+
run: bun install --frozen-lockfile
22+
23+
- name: Build the application
24+
run: bun run build
25+
26+
deploy:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v3
31+
32+
- name: Set up Node.js
33+
uses: actions/setup-node@v3
34+
with:
35+
node-version: 20
36+

Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM oven/bun:1-alpine AS builder
2+
3+
RUN apk add --no-cache python3 make g++ pkgconfig pixman-dev cairo-dev pango-dev libjpeg-turbo-dev giflib-dev openssl
4+
5+
6+
WORKDIR /app
7+
8+
COPY package.json ./
9+
COPY bun.lock ./
10+
COPY prisma ./prisma
11+
12+
RUN bun install
13+
14+
COPY . .
15+
16+
RUN bunx prisma generate
17+
18+
RUN bun run build
19+
20+
FROM oven/bun:1-alpine AS runner
21+
22+
WORKDIR /app
23+
24+
COPY --from=builder /app ./
25+
26+
27+
EXPOSE 3000
28+
29+
CMD ["bun", "run", "start"]
30+

bun.lock

Lines changed: 451 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": true,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/styles/globals.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
},
20+
"iconLibrary": "lucide"
21+
}

docker-compose.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: '3.8'
2+
3+
services:
4+
app:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
ports:
9+
- "3000:3000"
10+
env_file:
11+
- .env
12+
environment:
13+
- DATABASE_URL=postgresql://postgres:password@db:5432/t3dotgg
14+
- NODE_ENV=production
15+
- AUTH_TRUST_HOST=true
16+
depends_on:
17+
- db
18+
networks:
19+
- app-network
20+
21+
db:
22+
image: postgres
23+
ports:
24+
- "5432:5432"
25+
environment:
26+
- POSTGRES_USER=postgres
27+
- POSTGRES_PASSWORD=password
28+
- POSTGRES_DB=t3dotgg
29+
volumes:
30+
- postgres_data:/var/lib/postgresql/data
31+
networks:
32+
- app-network
33+
34+
networks:
35+
app-network:
36+
driver: bridge
37+
38+
volumes:
39+
postgres_data:

next.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import "./src/env.js";
66

77
/** @type {import("next").NextConfig} */
8-
const config = {};
8+
const config = {
9+
output: "standalone",
10+
};
911

1012
export default config;

package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,45 @@
2121
"typecheck": "tsc --noEmit"
2222
},
2323
"dependencies": {
24+
"@ai-sdk/google": "^1.2.19",
25+
"@ai-sdk/openai": "^1.3.22",
26+
"@ai-sdk/react": "^1.2.12",
2427
"@auth/prisma-adapter": "^2.7.2",
28+
"@phosphor-icons/react": "^2.1.10",
2529
"@prisma/client": "^6.5.0",
30+
"@radix-ui/react-avatar": "^1.1.10",
31+
"@radix-ui/react-collapsible": "^1.1.11",
32+
"@radix-ui/react-dialog": "^1.1.14",
33+
"@radix-ui/react-dropdown-menu": "^2.1.15",
34+
"@radix-ui/react-select": "^2.2.5",
35+
"@radix-ui/react-separator": "^1.1.7",
36+
"@radix-ui/react-slot": "^1.2.3",
37+
"@radix-ui/react-tooltip": "^1.2.7",
2638
"@t3-oss/env-nextjs": "^0.12.0",
2739
"@tanstack/react-query": "^5.69.0",
2840
"@trpc/client": "^11.0.0",
2941
"@trpc/react-query": "^11.0.0",
3042
"@trpc/server": "^11.0.0",
43+
"@types/react-syntax-highlighter": "^15.5.13",
44+
"ai": "^4.3.16",
45+
"axios": "^1.9.0",
46+
"class-variance-authority": "^0.7.1",
47+
"clsx": "^2.1.1",
48+
"framer-motion": "^12.16.0",
49+
"lucide-react": "^0.514.0",
3150
"next": "^15.2.3",
3251
"next-auth": "5.0.0-beta.25",
52+
"openai": "^5.1.1",
3353
"react": "^19.0.0",
3454
"react-dom": "^19.0.0",
55+
"react-hook-form": "^7.57.0",
56+
"react-markdown": "^10.1.0",
57+
"react-syntax-highlighter": "^15.6.1",
58+
"remark-gfm": "^4.0.1",
3559
"server-only": "^0.0.1",
60+
"sonner": "^2.0.5",
3661
"superjson": "^2.2.1",
62+
"tailwind-merge": "^3.3.1",
3763
"zod": "^3.24.2"
3864
},
3965
"devDependencies": {
@@ -49,6 +75,7 @@
4975
"prettier-plugin-tailwindcss": "^0.6.11",
5076
"prisma": "^6.5.0",
5177
"tailwindcss": "^4.0.15",
78+
"tw-animate-css": "^1.3.4",
5279
"typescript": "^5.8.2",
5380
"typescript-eslint": "^8.27.0"
5481
},
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
-- CreateTable
2+
CREATE TABLE "Account" (
3+
"id" TEXT NOT NULL,
4+
"userId" TEXT NOT NULL,
5+
"type" TEXT NOT NULL,
6+
"provider" TEXT NOT NULL,
7+
"providerAccountId" TEXT NOT NULL,
8+
"refresh_token" TEXT,
9+
"access_token" TEXT,
10+
"expires_at" INTEGER,
11+
"token_type" TEXT,
12+
"scope" TEXT,
13+
"id_token" TEXT,
14+
"session_state" TEXT,
15+
"refresh_token_expires_in" INTEGER,
16+
17+
CONSTRAINT "Account_pkey" PRIMARY KEY ("id")
18+
);
19+
20+
-- CreateTable
21+
CREATE TABLE "Session" (
22+
"id" TEXT NOT NULL,
23+
"sessionToken" TEXT NOT NULL,
24+
"userId" TEXT NOT NULL,
25+
"expires" TIMESTAMP(3) NOT NULL,
26+
27+
CONSTRAINT "Session_pkey" PRIMARY KEY ("id")
28+
);
29+
30+
-- CreateTable
31+
CREATE TABLE "User" (
32+
"id" TEXT NOT NULL,
33+
"name" TEXT,
34+
"email" TEXT,
35+
"emailVerified" TIMESTAMP(3),
36+
"image" TEXT,
37+
38+
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
39+
);
40+
41+
-- CreateTable
42+
CREATE TABLE "VerificationToken" (
43+
"identifier" TEXT NOT NULL,
44+
"token" TEXT NOT NULL,
45+
"expires" TIMESTAMP(3) NOT NULL
46+
);
47+
48+
-- CreateIndex
49+
CREATE UNIQUE INDEX "Account_provider_providerAccountId_key" ON "Account"("provider", "providerAccountId");
50+
51+
-- CreateIndex
52+
CREATE UNIQUE INDEX "Session_sessionToken_key" ON "Session"("sessionToken");
53+
54+
-- CreateIndex
55+
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
56+
57+
-- CreateIndex
58+
CREATE UNIQUE INDEX "VerificationToken_token_key" ON "VerificationToken"("token");
59+
60+
-- CreateIndex
61+
CREATE UNIQUE INDEX "VerificationToken_identifier_token_key" ON "VerificationToken"("identifier", "token");
62+
63+
-- AddForeignKey
64+
ALTER TABLE "Account" ADD CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
65+
66+
-- AddForeignKey
67+
ALTER TABLE "Session" ADD CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
-- CreateTable
2+
CREATE TABLE "Chat" (
3+
"id" TEXT NOT NULL,
4+
"userId" TEXT NOT NULL,
5+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
6+
"updatedAt" TIMESTAMP(3) NOT NULL,
7+
8+
CONSTRAINT "Chat_pkey" PRIMARY KEY ("id")
9+
);
10+
11+
-- CreateTable
12+
CREATE TABLE "Message" (
13+
"id" TEXT NOT NULL,
14+
"chatId" TEXT NOT NULL,
15+
"content" TEXT NOT NULL,
16+
"role" TEXT NOT NULL,
17+
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
18+
"updatedAt" TIMESTAMP(3) NOT NULL,
19+
20+
CONSTRAINT "Message_pkey" PRIMARY KEY ("id")
21+
);
22+
23+
-- CreateIndex
24+
CREATE INDEX "Chat_userId_idx" ON "Chat"("userId");
25+
26+
-- CreateIndex
27+
CREATE INDEX "Message_chatId_idx" ON "Message"("chatId");
28+
29+
-- AddForeignKey
30+
ALTER TABLE "Chat" ADD CONSTRAINT "Chat_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
31+
32+
-- AddForeignKey
33+
ALTER TABLE "Message" ADD CONSTRAINT "Message_chatId_fkey" FOREIGN KEY ("chatId") REFERENCES "Chat"("id") ON DELETE CASCADE ON UPDATE CASCADE;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Please do not edit this file manually
2+
# It should be added in your version-control system (e.g., Git)
3+
provider = "postgresql"

0 commit comments

Comments
 (0)