-
Notifications
You must be signed in to change notification settings - Fork 771
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
177 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ RESEND_API_KEY="re_" | |
# Register a domain at https://resend.com/domains | ||
# Or we can use this email provided by resend for only testing: "[email protected]" | ||
# It is not recommended tho | ||
EMAIL_FROM_ADDRESS="mail@[yourdomain]" | ||
EMAIL_FROM_ADDRESS="mail@your_domain.com" | ||
|
||
# uploadthing | ||
UPLOADTHING_SECRET="sk_live_" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,119 +1,168 @@ | ||
import { mysqlTable, mysqlSchema, AnyMySqlColumn, primaryKey, serial, varchar, timestamp, json, tinyint, int, decimal, text, mysqlEnum } from "drizzle-orm/mysql-core" | ||
import { sql } from "drizzle-orm" | ||
import { | ||
AnyMySqlColumn, | ||
decimal, | ||
int, | ||
json, | ||
mysqlEnum, | ||
mysqlSchema, | ||
mysqlTable, | ||
primaryKey, | ||
serial, | ||
text, | ||
timestamp, | ||
tinyint, | ||
varchar, | ||
} from "drizzle-orm/mysql-core" | ||
|
||
export const addresses = mysqlTable( | ||
"addresses", | ||
{ | ||
id: serial("id").notNull(), | ||
line1: varchar("line1", { length: 191 }), | ||
line2: varchar("line2", { length: 191 }), | ||
city: varchar("city", { length: 191 }), | ||
state: varchar("state", { length: 191 }), | ||
postalCode: varchar("postalCode", { length: 191 }), | ||
country: varchar("country", { length: 191 }), | ||
createdAt: timestamp("createdAt", { mode: "string" }).defaultNow(), | ||
}, | ||
(table) => { | ||
return { | ||
addressesId: primaryKey(table.id), | ||
} | ||
} | ||
) | ||
|
||
export const addresses = mysqlTable("addresses", { | ||
id: serial("id").notNull(), | ||
line1: varchar("line1", { length: 191 }), | ||
line2: varchar("line2", { length: 191 }), | ||
city: varchar("city", { length: 191 }), | ||
state: varchar("state", { length: 191 }), | ||
postalCode: varchar("postalCode", { length: 191 }), | ||
country: varchar("country", { length: 191 }), | ||
createdAt: timestamp("createdAt", { mode: 'string' }).defaultNow(), | ||
}, | ||
(table) => { | ||
return { | ||
addressesId: primaryKey(table.id), | ||
} | ||
}); | ||
export const carts = mysqlTable( | ||
"carts", | ||
{ | ||
id: serial("id").notNull(), | ||
paymentIntentId: varchar("paymentIntentId", { length: 191 }), | ||
clientSecret: varchar("clientSecret", { length: 191 }), | ||
items: json("items").default("null"), | ||
createdAt: timestamp("createdAt", { mode: "string" }).defaultNow(), | ||
closed: tinyint("closed").default(0).notNull(), | ||
}, | ||
(table) => { | ||
return { | ||
cartsId: primaryKey(table.id), | ||
} | ||
} | ||
) | ||
|
||
export const carts = mysqlTable("carts", { | ||
id: serial("id").notNull(), | ||
paymentIntentId: varchar("paymentIntentId", { length: 191 }), | ||
clientSecret: varchar("clientSecret", { length: 191 }), | ||
items: json("items").default('null'), | ||
createdAt: timestamp("createdAt", { mode: 'string' }).defaultNow(), | ||
closed: tinyint("closed").default(0).notNull(), | ||
}, | ||
(table) => { | ||
return { | ||
cartsId: primaryKey(table.id), | ||
} | ||
}); | ||
export const emailPreferences = mysqlTable( | ||
"email_preferences", | ||
{ | ||
id: serial("id").notNull(), | ||
userId: varchar("userId", { length: 191 }), | ||
email: varchar("email", { length: 191 }).notNull(), | ||
token: varchar("token", { length: 191 }).notNull(), | ||
newsletter: tinyint("newsletter").default(0).notNull(), | ||
marketing: tinyint("marketing").default(0).notNull(), | ||
transactional: tinyint("transactional").default(0).notNull(), | ||
createdAt: timestamp("createdAt", { mode: "string" }).defaultNow(), | ||
}, | ||
(table) => { | ||
return { | ||
emailPreferencesId: primaryKey(table.id), | ||
} | ||
} | ||
) | ||
|
||
export const emailPreferences = mysqlTable("email_preferences", { | ||
id: serial("id").notNull(), | ||
userId: varchar("userId", { length: 191 }), | ||
email: varchar("email", { length: 191 }).notNull(), | ||
token: varchar("token", { length: 191 }).notNull(), | ||
newsletter: tinyint("newsletter").default(0).notNull(), | ||
marketing: tinyint("marketing").default(0).notNull(), | ||
transactional: tinyint("transactional").default(0).notNull(), | ||
createdAt: timestamp("createdAt", { mode: 'string' }).defaultNow(), | ||
}, | ||
(table) => { | ||
return { | ||
emailPreferencesId: primaryKey(table.id), | ||
} | ||
}); | ||
export const orders = mysqlTable( | ||
"orders", | ||
{ | ||
id: serial("id").notNull(), | ||
storeId: int("storeId").notNull(), | ||
items: json("items").default("null"), | ||
amount: decimal("amount", { precision: 10, scale: 2 }) | ||
.default("0.00") | ||
.notNull(), | ||
stripePaymentIntentId: varchar("stripePaymentIntentId", { | ||
length: 191, | ||
}).notNull(), | ||
stripePaymentIntentStatus: varchar("stripePaymentIntentStatus", { | ||
length: 191, | ||
}).notNull(), | ||
name: varchar("name", { length: 191 }), | ||
email: varchar("email", { length: 191 }), | ||
addressId: int("addressId"), | ||
createdAt: timestamp("createdAt", { mode: "string" }).defaultNow(), | ||
quantity: int("quantity"), | ||
}, | ||
(table) => { | ||
return { | ||
ordersId: primaryKey(table.id), | ||
} | ||
} | ||
) | ||
|
||
export const orders = mysqlTable("orders", { | ||
id: serial("id").notNull(), | ||
storeId: int("storeId").notNull(), | ||
items: json("items").default('null'), | ||
amount: decimal("amount", { precision: 10, scale: 2 }).default('0.00').notNull(), | ||
stripePaymentIntentId: varchar("stripePaymentIntentId", { length: 191 }).notNull(), | ||
stripePaymentIntentStatus: varchar("stripePaymentIntentStatus", { length: 191 }).notNull(), | ||
name: varchar("name", { length: 191 }), | ||
email: varchar("email", { length: 191 }), | ||
addressId: int("addressId"), | ||
createdAt: timestamp("createdAt", { mode: 'string' }).defaultNow(), | ||
quantity: int("quantity"), | ||
}, | ||
(table) => { | ||
return { | ||
ordersId: primaryKey(table.id), | ||
} | ||
}); | ||
export const payments = mysqlTable( | ||
"payments", | ||
{ | ||
id: serial("id").notNull(), | ||
storeId: int("storeId").notNull(), | ||
stripeAccountId: varchar("stripeAccountId", { length: 191 }).notNull(), | ||
stripeAccountCreatedAt: int("stripeAccountCreatedAt"), | ||
stripeAccountExpiresAt: int("stripeAccountExpiresAt"), | ||
detailsSubmitted: tinyint("detailsSubmitted").default(0).notNull(), | ||
createdAt: timestamp("createdAt", { mode: "string" }).defaultNow(), | ||
}, | ||
(table) => { | ||
return { | ||
paymentsId: primaryKey(table.id), | ||
} | ||
} | ||
) | ||
|
||
export const payments = mysqlTable("payments", { | ||
id: serial("id").notNull(), | ||
storeId: int("storeId").notNull(), | ||
stripeAccountId: varchar("stripeAccountId", { length: 191 }).notNull(), | ||
stripeAccountCreatedAt: int("stripeAccountCreatedAt"), | ||
stripeAccountExpiresAt: int("stripeAccountExpiresAt"), | ||
detailsSubmitted: tinyint("detailsSubmitted").default(0).notNull(), | ||
createdAt: timestamp("createdAt", { mode: 'string' }).defaultNow(), | ||
}, | ||
(table) => { | ||
return { | ||
paymentsId: primaryKey(table.id), | ||
} | ||
}); | ||
export const products = mysqlTable( | ||
"products", | ||
{ | ||
id: serial("id").notNull(), | ||
name: varchar("name", { length: 191 }).notNull(), | ||
description: text("description"), | ||
images: json("images").default("null"), | ||
price: decimal("price", { precision: 10, scale: 2 }) | ||
.default("0.00") | ||
.notNull(), | ||
inventory: int("inventory").default(0).notNull(), | ||
rating: int("rating").default(0).notNull(), | ||
storeId: int("storeId").notNull(), | ||
createdAt: timestamp("createdAt", { mode: "string" }).defaultNow(), | ||
tags: json("tags").default("null"), | ||
category: mysqlEnum("category", [ | ||
"skateboards", | ||
"clothing", | ||
"shoes", | ||
"accessories", | ||
]) | ||
.default("skateboards") | ||
.notNull(), | ||
subcategory: varchar("subcategory", { length: 191 }), | ||
}, | ||
(table) => { | ||
return { | ||
productsId: primaryKey(table.id), | ||
} | ||
} | ||
) | ||
|
||
export const products = mysqlTable("products", { | ||
id: serial("id").notNull(), | ||
name: varchar("name", { length: 191 }).notNull(), | ||
description: text("description"), | ||
images: json("images").default('null'), | ||
price: decimal("price", { precision: 10, scale: 2 }).default('0.00').notNull(), | ||
inventory: int("inventory").default(0).notNull(), | ||
rating: int("rating").default(0).notNull(), | ||
storeId: int("storeId").notNull(), | ||
createdAt: timestamp("createdAt", { mode: 'string' }).defaultNow(), | ||
tags: json("tags").default('null'), | ||
category: mysqlEnum("category", ['skateboards','clothing','shoes','accessories']).default('skateboards').notNull(), | ||
subcategory: varchar("subcategory", { length: 191 }), | ||
}, | ||
(table) => { | ||
return { | ||
productsId: primaryKey(table.id), | ||
} | ||
}); | ||
|
||
export const stores = mysqlTable("stores", { | ||
id: serial("id").notNull(), | ||
userId: varchar("userId", { length: 191 }).notNull(), | ||
name: varchar("name", { length: 191 }).notNull(), | ||
description: text("description"), | ||
slug: text("slug"), | ||
createdAt: timestamp("createdAt", { mode: 'string' }).defaultNow(), | ||
active: tinyint("active").default(0).notNull(), | ||
stripeAccountId: varchar("stripeAccountId", { length: 191 }), | ||
}, | ||
(table) => { | ||
return { | ||
storesId: primaryKey(table.id), | ||
} | ||
}); | ||
export const stores = mysqlTable( | ||
"stores", | ||
{ | ||
id: serial("id").notNull(), | ||
userId: varchar("userId", { length: 191 }).notNull(), | ||
name: varchar("name", { length: 191 }).notNull(), | ||
description: text("description"), | ||
slug: text("slug"), | ||
createdAt: timestamp("createdAt", { mode: "string" }).defaultNow(), | ||
active: tinyint("active").default(0).notNull(), | ||
stripeAccountId: varchar("stripeAccountId", { length: 191 }), | ||
}, | ||
(table) => { | ||
return { | ||
storesId: primaryKey(table.id), | ||
} | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,4 +95,4 @@ export default function ProductLoading() { | |
</div> | ||
</Shell> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fce0b65
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
skateshop – ./
skateshop-sadmann7.vercel.app
skateshop.sadmn.com
skateshop-git-main-sadmann7.vercel.app
skateshop13.vercel.app