Merge branch 'develop' of ssh://gitea.gofwd.group:2225/dstrawsb/ballistic-builder into develop

This commit is contained in:
2024-11-27 06:54:55 -05:00
8 changed files with 54 additions and 180 deletions

11
package-lock.json generated
View File

@@ -25,7 +25,7 @@
"class-variance-authority": "^0.7.0", "class-variance-authority": "^0.7.0",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"drizzle-orm": "^0.36.3", "drizzle-orm": "^0.36.4",
"fontsource-roboto": "^4.0.0", "fontsource-roboto": "^4.0.0",
"framer-motion": "^11.11.17", "framer-motion": "^11.11.17",
"lucide-react": "^0.460.0", "lucide-react": "^0.460.0",
@@ -5411,17 +5411,16 @@
} }
}, },
"node_modules/drizzle-orm": { "node_modules/drizzle-orm": {
"version": "0.36.3", "version": "0.36.4",
"resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.36.3.tgz", "resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.36.4.tgz",
"integrity": "sha512-ffQB7CcyCTvQBK6xtRLMl/Jsd5xFTBs+UTHrgs1hbk68i5TPkbsoCPbKEwiEsQZfq2I7VH632XJpV1g7LS2H9Q==", "integrity": "sha512-1OZY3PXD7BR00Gl61UUOFihslDldfH4NFRH2MbP54Yxi0G/PKn4HfO65JYZ7c16DeP3SpM3Aw+VXVG9j6CRSXA==",
"license": "Apache-2.0",
"peerDependencies": { "peerDependencies": {
"@aws-sdk/client-rds-data": ">=3", "@aws-sdk/client-rds-data": ">=3",
"@cloudflare/workers-types": ">=3", "@cloudflare/workers-types": ">=3",
"@electric-sql/pglite": ">=0.2.0", "@electric-sql/pglite": ">=0.2.0",
"@libsql/client": ">=0.10.0", "@libsql/client": ">=0.10.0",
"@libsql/client-wasm": ">=0.10.0", "@libsql/client-wasm": ">=0.10.0",
"@neondatabase/serverless": ">=0.1", "@neondatabase/serverless": ">=0.10.0",
"@op-engineering/op-sqlite": ">=2", "@op-engineering/op-sqlite": ">=2",
"@opentelemetry/api": "^1.4.1", "@opentelemetry/api": "^1.4.1",
"@planetscale/database": ">=1", "@planetscale/database": ">=1",

View File

@@ -1,6 +1,6 @@
{ {
"name": "balistics-builder", "name": "balistics-builder",
"version": "0.1.0", "version": "0.2.0",
"private": "true", "private": "true",
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
@@ -21,12 +21,11 @@
"@mui/styles": "^6.1.7", "@mui/styles": "^6.1.7",
"@mui/system": "^6.1.7", "@mui/system": "^6.1.7",
"@mui/x-data-grid": "^7.22.2", "@mui/x-data-grid": "^7.22.2",
"@prisma/client": "^5.22.0",
"@radix-ui/react-slot": "^1.1.0", "@radix-ui/react-slot": "^1.1.0",
"class-variance-authority": "^0.7.0", "class-variance-authority": "^0.7.0",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"drizzle-orm": "^0.36.3", "drizzle-orm": "^0.36.4",
"fontsource-roboto": "^4.0.0", "fontsource-roboto": "^4.0.0",
"framer-motion": "^11.11.17", "framer-motion": "^11.11.17",
"lucide-react": "^0.460.0", "lucide-react": "^0.460.0",
@@ -50,7 +49,6 @@
"eslint": "^8", "eslint": "^8",
"eslint-config-next": "15.0.3", "eslint-config-next": "15.0.3",
"postcss": "^8", "postcss": "^8",
"prisma": "^5.22.0",
"tailwindcss": "^3.4.15", "tailwindcss": "^3.4.15",
"tsx": "^4.19.2", "tsx": "^4.19.2",
"typescript": "^5.6.3" "typescript": "^5.6.3"

View File

@@ -1,122 +0,0 @@
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Post {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime
title String?
content String?
published Boolean @default(false)
authorId Int
User User @relation(fields: [authorId], references: [id])
@@index([id])
}
model Profile {
id Int @id @default(autoincrement())
bio String?
userId Int @unique
User User @relation(fields: [userId], references: [id])
@@index([id])
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
Post Post[]
Profile Profile?
@@index([id])
}
model lipseycatalog {
id Int @id @default(autoincrement())
itemno String @db.VarChar(20)
description1 String?
description2 String?
upc String? @db.VarChar(20)
manufacturermodelno String? @db.VarChar(30)
msrp Float?
model String?
calibergauge String?
manufacturer String?
type String?
action String?
barrellength String?
capacity String?
finish String?
overalllength String?
receiver String?
safety String?
sights String?
stockframegrips String?
magazine String?
weight String?
imagename String?
chamber String?
drilledandtapped String?
rateoftwist String?
itemtype String?
additionalfeature1 String?
additionalfeature2 String?
additionalfeature3 String?
shippingweight String?
boundbookmanufacturer String?
boundbookmodel String?
boundbooktype String?
nfathreadpattern String?
nfaattachmentmethod String?
nfabaffletype String?
silencercanbedisassembled String?
silencerconstructionmaterial String?
nfadbreduction String?
silenceroutsidediameter String?
nfaform3caliber String?
opticmagnification String?
maintubesize String?
adjustableobjective String?
objectivesize String?
opticadjustments String?
illuminatedreticle String?
reticle String?
exclusive String?
quantity String? @db.VarChar(10)
allocated String?
onsale String?
price Float?
currentprice Float?
retailmap Float?
fflrequired String?
sotrequired String?
exclusivetype String?
scopecoverincluded String?
special String?
sightstype String?
case String?
choke String?
dbreduction String?
family String?
finishtype String?
frame String?
griptype String? @db.VarChar(30)
handgunslidematerial String?
countryoforigin String? @db.VarChar(4)
itemlength String?
itemwidth String?
itemheight String?
packagelength Float?
packagewidth Float?
packageheight Float?
itemgroup String? @db.VarChar(40)
createdon DateTime? @db.Timestamp(6)
}

View File

@@ -1,4 +1,8 @@
<<<<<<< HEAD
import { Button } from "@components/ui/button" import { Button } from "@components/ui/button"
=======
import { Button } from "src/components/ui/button";
>>>>>>> 2454b1dc14659dae1bc827566b8c071e89ce3ac5
export default function BuilderPage() { export default function BuilderPage() {

View File

@@ -1,4 +1,5 @@
import { Box, Flex, Link, Heading } from "@chakra-ui/react"; import { Box, Flex, Link, Heading } from "@chakra-ui/react";
import NextLink from 'next/link';
const Header: React.FC = () => { const Header: React.FC = () => {
return ( return (
@@ -7,29 +8,27 @@ const Header: React.FC = () => {
<Flex justify="space-between" align="center" maxW="5xl" mx="auto"> <Flex justify="space-between" align="center" maxW="5xl" mx="auto">
<Heading as="h1" size="lg"> <Heading as="h1" size="lg">
{/* <NextLink href="/" passHref> */}
<Link color="#374151" _hover={{ textDecoration: "none" }}> <Link color="#374151" _hover={{ textDecoration: "none" }}>
Ballistic Builder <NextLink href="/" passHref> Ballistic Builder </NextLink>
</Link> </Link>
{/* </NextLink> */}
</Heading> </Heading>
<Flex as="nav" gap="6"> <Flex as="nav" gap="6">
{/* <NextLink href="/builder" passHref> */}
<Link color="#374151" _hover={{ textDecoration: "underline" }}> <Link color="#374151" _hover={{ textDecoration: "underline" }}>
Builder <NextLink href="/builder" passHref> Builder </NextLink>
</Link> </Link>
{/* </NextLink> */}
{/* <NextLink href="/products" passHref> */}
<Link color="#374151" _hover={{ textDecoration: "underline" }}> <Link color="#374151" _hover={{ textDecoration: "underline" }}>
Products <NextLink href="/products" passHref> Products </NextLink>
</Link> </Link>
{/* </NextLink> */}
{/* <NextLink href="/auth/signin" passHref> */}
<Link color="#374151" _hover={{ textDecoration: "underline" }}> <Link color="#374151" _hover={{ textDecoration: "underline" }}>
Sign In <NextLink href="/auth/signin" passHref> Sign In </NextLink>
</Link> </Link>
{/* </NextLink> */}
</Flex> </Flex>
</Flex> </Flex>
</Box> </Box>

View File

@@ -1,3 +1,13 @@
import { relations } from "drizzle-orm/relations"; import { relations } from "drizzle-orm/relations";
import { } from "./schema"; import { balAccounts, builds } from "./schema";
export const buildsRelations = relations(builds, ({one}) => ({
balAccount: one(balAccounts, {
fields: [builds.accountId],
references: [balAccounts.id]
}),
}));
export const balAccountsRelations = relations(balAccounts, ({many}) => ({
builds: many(builds),
}));

View File

@@ -1,6 +1,8 @@
import { pgTable, integer, varchar, timestamp, text, numeric, unique, doublePrecision } from "drizzle-orm/pg-core" import { pgTable, integer, varchar, timestamp, text, numeric, unique, foreignKey, doublePrecision } from "drizzle-orm/pg-core"
import { sql } from "drizzle-orm" import { sql } from "drizzle-orm"
export const productFeeds = pgTable("product_feeds", { export const productFeeds = pgTable("product_feeds", {
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "productfeeds_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }), id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "productfeeds_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
resellerId: integer("reseller_id").notNull(), resellerId: integer("reseller_id").notNull(),
@@ -49,13 +51,6 @@ export const manufacturer = pgTable("manufacturer", {
deletedAt: timestamp("deleted_at", { mode: 'string' }), deletedAt: timestamp("deleted_at", { mode: 'string' }),
}); });
export const baseTable = pgTable("base_table", {
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "base_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
deletedAt: timestamp("deleted_at", { mode: 'string' }),
});
export const componentType = pgTable("component_type", { export const componentType = pgTable("component_type", {
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "component_type_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }), id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "component_type_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
name: varchar({ length: 100 }).notNull(), name: varchar({ length: 100 }).notNull(),
@@ -80,13 +75,22 @@ export const balAccounts = pgTable("bal_accounts", {
email: varchar({ length: 100 }), email: varchar({ length: 100 }),
username: varchar({ length: 50 }).notNull(), username: varchar({ length: 50 }).notNull(),
passwordHash: varchar("password_hash", { length: 255 }).notNull(), passwordHash: varchar("password_hash", { length: 255 }).notNull(),
}, (table) => { }, (self) => {
return { return {
balAccountsUsernameUnique: unique("bal_accounts_username_unique").on(table.username), balAccountsUsernameUnique: unique("bal_accounts_username_unique").on(table.username),
balAccountsPasswordHashUnique: unique("bal_accounts_password_hash_unique").on(table.passwordHash), balAccountsPasswordHashUnique: unique("bal_accounts_password_hash_unique").on(table.passwordHash),
} }
}); });
export const buildsComponents = pgTable("builds_components", {
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "build_components_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
buildId: integer("build_id").notNull(),
productId: integer("product_id").notNull(),
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
deletedAt: timestamp("deleted_at", { mode: 'string' }),
});
export const builds = pgTable("builds", { export const builds = pgTable("builds", {
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "build_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }), id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "build_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
accountId: integer("account_id").notNull(), accountId: integer("account_id").notNull(),
@@ -95,15 +99,14 @@ export const builds = pgTable("builds", {
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(), updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(), createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
deletedAt: timestamp("deleted_at", { mode: 'string' }), deletedAt: timestamp("deleted_at", { mode: 'string' }),
}); }, (table) => {
return {
export const buildsComponents = pgTable("builds_components", { buildsBalAccountsFk: foreignKey({
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "build_components_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }), columns: [table.accountId],
buildId: integer("build_id").notNull(), foreignColumns: [balAccounts.id],
productId: integer("product_id").notNull(), name: "builds_bal_accounts_fk"
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(), }),
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(), }
deletedAt: timestamp("deleted_at", { mode: 'string' }),
}); });
export const lipseycatalog = pgTable("lipseycatalog", { export const lipseycatalog = pgTable("lipseycatalog", {

View File

@@ -1,17 +0,0 @@
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
async function main() {
// ... you will write your Prisma Client queries here
}
main()
.then(async () => {
await prisma.$disconnect()
})
.catch(async (e) => {
console.error(e)
await prisma.$disconnect()
process.exit(1)
})