Skip to content
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
cb90378
chore: update configuration files and workflows
techwithanirudh Sep 9, 2025
e0b9ea7
chore: update configuration files and workflows
techwithanirudh Sep 9, 2025
8cdae14
chore: add environment configuration and spell checking tools
techwithanirudh Sep 9, 2025
623433c
refactor: replace process.env with env module for environment variabl…
techwithanirudh Sep 9, 2025
16ab40b
chore: update database schema and configuration
techwithanirudh Sep 9, 2025
61d30d6
chore: update package dependencies and lock file
techwithanirudh Sep 9, 2025
6af7d29
chore: update package dependencies and lock file
techwithanirudh Sep 9, 2025
e3f1113
chore: refactor database access and update biome configuration
techwithanirudh Sep 9, 2025
31a28e0
chore: update zod dependency to version 4.1.5
techwithanirudh Sep 9, 2025
b5dd7ff
chore: update linting rules and address unused parameters
techwithanirudh Sep 9, 2025
c6cc90a
chore: streamline environment variable management and update scripts
techwithanirudh Sep 9, 2025
14fedd2
chore: add migration for renaming Document column and update schema
techwithanirudh Sep 9, 2025
e351059
fix: adjust button padding and update environment variable handling
techwithanirudh Sep 9, 2025
ec4d5b3
chore: update motion library and remove framer-motion references
techwithanirudh Sep 9, 2025
d5b5415
chore: update cspell configuration and add CI workflow
techwithanirudh Sep 9, 2025
b0ff29c
chore: remove TODO.md and update chat actions
techwithanirudh Sep 9, 2025
ec9da91
chore: enhance environment variable handling and update scripts
techwithanirudh Sep 9, 2025
6f4fb86
Merge branch 'main' of https://github.com/vercel/ai-chatbot into feat…
techwithanirudh Sep 9, 2025
dcc1c87
fix: remove eslint
techwithanirudh Sep 9, 2025
1a9b269
Update env.ts
techwithanirudh Sep 10, 2025
9ce25bb
fix: make REDIS_URL optional in environment configuration
techwithanirudh Sep 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .cspell.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"dictionaries": [
"software-terms",
"npm",
"fullstack"
],
"files": [
"**",
".vscode/**",
".github/**"
],
"ignorePaths": [
"pnpm-lock.yaml",
"bun.lock",
"bun.lockb",
"lib/db/migrations"
],
"ignoreRegExpList": [
"apiKey='[a-zA-Z0-9-]{32}'"
],
"import": [
"@cspell/dict-bash/cspell-ext.json"
],
"useGitignore": true,
"version": "0.2",
"words": [
"turbopack",
"remark",
"katex",
"lefthook",
"orama",
"catppuccin",
"inkeep",
"devcontainers",
"twoslash",
"vitesse",
"scira",
"subsecond",
"bprogress",
"contentlayer",
"basehub",
"shadcn",
"subcomponents",
"nuqs",
"nocompatible",
"pseudoelements",
"matplotlib",
"pyplot",
"savefig",
"Pyodide",
"unparse",
"papaparse",
"diffview",
"autofocus",
"Vercelians",
"orderedmap",
"prosemirror",
"hitbox",
"usehooks",
"inputrules",
"Delba",
"Oliveira",
"upvoting",
"downvoting",
"downvoted",
"noninteractive",
"generationtime",
"vaul",
"nums",
"groq",
"deepseek",
"sdxl",
"logprobs",
"dall",
"textblock",
"Geordanna",
"Cordero",
"Pawel",
"Czerwinski",
"Olah",
"Filipe",
"aisdk",
"yxxx",
"nosniff",
"sameorigin",
"neondatabase",
"viewports",
"authjs",
"webauthn",
"filechooser",
"emilkowalski",
"Embla",
"tokenlens",
"viewbox",
"noblank",
"prefault",
"shiki",
"opengraph"
]
}
55 changes: 55 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "ai-chatbot",
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
"forwardPorts": [
3000
],
"portsAttributes": {
"3000": {
"label": "Web",
"onAutoForward": "notify"
}
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"configureZshAsDefaultShell": true
},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"containerEnv": {},
"remoteEnv": {},
"customizations": {
"vscode": {
"extensions": [
// TypeScript
"better-ts-errors.better-ts-errors",
// Other
"bradlc.vscode-tailwindcss",
"streetsidesoftware.code-spell-checker",
"biomejs.biome",
"aaron-bond.better-comments",
"formulahendry.auto-rename-tag"
],
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh",
"debug.internalConsoleOptions": "neverOpen",
"editor.formatOnPaste": true,
"editor.guides.bracketPairs": "active",
"scm.defaultViewMode": "tree",
"diffEditor.diffAlgorithm": "advanced",
"diffEditor.experimental.showMoves": true,
"diffEditor.renderSideBySide": false,
"files.watcherExclude": {
"**/node_modules/**": true
},
// Prettifies the response with emojis and such.
"betterTypeScriptErrors.prettify": true
}
}
},
"postCreateCommand": {
"web": "pnpm install",
"playwright": "pnpm exec playwright install-deps && pnpm exec playwright install"
}
}
33 changes: 33 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Check setup
description: Set up Node, and pnpm, prime caches, and install dependencies.

runs:
using: composite
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false

- name: Get pnpm store path
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
push:

jobs:
types:
name: TypeScript
runs-on: ubuntu-22.04

steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Generate types
run: pnpm typegen

- name: Run type check
run: pnpm typecheck

biome:
name: Biome
runs-on: ubuntu-22.04
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Run Biome
run: pnpm check

spelling:
name: Spelling
runs-on: ubuntu-22.04
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Run spelling check
run: pnpm check:spelling
25 changes: 0 additions & 25 deletions .github/workflows/lint.yml

This file was deleted.

34 changes: 3 additions & 31 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,8 @@ jobs:
with:
fetch-depth: 1

- uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup
uses: ./.github/actions/setup

- name: Cache Playwright browsers
uses: actions/cache@v3
Expand All @@ -70,4 +42,4 @@ jobs:
with:
name: playwright-report
path: playwright-report/
retention-days: 7
retention-days: 7
13 changes: 6 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,19 @@ yarn-error.log*
.pnpm-debug.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local
.env*
!.env.example

# turbo
.turbo

.env
.vercel
.env*.local
.pnpm-store

# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/*

# cspell
.cspellcache
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.19.0
2 changes: 1 addition & 1 deletion app/(auth)/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { createUser, getUser } from '@/lib/db/queries';
import { signIn } from './auth';

const authFormSchema = z.object({
email: z.string().email(),
email: z.email(),
password: z.string().min(6),
});

Expand Down
7 changes: 4 additions & 3 deletions app/(auth)/api/auth/guest/route.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { signIn } from '@/app/(auth)/auth';
import { isDevelopmentEnvironment } from '@/lib/constants';
import { getToken } from 'next-auth/jwt';
import { NextResponse } from 'next/server';
import { NextRequest, NextResponse } from 'next/server';
import { env } from '@/env';

export async function GET(request: Request) {
export async function GET(request: NextRequest) {
const { searchParams } = new URL(request.url);
const redirectUrl = searchParams.get('redirectUrl') || '/';

const token = await getToken({
req: request,
secret: process.env.AUTH_SECRET,
secret: env.AUTH_SECRET,
secureCookie: !isDevelopmentEnvironment,
});

Expand Down
4 changes: 2 additions & 2 deletions app/(chat)/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { cookies } from 'next/headers';
import {
deleteMessagesByChatIdAfterTimestamp,
getMessageById,
updateChatVisiblityById,
updateChatVisibilityById,
} from '@/lib/db/queries';
import type { VisibilityType } from '@/components/visibility-selector';
import { myProvider } from '@/lib/ai/providers';
Expand Down Expand Up @@ -49,5 +49,5 @@ export async function updateChatVisibility({
chatId: string;
visibility: VisibilityType;
}) {
await updateChatVisiblityById({ chatId, visibility });
await updateChatVisibilityById({ chatId, visibility });
}
Loading