I think monorepo is fairly correct now but I don't know for sure

This commit is contained in:
2026-01-11 13:56:30 -05:00
parent 67daefb919
commit 674b224467
38 changed files with 485 additions and 412 deletions

View File

@@ -1,11 +1,36 @@
import { defineSchema, defineTable } from 'convex/server';
import { v } from 'convex/values';
import { authTables } from '@convex-dev/auth/server';
const applicationTables = {
// Users contains name image & email.
// If you would like to save any other information,
// I would recommend including this profiles table
// where you can include settings & anything else you would like tied to the user.
profiles: defineTable({
userId: v.id('users'),
theme_preference: v.optional(v.string()),
})
.index('userId', ['userId'])
};
export default defineSchema({
notes: defineTable({
userId: v.string(),
title: v.string(),
content: v.string(),
summary: v.optional(v.string()),
}),
...authTables,
// Default table for users directly from authTable.
// You can extend it if you would like, but it may
// be better to just use the profiles table example
// below.
users: defineTable({
name: v.optional(v.string()),
image: v.optional(v.string()),
email: v.optional(v.string()),
emailVerificationTime: v.optional(v.number()),
phone: v.optional(v.string()),
phoneVerificationTime: v.optional(v.number()),
isAnonymous: v.optional(v.boolean()),
})
.index("email", ["email"])
.index('name', ['name'])
.index("phone", ["phone"]),
...applicationTables,
});