IamtheFuture
IamtheFuture
CCConvex Community
Created by IamtheFuture on 9/6/2024 in #support-community
Batch Patch Error
thanks, it worked
3 replies
CCConvex Community
Created by IamtheFuture on 9/1/2024 in #support-community
Query Speed Up
oh, great, now am good :convex: 😋
7 replies
CCConvex Community
Created by IamtheFuture on 9/1/2024 in #support-community
Query Speed Up
Not really yet, but from the standpoint of a large data and knowing the every database query counts a function call, Am just looking for more ways to optimise the queries, and also am yet to really graps how relationship work with the convex db
7 replies
CCConvex Community
Created by IamtheFuture on 9/1/2024 in #support-community
Query Speed Up
products: defineTable({
name: v.string(),
description: v.string(),
price: v.number(),
slug: v.string(),
stock: v.number(),
theme: v.id("themes"),
commission: v.number(),
downline: v.number(),
indirectDownline: v.number(),
imageUrl: v.string(),
isFeatured: v.boolean(),
discount: v.number(),
rating: v.number(),
sold: v.number(),
status: v.string(),
orders: v.optional(v.array(v.id("orders"))),
category: v.id("categories"),
customers: v.optional(v.array(v.id("customers"))),
})
.index("category", ["category"])
.index("status", ["status"])
.index("theme", ["theme"])
.index("isFeatured", ["isFeatured"]),
products: defineTable({
name: v.string(),
description: v.string(),
price: v.number(),
slug: v.string(),
stock: v.number(),
theme: v.id("themes"),
commission: v.number(),
downline: v.number(),
indirectDownline: v.number(),
imageUrl: v.string(),
isFeatured: v.boolean(),
discount: v.number(),
rating: v.number(),
sold: v.number(),
status: v.string(),
orders: v.optional(v.array(v.id("orders"))),
category: v.id("categories"),
customers: v.optional(v.array(v.id("customers"))),
})
.index("category", ["category"])
.index("status", ["status"])
.index("theme", ["theme"])
.index("isFeatured", ["isFeatured"]),
7 replies
CCConvex Community
Created by IamtheFuture on 9/1/2024 in #support-community
Query Speed Up
this is my current schema
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()),
role: v.string(),
})
.index("email", ["email"])
.index("role", ["role"]),
customers: defineTable({
userId: v.id("users"),
firstName: v.string(),
lastName: v.string(),
downline: v.array(v.id("downlines")),
upline: v.id("customers"),
bankName: v.string(),
accountName: v.string(),
accountNumber: v.string(),
pin: v.string(),
payments: v.array(v.id("payments")),
orders: v.array(v.id("orders")),
earning: v.number(),
active: v.boolean(),
products: v.optional(v.array(v.id("products"))),
})
.index("userId", ["userId"])
.index("product", ["products"]),
downlines: defineTable({
leader: v.id("customers"),
product: v.id("products"),
follower: v.id("customers"),
level: v.string(),
commission: v.optional(v.number()),
indirectCommision: v.optional(v.number()),
totalCommision: v.optional(v.number()),
totalIndirectCommision: v.optional(v.number()),
totalCommisionEarned: v.optional(v.number()),
type: v.string(),
}).index("customer", ["leader", "follower"]),
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()),
role: v.string(),
})
.index("email", ["email"])
.index("role", ["role"]),
customers: defineTable({
userId: v.id("users"),
firstName: v.string(),
lastName: v.string(),
downline: v.array(v.id("downlines")),
upline: v.id("customers"),
bankName: v.string(),
accountName: v.string(),
accountNumber: v.string(),
pin: v.string(),
payments: v.array(v.id("payments")),
orders: v.array(v.id("orders")),
earning: v.number(),
active: v.boolean(),
products: v.optional(v.array(v.id("products"))),
})
.index("userId", ["userId"])
.index("product", ["products"]),
downlines: defineTable({
leader: v.id("customers"),
product: v.id("products"),
follower: v.id("customers"),
level: v.string(),
commission: v.optional(v.number()),
indirectCommision: v.optional(v.number()),
totalCommision: v.optional(v.number()),
totalIndirectCommision: v.optional(v.number()),
totalCommisionEarned: v.optional(v.number()),
type: v.string(),
}).index("customer", ["leader", "follower"]),
7 replies
CCConvex Community
Created by IamtheFuture on 8/28/2024 in #support-community
Nextjs Api auth header from external app
wow, great thanks so much, i will give this a try
11 replies
CCConvex Community
Created by IamtheFuture on 8/28/2024 in #support-community
Nextjs Api auth header from external app
or is there a way I can just implement my own custom auth(password, oauth, magick-link, e.t.c) with convex. I know how to use lucia-auth well, maybe I can implement it with it
11 replies
CCConvex Community
Created by IamtheFuture on 8/28/2024 in #support-community
Nextjs Api auth header from external app
ok, great, then how do I check the token validity of the token on the api or middleware
11 replies
CCConvex Community
Created by IamtheFuture on 8/28/2024 in #support-community
Nextjs Api auth header from external app
yes, but they would be accessing from a mobile app
11 replies