streaming, markdown, model selecting, and lots more
This commit is contained in:
@@ -5,11 +5,11 @@ the Veridian repository.
|
||||
|
||||
## Project Overview
|
||||
|
||||
Veridian is a Nuxt 4 application built with TypeScript, using PostgreSQL with
|
||||
Drizzle ORM, better-auth for authentication, and UnoCSS for styling. The app is
|
||||
an agnetic chat platform that is meant to provide a well rounded experience for
|
||||
interacting with LLMs as well as providing a way to manage agents and provide
|
||||
helpful tools like RAG (retrieval augmented generation) and web scraping/search.
|
||||
Veridian is a Nuxt 4 application built with TypeScript, using Triplit with
|
||||
better-auth for authentication, and UnoCSS for styling. The app is an agnetic
|
||||
chat platform that is meant to provide a well rounded experience for interacting
|
||||
with LLMs as well as providing a way to manage agents and provide helpful tools
|
||||
like RAG (retrieval augmented generation) and web scraping/search.
|
||||
|
||||
You should be connected to the Nuxt docs MCP server, if you need to reference
|
||||
the documentation or are unsure on how to implement something, consult the
|
||||
@@ -24,18 +24,14 @@ database commands.
|
||||
|
||||
### Database Commands
|
||||
|
||||
- `tsx db/migrate.ts` - Run database migrations
|
||||
- `bun x @better-auth/cli@latest generate --output db/auth/auth.schema.ts` -
|
||||
Generate authentication schema based on `lib/auth.ts`
|
||||
- `bun x drizzle-kit generate` - Generate migration files
|
||||
- `bun x drizzle-kit push` - Push schema changes to database
|
||||
- `bun x drizzle-kit studio` - Open Drizzle Studio for database inspection
|
||||
- `bunx triplit schema push` - Push schema changes to database
|
||||
|
||||
## Tech Stack & Dependencies
|
||||
|
||||
- **Framework**: Nuxt 4 (SSR enabled)
|
||||
- **Language**: TypeScript with strict configuration
|
||||
- **Database**: PostgreSQL with Drizzle ORM
|
||||
- **Database**: Triplit (next generation fullstack syncing database, sort of
|
||||
like convex)
|
||||
- **Auth**: better-auth with email/password and social providers
|
||||
- **Styling**: UnoCSS with presetMini
|
||||
- **Icons**: @nuxt/icon with Iconify, use Myna UI Icons
|
||||
@@ -116,12 +112,10 @@ the source is uniform and easy to follow.**
|
||||
|
||||
### Database Patterns
|
||||
|
||||
- Use Drizzle ORM with PostgreSQL
|
||||
- Export all schemas from `db/schema.ts`
|
||||
- Use Triplit for database operations
|
||||
- Export all schemas from `triplit/schema.ts`
|
||||
- Use environment variables for database credentials
|
||||
- `db/auth/auth.schema.ts` is a generated file, do not touch it. If you need to
|
||||
change the authentication schema, edit `lib/auth.ts` and run the generation
|
||||
script.
|
||||
- Triplit schemas are defined in `triplit/schema.ts` and pushed using `bunx triplit schema push`
|
||||
|
||||
### Error Handling
|
||||
|
||||
@@ -142,7 +136,7 @@ the source is uniform and easy to follow.**
|
||||
The app uses better-auth with:
|
||||
|
||||
- Email/password authentication (configurable via env vars)
|
||||
- Drizzle adapter for PostgreSQL
|
||||
- Triplit adapter for authentication
|
||||
- Session management through cookies
|
||||
- Auth plugins in `app/plugins/` for client/server initialization
|
||||
- Global auth middleware in `app/middleware/auth.global.ts`
|
||||
@@ -165,10 +159,10 @@ user must be authenticated.
|
||||
│ \-- plugins/ # Vue/Nuxt plugins
|
||||
|-- server/ # Server-side code
|
||||
│ \-- api/ # API routes
|
||||
|-- db/ # Database related files
|
||||
|-- triplit/ # Database related files
|
||||
│ |-- schema.ts # Database schema
|
||||
│ |-- migrate.ts # Migration runner
|
||||
│ \-- migrations/ # Migration files
|
||||
│ |-- client.ts # Interacts with the database on the client
|
||||
│ \-- server.ts # Interacts with the database on the server
|
||||
\-- lib/ # Shared utilities
|
||||
```
|
||||
|
||||
@@ -181,10 +175,12 @@ requirement.
|
||||
|
||||
Key environment variables:
|
||||
|
||||
- `DATABASE_URL` - PostgreSQL connection string
|
||||
- `BETTER_AUTH_SECRET` - Authentication secret
|
||||
- `DISABLE_LOCAL_AUTH` - Disable email/password auth
|
||||
- `DISABLE_SIGNUP` - Disable user registration
|
||||
- `TRIPLIT_SERVICE_TOKEN` - Triplit service token (admin token. **SECRET**)
|
||||
- `NUXT_TRIPLIT_ANON_TOKEN` - Triplit anonymous token (for anonymous access)
|
||||
- `BETTER_AUTH_SECRET` - Authentication secret (for better-auth)
|
||||
- `EXTERNAL_JWT_SECRET` - Will always be BETTER_AUTH_SECRET (used for
|
||||
verifying JWT tokens from better-auth)
|
||||
- `NUXT_PUBLIC_TRIPLIT_URL` - Triplit server URL
|
||||
|
||||
## Common Patterns
|
||||
|
||||
|
||||
Reference in New Issue
Block a user