initialization

This commit is contained in:
ZareMate 2026-01-14 15:05:36 +01:00
commit 26d140f910
48 changed files with 89552 additions and 0 deletions

24
.env.example Normal file
View File

@ -0,0 +1,24 @@
# Since the ".env" file is gitignored, you can use the ".env.example" file to
# build a new ".env" file when you clone the repo. Keep this file up-to-date
# when you add new variables to `.env`.
# This file will be committed to version control, so make sure not to have any
# secrets in it. If you are cloning this repo, create a copy of this file named
# ".env" and populate it with your secrets.
# When adding additional environment variables, the schema in "/src/env.js"
# should be updated accordingly.
# Next Auth
# You can generate a new secret on the command line with:
# npx auth secret
# https://next-auth.js.org/configuration/options#secret
AUTH_SECRET=""
# Next Auth Discord Provider
AUTH_DISCORD_ID=""
AUTH_DISCORD_SECRET=""
# Prisma
# https://www.prisma.io/docs/reference/database-reference/connection-urls#env
DATABASE_URL="mysql://root:password@localhost:3306/cc-create-shop"

46
.gitignore vendored Normal file
View File

@ -0,0 +1,46 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# database
/prisma/db.sqlite
/prisma/db.sqlite-journal
db.sqlite
# next.js
/.next/
/out/
next-env.d.ts
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
# local env files
# do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables
.env
.env*.local
# vercel
.vercel
# typescript
*.tsbuildinfo
# idea files
.idea

29
README.md Normal file
View File

@ -0,0 +1,29 @@
# Create T3 App
This is a [T3 Stack](https://create.t3.gg/) project bootstrapped with `create-t3-app`.
## What's next? How do I make an app with this?
We try to keep this project as simple as possible, so you can start with just the scaffolding we set up for you, and add additional things later when they become necessary.
If you are not familiar with the different technologies used in this project, please refer to the respective docs. If you still are in the wind, please join our [Discord](https://t3.gg/discord) and ask for help.
- [Next.js](https://nextjs.org)
- [NextAuth.js](https://next-auth.js.org)
- [Prisma](https://prisma.io)
- [Drizzle](https://orm.drizzle.team)
- [Tailwind CSS](https://tailwindcss.com)
- [tRPC](https://trpc.io)
## Learn More
To learn more about the [T3 Stack](https://create.t3.gg/), take a look at the following resources:
- [Documentation](https://create.t3.gg/)
- [Learn the T3 Stack](https://create.t3.gg/en/faq#what-learning-resources-are-currently-available) — Check out these awesome tutorials
You can check out the [create-t3-app GitHub repository](https://github.com/t3-oss/create-t3-app) — your feedback and contributions are welcome!
## How do I deploy this?
Follow our deployment guides for [Vercel](https://create.t3.gg/en/deployment/vercel), [Netlify](https://create.t3.gg/en/deployment/netlify) and [Docker](https://create.t3.gg/en/deployment/docker) for more information.

48
eslint.config.js Normal file
View File

@ -0,0 +1,48 @@
import { FlatCompat } from "@eslint/eslintrc";
import tseslint from "typescript-eslint";
const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
});
export default tseslint.config(
{
ignores: [".next"],
},
...compat.extends("next/core-web-vitals"),
{
files: ["**/*.ts", "**/*.tsx"],
extends: [
...tseslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
],
rules: {
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/consistent-type-imports": [
"warn",
{ prefer: "type-imports", fixStyle: "inline-type-imports" },
],
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_" },
],
"@typescript-eslint/require-await": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{ checksVoidReturn: { attributes: false } },
],
},
},
{
linterOptions: {
reportUnusedDisableDirectives: true,
},
languageOptions: {
parserOptions: {
projectService: true,
},
},
},
);

1
generated/prisma/client.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export * from "./index";

View File

@ -0,0 +1,4 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */
// biome-ignore-all lint: generated file
module.exports = { ...require(".") };

1
generated/prisma/default.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export * from "./index";

View File

@ -0,0 +1,4 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */
// biome-ignore-all lint: generated file
module.exports = { ...require("#main-entry-point") };

1
generated/prisma/edge.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export * from "./default";

277
generated/prisma/edge.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,252 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */
// biome-ignore-all lint: generated file
Object.defineProperty(exports, "__esModule", { value: true });
const {
Decimal,
objectEnumValues,
makeStrictEnum,
Public,
getRuntime,
skip,
} = require("./runtime/index-browser.js");
const Prisma = {};
exports.Prisma = Prisma;
exports.$Enums = {};
/**
* Prisma Client JS version: 6.19.2
* Query Engine version: c2990dca591cba766e3b7ef5d9e8a84796e47ab7
*/
Prisma.prismaVersion = {
client: "6.19.2",
engine: "c2990dca591cba766e3b7ef5d9e8a84796e47ab7",
};
Prisma.PrismaClientKnownRequestError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`);
};
Prisma.PrismaClientUnknownRequestError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`);
};
Prisma.PrismaClientRustPanicError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`);
};
Prisma.PrismaClientInitializationError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`);
};
Prisma.PrismaClientValidationError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`);
};
Prisma.Decimal = Decimal;
/**
* Re-export of sql-template-tag
*/
Prisma.sql = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`);
};
Prisma.empty = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`);
};
Prisma.join = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`);
};
Prisma.raw = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`);
};
Prisma.validator = Public.validator;
/**
* Extensions
*/
Prisma.getExtensionContext = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`);
};
Prisma.defineExtension = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`);
};
/**
* Shorthand utilities for JSON filtering
*/
Prisma.DbNull = objectEnumValues.instances.DbNull;
Prisma.JsonNull = objectEnumValues.instances.JsonNull;
Prisma.AnyNull = objectEnumValues.instances.AnyNull;
Prisma.NullTypes = {
DbNull: objectEnumValues.classes.DbNull,
JsonNull: objectEnumValues.classes.JsonNull,
AnyNull: objectEnumValues.classes.AnyNull,
};
/**
* Enums
*/
exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
ReadUncommitted: "ReadUncommitted",
ReadCommitted: "ReadCommitted",
RepeatableRead: "RepeatableRead",
Serializable: "Serializable",
});
exports.Prisma.PostScalarFieldEnum = {
id: "id",
name: "name",
createdAt: "createdAt",
updatedAt: "updatedAt",
createdById: "createdById",
};
exports.Prisma.AccountScalarFieldEnum = {
id: "id",
userId: "userId",
type: "type",
provider: "provider",
providerAccountId: "providerAccountId",
refresh_token: "refresh_token",
access_token: "access_token",
expires_at: "expires_at",
token_type: "token_type",
scope: "scope",
id_token: "id_token",
session_state: "session_state",
refresh_token_expires_in: "refresh_token_expires_in",
};
exports.Prisma.SessionScalarFieldEnum = {
id: "id",
sessionToken: "sessionToken",
userId: "userId",
expires: "expires",
};
exports.Prisma.UserScalarFieldEnum = {
id: "id",
name: "name",
email: "email",
emailVerified: "emailVerified",
image: "image",
};
exports.Prisma.VerificationTokenScalarFieldEnum = {
identifier: "identifier",
token: "token",
expires: "expires",
};
exports.Prisma.SortOrder = {
asc: "asc",
desc: "desc",
};
exports.Prisma.PostOrderByRelevanceFieldEnum = {
name: "name",
createdById: "createdById",
};
exports.Prisma.NullsOrder = {
first: "first",
last: "last",
};
exports.Prisma.AccountOrderByRelevanceFieldEnum = {
id: "id",
userId: "userId",
type: "type",
provider: "provider",
providerAccountId: "providerAccountId",
refresh_token: "refresh_token",
access_token: "access_token",
token_type: "token_type",
scope: "scope",
id_token: "id_token",
session_state: "session_state",
};
exports.Prisma.SessionOrderByRelevanceFieldEnum = {
id: "id",
sessionToken: "sessionToken",
userId: "userId",
};
exports.Prisma.UserOrderByRelevanceFieldEnum = {
id: "id",
name: "name",
email: "email",
image: "image",
};
exports.Prisma.VerificationTokenOrderByRelevanceFieldEnum = {
identifier: "identifier",
token: "token",
};
exports.Prisma.ModelName = {
Post: "Post",
Account: "Account",
Session: "Session",
User: "User",
VerificationToken: "VerificationToken",
};
/**
* This is a stub Prisma Client that will error at runtime if called.
*/
class PrismaClient {
constructor() {
return new Proxy(this, {
get(target, prop) {
let message;
const runtime = getRuntime();
if (runtime.isEdge) {
message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters
`;
} else {
message =
"PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `" +
runtime.prettyName +
"`).";
}
message += `
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`;
throw new Error(message);
},
});
}
}
exports.PrismaClient = PrismaClient;
Object.assign(exports, Prisma);

9643
generated/prisma/index.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

291
generated/prisma/index.js Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,183 @@
{
"name": "prisma-client-911e318997f98a7538e07274ddf89a2435e18dcb45de16b3e390038aa52a2516",
"main": "index.js",
"types": "index.d.ts",
"browser": "default.js",
"exports": {
"./client": {
"require": {
"node": "./index.js",
"edge-light": "./wasm.js",
"workerd": "./wasm.js",
"worker": "./wasm.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"import": {
"node": "./index.js",
"edge-light": "./wasm.js",
"workerd": "./wasm.js",
"worker": "./wasm.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"default": "./index.js"
},
"./package.json": "./package.json",
".": {
"require": {
"node": "./index.js",
"edge-light": "./wasm.js",
"workerd": "./wasm.js",
"worker": "./wasm.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"import": {
"node": "./index.js",
"edge-light": "./wasm.js",
"workerd": "./wasm.js",
"worker": "./wasm.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"default": "./index.js"
},
"./edge": {
"types": "./edge.d.ts",
"require": "./edge.js",
"import": "./edge.js",
"default": "./edge.js"
},
"./react-native": {
"types": "./react-native.d.ts",
"require": "./react-native.js",
"import": "./react-native.js",
"default": "./react-native.js"
},
"./extension": {
"types": "./extension.d.ts",
"require": "./extension.js",
"import": "./extension.js",
"default": "./extension.js"
},
"./index-browser": {
"types": "./index.d.ts",
"require": "./index-browser.js",
"import": "./index-browser.js",
"default": "./index-browser.js"
},
"./index": {
"types": "./index.d.ts",
"require": "./index.js",
"import": "./index.js",
"default": "./index.js"
},
"./wasm": {
"types": "./wasm.d.ts",
"require": "./wasm.js",
"import": "./wasm.mjs",
"default": "./wasm.mjs"
},
"./runtime/client": {
"types": "./runtime/client.d.ts",
"node": {
"require": "./runtime/client.js",
"default": "./runtime/client.js"
},
"require": "./runtime/client.js",
"import": "./runtime/client.mjs",
"default": "./runtime/client.mjs"
},
"./runtime/library": {
"types": "./runtime/library.d.ts",
"require": "./runtime/library.js",
"import": "./runtime/library.mjs",
"default": "./runtime/library.mjs"
},
"./runtime/binary": {
"types": "./runtime/binary.d.ts",
"require": "./runtime/binary.js",
"import": "./runtime/binary.mjs",
"default": "./runtime/binary.mjs"
},
"./runtime/wasm-engine-edge": {
"types": "./runtime/wasm-engine-edge.d.ts",
"require": "./runtime/wasm-engine-edge.js",
"import": "./runtime/wasm-engine-edge.mjs",
"default": "./runtime/wasm-engine-edge.mjs"
},
"./runtime/wasm-compiler-edge": {
"types": "./runtime/wasm-compiler-edge.d.ts",
"require": "./runtime/wasm-compiler-edge.js",
"import": "./runtime/wasm-compiler-edge.mjs",
"default": "./runtime/wasm-compiler-edge.mjs"
},
"./runtime/edge": {
"types": "./runtime/edge.d.ts",
"require": "./runtime/edge.js",
"import": "./runtime/edge-esm.js",
"default": "./runtime/edge-esm.js"
},
"./runtime/react-native": {
"types": "./runtime/react-native.d.ts",
"require": "./runtime/react-native.js",
"import": "./runtime/react-native.js",
"default": "./runtime/react-native.js"
},
"./runtime/index-browser": {
"types": "./runtime/index-browser.d.ts",
"require": "./runtime/index-browser.js",
"import": "./runtime/index-browser.mjs",
"default": "./runtime/index-browser.mjs"
},
"./generator-build": {
"require": "./generator-build/index.js",
"import": "./generator-build/index.js",
"default": "./generator-build/index.js"
},
"./sql": {
"require": {
"types": "./sql.d.ts",
"node": "./sql.js",
"default": "./sql.js"
},
"import": {
"types": "./sql.d.ts",
"node": "./sql.mjs",
"default": "./sql.mjs"
},
"default": "./sql.js"
},
"./*": "./*"
},
"version": "6.19.2",
"sideEffects": false,
"imports": {
"#wasm-engine-loader": {
"edge-light": "./wasm-edge-light-loader.mjs",
"workerd": "./wasm-worker-loader.mjs",
"worker": "./wasm-worker-loader.mjs",
"default": "./wasm-worker-loader.mjs"
},
"#main-entry-point": {
"require": {
"node": "./index.js",
"edge-light": "./wasm.js",
"workerd": "./wasm.js",
"worker": "./wasm.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"import": {
"node": "./index.js",
"edge-light": "./wasm.js",
"workerd": "./wasm.js",
"worker": "./wasm.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"default": "./index.js"
}
}
}

View File

@ -0,0 +1,812 @@
"use strict";
var F = Object.defineProperty;
var B = Object.getOwnPropertyDescriptor;
var R = Object.getOwnPropertyNames;
var U = Object.prototype.hasOwnProperty;
var L = (e, t) => {
for (var n in t) F(e, n, { get: t[n], enumerable: !0 });
},
N = (e, t, n, _) => {
if ((t && typeof t == "object") || typeof t == "function")
for (let o of R(t))
!U.call(e, o) &&
o !== n &&
F(e, o, {
get: () => t[o],
enumerable: !(_ = B(t, o)) || _.enumerable,
});
return e;
};
var C = (e) => N(F({}, "__esModule", { value: !0 }), e);
var qt = {};
L(qt, {
QueryEngine: () => E,
__wbg_Error_e83987f665cf5504: () => J,
__wbg_Number_bb48ca12f395cd08: () => X,
__wbg_String_8f0eb39a4a4c2f66: () => Y,
__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd: () => K,
__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68: () => Z,
__wbg___wbindgen_debug_string_df47ffb5e35e6763: () => ee,
__wbg___wbindgen_in_bb933bd9e1b3bc0f: () => te,
__wbg___wbindgen_is_bigint_cb320707dcd35f0b: () => ne,
__wbg___wbindgen_is_function_ee8a6c5833c90377: () => re,
__wbg___wbindgen_is_object_c818261d21f283a4: () => _e,
__wbg___wbindgen_is_string_fbb76cb2940daafd: () => oe,
__wbg___wbindgen_is_undefined_2d472862bd29a478: () => ce,
__wbg___wbindgen_jsval_eq_6b13ab83478b1c50: () => ie,
__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147: () => se,
__wbg___wbindgen_number_get_a20bf9b85341449d: () => ue,
__wbg___wbindgen_string_get_e4f06c90489ad01b: () => be,
__wbg___wbindgen_throw_b855445ff6a94295: () => fe,
__wbg__wbg_cb_unref_2454a539ea5790d9: () => ae,
__wbg_call_525440f72fbfc0ea: () => ge,
__wbg_call_e762c39fa8ea36bf: () => le,
__wbg_crypto_805be4ce92f1e370: () => de,
__wbg_done_2042aa2670fb1db1: () => we,
__wbg_entries_e171b586f8f6bdbf: () => pe,
__wbg_getRandomValues_f6a868620c8bab49: () => xe,
__wbg_getTime_14776bfb48a1bff9: () => ye,
__wbg_get_7bed016f185add81: () => me,
__wbg_get_ece95cf6585650d9: () => he,
__wbg_get_efcb449f58ec27c2: () => Te,
__wbg_get_with_ref_key_1dc361bd10053bfe: () => Ae,
__wbg_has_787fafc980c3ccdb: () => Se,
__wbg_instanceof_ArrayBuffer_70beb1189ca63b38: () => Fe,
__wbg_instanceof_Map_8579b5e2ab5437c7: () => Ie,
__wbg_instanceof_Promise_001fdd42afa1b7ef: () => qe,
__wbg_instanceof_Uint8Array_20c8e73002f7af98: () => ke,
__wbg_isArray_96e0af9891d0945d: () => Ee,
__wbg_isSafeInteger_d216eda7911dde36: () => Oe,
__wbg_iterator_e5822695327a3c39: () => Me,
__wbg_keys_b4d27b02ad14f4be: () => ve,
__wbg_length_69bca3cb64fc8748: () => De,
__wbg_length_cdd215e10d9dd507: () => je,
__wbg_msCrypto_2ac4d17c4748234a: () => Be,
__wbg_new_0_f9740686d739025c: () => Re,
__wbg_new_1acc0b6eea89d040: () => Ue,
__wbg_new_3c3d849046688a66: () => Le,
__wbg_new_5a79be3ab53b8aa5: () => Ne,
__wbg_new_68651c719dcda04e: () => Ce,
__wbg_new_e17d9f43105b08be: () => $e,
__wbg_new_from_slice_92f4d78ca282a2d2: () => Ve,
__wbg_new_no_args_ee98eee5275000a4: () => We,
__wbg_new_with_length_01aa0dc35aa13543: () => ze,
__wbg_next_020810e0ae8ebcb0: () => Pe,
__wbg_next_2c826fe5dfec6b6a: () => Ge,
__wbg_node_ecc8306b9857f33d: () => Qe,
__wbg_now_793306c526e2e3b6: () => He,
__wbg_now_7fd00a794a07d388: () => Je,
__wbg_now_b3f7572f6ef3d3a9: () => Xe,
__wbg_process_5cff2739921be718: () => Ye,
__wbg_prototypesetcall_2a6620b6922694b2: () => Ke,
__wbg_push_df81a39d04db858c: () => Ze,
__wbg_queueMicrotask_5a8a9131f3f0b37b: () => et,
__wbg_queueMicrotask_6d79674585219521: () => tt,
__wbg_randomFillSync_d3c85af7e31cf1f8: () => nt,
__wbg_require_0c566c6f2eef6c79: () => rt,
__wbg_resolve_caf97c30b83f7053: () => _t,
__wbg_setTimeout_5d6a1d4fc51ea450: () => ot,
__wbg_set_3f1d0b984ed272ed: () => ct,
__wbg_set_907fb406c34a251d: () => it,
__wbg_set_c213c871859d6500: () => st,
__wbg_set_c2abbebe8b9ebee1: () => ut,
__wbg_set_wasm: () => $,
__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e: () => bt,
__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac: () => ft,
__wbg_static_accessor_SELF_6fdf4b64710cc91b: () => at,
__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2: () => gt,
__wbg_subarray_480600f3d6a9f26c: () => lt,
__wbg_then_4f46f6544e6b4a28: () => dt,
__wbg_then_70d05cf780a18d77: () => wt,
__wbg_valueOf_9eee4828c11458ca: () => pt,
__wbg_value_692627309814bb8c: () => xt,
__wbg_versions_a8e5a362e1f16442: () => yt,
__wbindgen_cast_022f8b2bf9dce4aa: () => mt,
__wbindgen_cast_2241b6af4c4b2941: () => ht,
__wbindgen_cast_4625c577ab2ec9ee: () => Tt,
__wbindgen_cast_9ae0607507abb057: () => At,
__wbindgen_cast_cb9088102bce6b30: () => St,
__wbindgen_cast_d6cd19b81560fd6e: () => Ft,
__wbindgen_init_externref_table: () => It,
debug_panic: () => P,
getBuildTimeInfo: () => G,
});
module.exports = C(qt);
var h = () => {};
h.prototype = h;
let r;
function $(e) {
r = e;
}
let T = null;
function p() {
return (
(T === null || T.byteLength === 0) && (T = new Uint8Array(r.memory.buffer)),
T
);
}
let A = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 });
A.decode();
const V = 2146435072;
let I = 0;
function W(e, t) {
return (
(I += t),
I >= V &&
((A = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 })),
A.decode(),
(I = t)),
A.decode(p().subarray(e, e + t))
);
}
function S(e, t) {
return ((e = e >>> 0), W(e, t));
}
let u = 0;
const x = new TextEncoder();
"encodeInto" in x ||
(x.encodeInto = function (e, t) {
const n = x.encode(e);
return (t.set(n), { read: e.length, written: n.length });
});
function b(e, t, n) {
if (n === void 0) {
const s = x.encode(e),
f = t(s.length, 1) >>> 0;
return (
p()
.subarray(f, f + s.length)
.set(s),
(u = s.length),
f
);
}
let _ = e.length,
o = t(_, 1) >>> 0;
const i = p();
let c = 0;
for (; c < _; c++) {
const s = e.charCodeAt(c);
if (s > 127) break;
i[o + c] = s;
}
if (c !== _) {
(c !== 0 && (e = e.slice(c)),
(o = n(o, _, (_ = c + e.length * 3), 1) >>> 0));
const s = p().subarray(o + c, o + _),
f = x.encodeInto(e, s);
((c += f.written), (o = n(o, _, c, 1) >>> 0));
}
return ((u = c), o);
}
let w = null;
function l() {
return (
(w === null ||
w.buffer.detached === !0 ||
(w.buffer.detached === void 0 && w.buffer !== r.memory.buffer)) &&
(w = new DataView(r.memory.buffer)),
w
);
}
function a(e) {
return e == null;
}
function q(e) {
const t = typeof e;
if (t == "number" || t == "boolean" || e == null) return `${e}`;
if (t == "string") return `"${e}"`;
if (t == "symbol") {
const o = e.description;
return o == null ? "Symbol" : `Symbol(${o})`;
}
if (t == "function") {
const o = e.name;
return typeof o == "string" && o.length > 0 ? `Function(${o})` : "Function";
}
if (Array.isArray(e)) {
const o = e.length;
let i = "[";
o > 0 && (i += q(e[0]));
for (let c = 1; c < o; c++) i += ", " + q(e[c]);
return ((i += "]"), i);
}
const n = /\[object ([^\]]+)\]/.exec(toString.call(e));
let _;
if (n && n.length > 1) _ = n[1];
else return toString.call(e);
if (_ == "Object")
try {
return "Object(" + JSON.stringify(e) + ")";
} catch {
return "Object";
}
return e instanceof Error
? `${e.name}: ${e.message}
${e.stack}`
: _;
}
function y(e) {
const t = r.__externref_table_alloc();
return (r.__wbindgen_externrefs.set(t, e), t);
}
function g(e, t) {
try {
return e.apply(this, t);
} catch (n) {
const _ = y(n);
r.__wbindgen_exn_store(_);
}
}
function k(e, t) {
return ((e = e >>> 0), p().subarray(e / 1, e / 1 + t));
}
const O =
typeof FinalizationRegistry > "u"
? { register: () => {}, unregister: () => {} }
: new FinalizationRegistry((e) => e.dtor(e.a, e.b));
function z(e, t, n, _) {
const o = { a: e, b: t, cnt: 1, dtor: n },
i = (...c) => {
o.cnt++;
const s = o.a;
o.a = 0;
try {
return _(s, o.b, ...c);
} finally {
((o.a = s), i._wbg_cb_unref());
}
};
return (
(i._wbg_cb_unref = () => {
--o.cnt === 0 && (o.dtor(o.a, o.b), (o.a = 0), O.unregister(o));
}),
O.register(i, o, o),
i
);
}
function M(e) {
const t = r.__wbindgen_externrefs.get(e);
return (r.__externref_table_dealloc(e), t);
}
function P(e) {
var t = a(e) ? 0 : b(e, r.__wbindgen_malloc, r.__wbindgen_realloc),
n = u;
const _ = r.debug_panic(t, n);
if (_[1]) throw M(_[0]);
}
function G() {
return r.getBuildTimeInfo();
}
function Q(e, t, n) {
r.wasm_bindgen__convert__closures_____invoke__ha235f3ea55a06a09(e, t, n);
}
function H(e, t, n, _) {
r.wasm_bindgen__convert__closures_____invoke__h1a2f20be69ab8911(e, t, n, _);
}
const v =
typeof FinalizationRegistry > "u"
? { register: () => {}, unregister: () => {} }
: new FinalizationRegistry((e) => r.__wbg_queryengine_free(e >>> 0, 1));
class E {
__destroy_into_raw() {
const t = this.__wbg_ptr;
return ((this.__wbg_ptr = 0), v.unregister(this), t);
}
free() {
const t = this.__destroy_into_raw();
r.__wbg_queryengine_free(t, 0);
}
disconnect(t, n) {
const _ = b(t, r.__wbindgen_malloc, r.__wbindgen_realloc),
o = u,
i = b(n, r.__wbindgen_malloc, r.__wbindgen_realloc),
c = u;
return r.queryengine_disconnect(this.__wbg_ptr, _, o, i, c);
}
startTransaction(t, n, _) {
const o = b(t, r.__wbindgen_malloc, r.__wbindgen_realloc),
i = u,
c = b(n, r.__wbindgen_malloc, r.__wbindgen_realloc),
s = u,
f = b(_, r.__wbindgen_malloc, r.__wbindgen_realloc),
d = u;
return r.queryengine_startTransaction(this.__wbg_ptr, o, i, c, s, f, d);
}
commitTransaction(t, n, _) {
const o = b(t, r.__wbindgen_malloc, r.__wbindgen_realloc),
i = u,
c = b(n, r.__wbindgen_malloc, r.__wbindgen_realloc),
s = u,
f = b(_, r.__wbindgen_malloc, r.__wbindgen_realloc),
d = u;
return r.queryengine_commitTransaction(this.__wbg_ptr, o, i, c, s, f, d);
}
rollbackTransaction(t, n, _) {
const o = b(t, r.__wbindgen_malloc, r.__wbindgen_realloc),
i = u,
c = b(n, r.__wbindgen_malloc, r.__wbindgen_realloc),
s = u,
f = b(_, r.__wbindgen_malloc, r.__wbindgen_realloc),
d = u;
return r.queryengine_rollbackTransaction(this.__wbg_ptr, o, i, c, s, f, d);
}
constructor(t, n, _) {
const o = r.queryengine_new(t, n, _);
if (o[2]) throw M(o[1]);
return (
(this.__wbg_ptr = o[0] >>> 0),
v.register(this, this.__wbg_ptr, this),
this
);
}
query(t, n, _, o) {
const i = b(t, r.__wbindgen_malloc, r.__wbindgen_realloc),
c = u,
s = b(n, r.__wbindgen_malloc, r.__wbindgen_realloc),
f = u;
var d = a(_) ? 0 : b(_, r.__wbindgen_malloc, r.__wbindgen_realloc),
m = u;
const D = b(o, r.__wbindgen_malloc, r.__wbindgen_realloc),
j = u;
return r.queryengine_query(this.__wbg_ptr, i, c, s, f, d, m, D, j);
}
trace(t) {
const n = b(t, r.__wbindgen_malloc, r.__wbindgen_realloc),
_ = u;
return r.queryengine_trace(this.__wbg_ptr, n, _);
}
connect(t, n) {
const _ = b(t, r.__wbindgen_malloc, r.__wbindgen_realloc),
o = u,
i = b(n, r.__wbindgen_malloc, r.__wbindgen_realloc),
c = u;
return r.queryengine_connect(this.__wbg_ptr, _, o, i, c);
}
metrics(t) {
const n = b(t, r.__wbindgen_malloc, r.__wbindgen_realloc),
_ = u;
return r.queryengine_metrics(this.__wbg_ptr, n, _);
}
}
Symbol.dispose && (E.prototype[Symbol.dispose] = E.prototype.free);
function J(e, t) {
return Error(S(e, t));
}
function X(e) {
return Number(e);
}
function Y(e, t) {
const n = String(t),
_ = b(n, r.__wbindgen_malloc, r.__wbindgen_realloc),
o = u;
(l().setInt32(e + 4 * 1, o, !0), l().setInt32(e + 4 * 0, _, !0));
}
function K(e, t) {
const n = t,
_ = typeof n == "bigint" ? n : void 0;
(l().setBigInt64(e + 8 * 1, a(_) ? BigInt(0) : _, !0),
l().setInt32(e + 4 * 0, !a(_), !0));
}
function Z(e) {
const t = e,
n = typeof t == "boolean" ? t : void 0;
return a(n) ? 16777215 : n ? 1 : 0;
}
function ee(e, t) {
const n = q(t),
_ = b(n, r.__wbindgen_malloc, r.__wbindgen_realloc),
o = u;
(l().setInt32(e + 4 * 1, o, !0), l().setInt32(e + 4 * 0, _, !0));
}
function te(e, t) {
return e in t;
}
function ne(e) {
return typeof e == "bigint";
}
function re(e) {
return typeof e == "function";
}
function _e(e) {
const t = e;
return typeof t == "object" && t !== null;
}
function oe(e) {
return typeof e == "string";
}
function ce(e) {
return e === void 0;
}
function ie(e, t) {
return e === t;
}
function se(e, t) {
return e == t;
}
function ue(e, t) {
const n = t,
_ = typeof n == "number" ? n : void 0;
(l().setFloat64(e + 8 * 1, a(_) ? 0 : _, !0),
l().setInt32(e + 4 * 0, !a(_), !0));
}
function be(e, t) {
const n = t,
_ = typeof n == "string" ? n : void 0;
var o = a(_) ? 0 : b(_, r.__wbindgen_malloc, r.__wbindgen_realloc),
i = u;
(l().setInt32(e + 4 * 1, i, !0), l().setInt32(e + 4 * 0, o, !0));
}
function fe(e, t) {
throw new Error(S(e, t));
}
function ae(e) {
e._wbg_cb_unref();
}
function ge() {
return g(function (e, t, n) {
return e.call(t, n);
}, arguments);
}
function le() {
return g(function (e, t) {
return e.call(t);
}, arguments);
}
function de(e) {
return e.crypto;
}
function we(e) {
return e.done;
}
function pe(e) {
return Object.entries(e);
}
function xe() {
return g(function (e, t) {
e.getRandomValues(t);
}, arguments);
}
function ye(e) {
return e.getTime();
}
function me(e, t) {
return e[t >>> 0];
}
function he() {
return g(function (e, t) {
return e[t];
}, arguments);
}
function Te() {
return g(function (e, t) {
return Reflect.get(e, t);
}, arguments);
}
function Ae(e, t) {
return e[t];
}
function Se() {
return g(function (e, t) {
return Reflect.has(e, t);
}, arguments);
}
function Fe(e) {
let t;
try {
t = e instanceof ArrayBuffer;
} catch {
t = !1;
}
return t;
}
function Ie(e) {
let t;
try {
t = e instanceof Map;
} catch {
t = !1;
}
return t;
}
function qe(e) {
let t;
try {
t = e instanceof Promise;
} catch {
t = !1;
}
return t;
}
function ke(e) {
let t;
try {
t = e instanceof Uint8Array;
} catch {
t = !1;
}
return t;
}
function Ee(e) {
return Array.isArray(e);
}
function Oe(e) {
return Number.isSafeInteger(e);
}
function Me() {
return Symbol.iterator;
}
function ve(e) {
return Object.keys(e);
}
function De(e) {
return e.length;
}
function je(e) {
return e.length;
}
function Be(e) {
return e.msCrypto;
}
function Re() {
return new Date();
}
function Ue() {
return new Object();
}
function Le(e, t) {
try {
var n = { a: e, b: t },
_ = (i, c) => {
const s = n.a;
n.a = 0;
try {
return H(s, n.b, i, c);
} finally {
n.a = s;
}
};
return new Promise(_);
} finally {
n.a = n.b = 0;
}
}
function Ne(e) {
return new Uint8Array(e);
}
function Ce() {
return new Map();
}
function $e() {
return new Array();
}
function Ve(e, t) {
return new Uint8Array(k(e, t));
}
function We(e, t) {
return new h(S(e, t));
}
function ze(e) {
return new Uint8Array(e >>> 0);
}
function Pe() {
return g(function (e) {
return e.next();
}, arguments);
}
function Ge(e) {
return e.next;
}
function Qe(e) {
return e.node;
}
function He() {
return Date.now();
}
function Je(e) {
return e.now();
}
function Xe() {
return g(function () {
return Date.now();
}, arguments);
}
function Ye(e) {
return e.process;
}
function Ke(e, t, n) {
Uint8Array.prototype.set.call(k(e, t), n);
}
function Ze(e, t) {
return e.push(t);
}
function et(e) {
return e.queueMicrotask;
}
function tt(e) {
queueMicrotask(e);
}
function nt() {
return g(function (e, t) {
e.randomFillSync(t);
}, arguments);
}
function rt() {
return g(function () {
return module.require;
}, arguments);
}
function _t(e) {
return Promise.resolve(e);
}
function ot(e, t) {
return setTimeout(e, t >>> 0);
}
function ct(e, t, n) {
e[t] = n;
}
function it(e, t, n) {
return e.set(t, n);
}
function st(e, t, n) {
e[t >>> 0] = n;
}
function ut() {
return g(function (e, t, n) {
return Reflect.set(e, t, n);
}, arguments);
}
function bt() {
const e = typeof global > "u" ? null : global;
return a(e) ? 0 : y(e);
}
function ft() {
const e = typeof globalThis > "u" ? null : globalThis;
return a(e) ? 0 : y(e);
}
function at() {
const e = typeof self > "u" ? null : self;
return a(e) ? 0 : y(e);
}
function gt() {
const e = typeof window > "u" ? null : window;
return a(e) ? 0 : y(e);
}
function lt(e, t, n) {
return e.subarray(t >>> 0, n >>> 0);
}
function dt(e, t) {
return e.then(t);
}
function wt(e, t, n) {
return e.then(t, n);
}
function pt(e) {
return e.valueOf();
}
function xt(e) {
return e.value;
}
function yt(e) {
return e.versions;
}
function mt(e, t) {
return z(e, t, r.wasm_bindgen__closure__destroy__hf9ae564cf31e91c2, Q);
}
function ht(e, t) {
return S(e, t);
}
function Tt(e) {
return BigInt.asUintN(64, e);
}
function At(e) {
return e;
}
function St(e, t) {
return k(e, t);
}
function Ft(e) {
return e;
}
function It() {
const e = r.__wbindgen_externrefs,
t = e.grow(4);
(e.set(0, void 0),
e.set(t + 0, void 0),
e.set(t + 1, null),
e.set(t + 2, !0),
e.set(t + 3, !1));
}
0 &&
(module.exports = {
QueryEngine,
__wbg_Error_e83987f665cf5504,
__wbg_Number_bb48ca12f395cd08,
__wbg_String_8f0eb39a4a4c2f66,
__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd,
__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68,
__wbg___wbindgen_debug_string_df47ffb5e35e6763,
__wbg___wbindgen_in_bb933bd9e1b3bc0f,
__wbg___wbindgen_is_bigint_cb320707dcd35f0b,
__wbg___wbindgen_is_function_ee8a6c5833c90377,
__wbg___wbindgen_is_object_c818261d21f283a4,
__wbg___wbindgen_is_string_fbb76cb2940daafd,
__wbg___wbindgen_is_undefined_2d472862bd29a478,
__wbg___wbindgen_jsval_eq_6b13ab83478b1c50,
__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147,
__wbg___wbindgen_number_get_a20bf9b85341449d,
__wbg___wbindgen_string_get_e4f06c90489ad01b,
__wbg___wbindgen_throw_b855445ff6a94295,
__wbg__wbg_cb_unref_2454a539ea5790d9,
__wbg_call_525440f72fbfc0ea,
__wbg_call_e762c39fa8ea36bf,
__wbg_crypto_805be4ce92f1e370,
__wbg_done_2042aa2670fb1db1,
__wbg_entries_e171b586f8f6bdbf,
__wbg_getRandomValues_f6a868620c8bab49,
__wbg_getTime_14776bfb48a1bff9,
__wbg_get_7bed016f185add81,
__wbg_get_ece95cf6585650d9,
__wbg_get_efcb449f58ec27c2,
__wbg_get_with_ref_key_1dc361bd10053bfe,
__wbg_has_787fafc980c3ccdb,
__wbg_instanceof_ArrayBuffer_70beb1189ca63b38,
__wbg_instanceof_Map_8579b5e2ab5437c7,
__wbg_instanceof_Promise_001fdd42afa1b7ef,
__wbg_instanceof_Uint8Array_20c8e73002f7af98,
__wbg_isArray_96e0af9891d0945d,
__wbg_isSafeInteger_d216eda7911dde36,
__wbg_iterator_e5822695327a3c39,
__wbg_keys_b4d27b02ad14f4be,
__wbg_length_69bca3cb64fc8748,
__wbg_length_cdd215e10d9dd507,
__wbg_msCrypto_2ac4d17c4748234a,
__wbg_new_0_f9740686d739025c,
__wbg_new_1acc0b6eea89d040,
__wbg_new_3c3d849046688a66,
__wbg_new_5a79be3ab53b8aa5,
__wbg_new_68651c719dcda04e,
__wbg_new_e17d9f43105b08be,
__wbg_new_from_slice_92f4d78ca282a2d2,
__wbg_new_no_args_ee98eee5275000a4,
__wbg_new_with_length_01aa0dc35aa13543,
__wbg_next_020810e0ae8ebcb0,
__wbg_next_2c826fe5dfec6b6a,
__wbg_node_ecc8306b9857f33d,
__wbg_now_793306c526e2e3b6,
__wbg_now_7fd00a794a07d388,
__wbg_now_b3f7572f6ef3d3a9,
__wbg_process_5cff2739921be718,
__wbg_prototypesetcall_2a6620b6922694b2,
__wbg_push_df81a39d04db858c,
__wbg_queueMicrotask_5a8a9131f3f0b37b,
__wbg_queueMicrotask_6d79674585219521,
__wbg_randomFillSync_d3c85af7e31cf1f8,
__wbg_require_0c566c6f2eef6c79,
__wbg_resolve_caf97c30b83f7053,
__wbg_setTimeout_5d6a1d4fc51ea450,
__wbg_set_3f1d0b984ed272ed,
__wbg_set_907fb406c34a251d,
__wbg_set_c213c871859d6500,
__wbg_set_c2abbebe8b9ebee1,
__wbg_set_wasm,
__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e,
__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac,
__wbg_static_accessor_SELF_6fdf4b64710cc91b,
__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2,
__wbg_subarray_480600f3d6a9f26c,
__wbg_then_4f46f6544e6b4a28,
__wbg_then_70d05cf780a18d77,
__wbg_valueOf_9eee4828c11458ca,
__wbg_value_692627309814bb8c,
__wbg_versions_a8e5a362e1f16442,
__wbindgen_cast_022f8b2bf9dce4aa,
__wbindgen_cast_2241b6af4c4b2941,
__wbindgen_cast_4625c577ab2ec9ee,
__wbindgen_cast_9ae0607507abb057,
__wbindgen_cast_cb9088102bce6b30,
__wbindgen_cast_d6cd19b81560fd6e,
__wbindgen_init_externref_table,
debug_panic,
getBuildTimeInfo,
});

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,430 @@
declare class AnyNull extends NullTypesEnumValue {
#private;
}
declare type Args<T, F extends Operation> = T extends {
[K: symbol]: {
types: {
operations: {
[K in F]: {
args: any;
};
};
};
};
}
? T[symbol]["types"]["operations"][F]["args"]
: any;
declare class DbNull extends NullTypesEnumValue {
#private;
}
export declare function Decimal(n: Decimal.Value): Decimal;
export declare namespace Decimal {
export type Constructor = typeof Decimal;
export type Instance = Decimal;
export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
export type Modulo = Rounding | 9;
export type Value = string | number | Decimal;
// http://mikemcl.github.io/decimal.js/#constructor-properties
export interface Config {
precision?: number;
rounding?: Rounding;
toExpNeg?: number;
toExpPos?: number;
minE?: number;
maxE?: number;
crypto?: boolean;
modulo?: Modulo;
defaults?: boolean;
}
}
export declare class Decimal {
readonly d: number[];
readonly e: number;
readonly s: number;
constructor(n: Decimal.Value);
absoluteValue(): Decimal;
abs(): Decimal;
ceil(): Decimal;
clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal;
clamp(min: Decimal.Value, max: Decimal.Value): Decimal;
comparedTo(n: Decimal.Value): number;
cmp(n: Decimal.Value): number;
cosine(): Decimal;
cos(): Decimal;
cubeRoot(): Decimal;
cbrt(): Decimal;
decimalPlaces(): number;
dp(): number;
dividedBy(n: Decimal.Value): Decimal;
div(n: Decimal.Value): Decimal;
dividedToIntegerBy(n: Decimal.Value): Decimal;
divToInt(n: Decimal.Value): Decimal;
equals(n: Decimal.Value): boolean;
eq(n: Decimal.Value): boolean;
floor(): Decimal;
greaterThan(n: Decimal.Value): boolean;
gt(n: Decimal.Value): boolean;
greaterThanOrEqualTo(n: Decimal.Value): boolean;
gte(n: Decimal.Value): boolean;
hyperbolicCosine(): Decimal;
cosh(): Decimal;
hyperbolicSine(): Decimal;
sinh(): Decimal;
hyperbolicTangent(): Decimal;
tanh(): Decimal;
inverseCosine(): Decimal;
acos(): Decimal;
inverseHyperbolicCosine(): Decimal;
acosh(): Decimal;
inverseHyperbolicSine(): Decimal;
asinh(): Decimal;
inverseHyperbolicTangent(): Decimal;
atanh(): Decimal;
inverseSine(): Decimal;
asin(): Decimal;
inverseTangent(): Decimal;
atan(): Decimal;
isFinite(): boolean;
isInteger(): boolean;
isInt(): boolean;
isNaN(): boolean;
isNegative(): boolean;
isNeg(): boolean;
isPositive(): boolean;
isPos(): boolean;
isZero(): boolean;
lessThan(n: Decimal.Value): boolean;
lt(n: Decimal.Value): boolean;
lessThanOrEqualTo(n: Decimal.Value): boolean;
lte(n: Decimal.Value): boolean;
logarithm(n?: Decimal.Value): Decimal;
log(n?: Decimal.Value): Decimal;
minus(n: Decimal.Value): Decimal;
sub(n: Decimal.Value): Decimal;
modulo(n: Decimal.Value): Decimal;
mod(n: Decimal.Value): Decimal;
naturalExponential(): Decimal;
exp(): Decimal;
naturalLogarithm(): Decimal;
ln(): Decimal;
negated(): Decimal;
neg(): Decimal;
plus(n: Decimal.Value): Decimal;
add(n: Decimal.Value): Decimal;
precision(includeZeros?: boolean): number;
sd(includeZeros?: boolean): number;
round(): Decimal;
sine(): Decimal;
sin(): Decimal;
squareRoot(): Decimal;
sqrt(): Decimal;
tangent(): Decimal;
tan(): Decimal;
times(n: Decimal.Value): Decimal;
mul(n: Decimal.Value): Decimal;
toBinary(significantDigits?: number): string;
toBinary(significantDigits: number, rounding: Decimal.Rounding): string;
toDecimalPlaces(decimalPlaces?: number): Decimal;
toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal;
toDP(decimalPlaces?: number): Decimal;
toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal;
toExponential(decimalPlaces?: number): string;
toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string;
toFixed(decimalPlaces?: number): string;
toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string;
toFraction(max_denominator?: Decimal.Value): Decimal[];
toHexadecimal(significantDigits?: number): string;
toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string;
toHex(significantDigits?: number): string;
toHex(significantDigits: number, rounding?: Decimal.Rounding): string;
toJSON(): string;
toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal;
toNumber(): number;
toOctal(significantDigits?: number): string;
toOctal(significantDigits: number, rounding: Decimal.Rounding): string;
toPower(n: Decimal.Value): Decimal;
pow(n: Decimal.Value): Decimal;
toPrecision(significantDigits?: number): string;
toPrecision(significantDigits: number, rounding: Decimal.Rounding): string;
toSignificantDigits(significantDigits?: number): Decimal;
toSignificantDigits(
significantDigits: number,
rounding: Decimal.Rounding,
): Decimal;
toSD(significantDigits?: number): Decimal;
toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal;
toString(): string;
truncated(): Decimal;
trunc(): Decimal;
valueOf(): string;
static abs(n: Decimal.Value): Decimal;
static acos(n: Decimal.Value): Decimal;
static acosh(n: Decimal.Value): Decimal;
static add(x: Decimal.Value, y: Decimal.Value): Decimal;
static asin(n: Decimal.Value): Decimal;
static asinh(n: Decimal.Value): Decimal;
static atan(n: Decimal.Value): Decimal;
static atanh(n: Decimal.Value): Decimal;
static atan2(y: Decimal.Value, x: Decimal.Value): Decimal;
static cbrt(n: Decimal.Value): Decimal;
static ceil(n: Decimal.Value): Decimal;
static clamp(
n: Decimal.Value,
min: Decimal.Value,
max: Decimal.Value,
): Decimal;
static clone(object?: Decimal.Config): Decimal.Constructor;
static config(object: Decimal.Config): Decimal.Constructor;
static cos(n: Decimal.Value): Decimal;
static cosh(n: Decimal.Value): Decimal;
static div(x: Decimal.Value, y: Decimal.Value): Decimal;
static exp(n: Decimal.Value): Decimal;
static floor(n: Decimal.Value): Decimal;
static hypot(...n: Decimal.Value[]): Decimal;
static isDecimal(object: any): object is Decimal;
static ln(n: Decimal.Value): Decimal;
static log(n: Decimal.Value, base?: Decimal.Value): Decimal;
static log2(n: Decimal.Value): Decimal;
static log10(n: Decimal.Value): Decimal;
static max(...n: Decimal.Value[]): Decimal;
static min(...n: Decimal.Value[]): Decimal;
static mod(x: Decimal.Value, y: Decimal.Value): Decimal;
static mul(x: Decimal.Value, y: Decimal.Value): Decimal;
static noConflict(): Decimal.Constructor; // Browser only
static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal;
static random(significantDigits?: number): Decimal;
static round(n: Decimal.Value): Decimal;
static set(object: Decimal.Config): Decimal.Constructor;
static sign(n: Decimal.Value): number;
static sin(n: Decimal.Value): Decimal;
static sinh(n: Decimal.Value): Decimal;
static sqrt(n: Decimal.Value): Decimal;
static sub(x: Decimal.Value, y: Decimal.Value): Decimal;
static sum(...n: Decimal.Value[]): Decimal;
static tan(n: Decimal.Value): Decimal;
static tanh(n: Decimal.Value): Decimal;
static trunc(n: Decimal.Value): Decimal;
static readonly default?: Decimal.Constructor;
static readonly Decimal?: Decimal.Constructor;
static readonly precision: number;
static readonly rounding: Decimal.Rounding;
static readonly toExpNeg: number;
static readonly toExpPos: number;
static readonly minE: number;
static readonly maxE: number;
static readonly crypto: boolean;
static readonly modulo: Decimal.Modulo;
static readonly ROUND_UP: 0;
static readonly ROUND_DOWN: 1;
static readonly ROUND_CEIL: 2;
static readonly ROUND_FLOOR: 3;
static readonly ROUND_HALF_UP: 4;
static readonly ROUND_HALF_DOWN: 5;
static readonly ROUND_HALF_EVEN: 6;
static readonly ROUND_HALF_CEIL: 7;
static readonly ROUND_HALF_FLOOR: 8;
static readonly EUCLID: 9;
}
declare type Exact<A, W> =
| (A extends unknown
? W extends A
? {
[K in keyof A]: Exact<A[K], W[K]>;
}
: W
: never)
| (A extends Narrowable ? A : never);
export declare function getRuntime(): GetRuntimeOutput;
declare type GetRuntimeOutput = {
id: RuntimeName;
prettyName: string;
isEdge: boolean;
};
declare class JsonNull extends NullTypesEnumValue {
#private;
}
/**
* Generates more strict variant of an enum which, unlike regular enum,
* throws on non-existing property access. This can be useful in following situations:
* - we have an API, that accepts both `undefined` and `SomeEnumType` as an input
* - enum values are generated dynamically from DMMF.
*
* In that case, if using normal enums and no compile-time typechecking, using non-existing property
* will result in `undefined` value being used, which will be accepted. Using strict enum
* in this case will help to have a runtime exception, telling you that you are probably doing something wrong.
*
* Note: if you need to check for existence of a value in the enum you can still use either
* `in` operator or `hasOwnProperty` function.
*
* @param definition
* @returns
*/
export declare function makeStrictEnum<
T extends Record<PropertyKey, string | number>,
>(definition: T): T;
declare type Narrowable = string | number | bigint | boolean | [];
declare class NullTypesEnumValue extends ObjectEnumValue {
_getNamespace(): string;
}
/**
* Base class for unique values of object-valued enums.
*/
declare abstract class ObjectEnumValue {
constructor(arg?: symbol);
abstract _getNamespace(): string;
_getName(): string;
toString(): string;
}
export declare const objectEnumValues: {
classes: {
DbNull: typeof DbNull;
JsonNull: typeof JsonNull;
AnyNull: typeof AnyNull;
};
instances: {
DbNull: DbNull;
JsonNull: JsonNull;
AnyNull: AnyNull;
};
};
declare type Operation =
| "findFirst"
| "findFirstOrThrow"
| "findUnique"
| "findUniqueOrThrow"
| "findMany"
| "create"
| "createMany"
| "createManyAndReturn"
| "update"
| "updateMany"
| "updateManyAndReturn"
| "upsert"
| "delete"
| "deleteMany"
| "aggregate"
| "count"
| "groupBy"
| "$queryRaw"
| "$executeRaw"
| "$queryRawUnsafe"
| "$executeRawUnsafe"
| "findRaw"
| "aggregateRaw"
| "$runCommandRaw";
declare namespace Public {
export { validator };
}
export { Public };
declare type RuntimeName =
| "workerd"
| "deno"
| "netlify"
| "node"
| "bun"
| "edge-light"
| "";
declare function validator<V>(): <S>(select: Exact<S, V>) => S;
declare function validator<
C,
M extends Exclude<keyof C, `$${string}`>,
O extends keyof C[M] & Operation,
>(client: C, model: M, operation: O): <S>(select: Exact<S, Args<C[M], O>>) => S;
declare function validator<
C,
M extends Exclude<keyof C, `$${string}`>,
O extends keyof C[M] & Operation,
P extends keyof Args<C[M], O>,
>(
client: C,
model: M,
operation: O,
prop: P,
): <S>(select: Exact<S, Args<C[M], O>[P]>) => S;
export {};

File diff suppressed because it is too large Load Diff

5052
generated/prisma/runtime/library.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

10679
generated/prisma/runtime/react-native.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,75 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
output = "../generated/prisma"
}
datasource db {
provider = "mysql"
// NOTE: When using mysql or sqlserver, uncomment the @db.Text annotations in model Account below
// Further reading:
// https://next-auth.js.org/adapters/prisma#create-the-prisma-schema
// https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#string
url = env("DATABASE_URL")
}
model Post {
id Int @id @default(autoincrement())
name String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
createdBy User @relation(fields: [createdById], references: [id])
createdById String
@@index([name])
}
// Necessary for Next auth
model Account {
id String @id @default(cuid())
userId String
type String
provider String
providerAccountId String
refresh_token String? @db.Text
access_token String? // @db.Text
expires_at Int?
token_type String?
scope String?
id_token String? // @db.Text
session_state String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
refresh_token_expires_in Int?
@@unique([provider, providerAccountId])
}
model Session {
id String @id @default(cuid())
sessionToken String @unique
userId String
expires DateTime
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
}
model User {
id String @id @default(cuid())
name String?
email String? @unique
emailVerified DateTime?
image String?
accounts Account[]
sessions Session[]
posts Post[]
}
model VerificationToken {
identifier String
token String @unique
expires DateTime
@@unique([identifier, token])
}

View File

@ -0,0 +1,5 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */
// biome-ignore-all lint: generated file
export default import('./query_engine_bg.wasm?module')

View File

@ -0,0 +1,5 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */
// biome-ignore-all lint: generated file
export default import('./query_engine_bg.wasm')

1
generated/prisma/wasm.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export * from "./default";

284
generated/prisma/wasm.js Normal file
View File

@ -0,0 +1,284 @@
/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */
// biome-ignore-all lint: generated file
Object.defineProperty(exports, "__esModule", { value: true });
const {
PrismaClientKnownRequestError,
PrismaClientUnknownRequestError,
PrismaClientRustPanicError,
PrismaClientInitializationError,
PrismaClientValidationError,
getPrismaClient,
sqltag,
empty,
join,
raw,
skip,
Decimal,
Debug,
objectEnumValues,
makeStrictEnum,
Extensions,
warnOnce,
defineDmmfProperty,
Public,
getRuntime,
createParam,
} = require("./runtime/wasm-engine-edge.js");
const Prisma = {};
exports.Prisma = Prisma;
exports.$Enums = {};
/**
* Prisma Client JS version: 6.19.2
* Query Engine version: c2990dca591cba766e3b7ef5d9e8a84796e47ab7
*/
Prisma.prismaVersion = {
client: "6.19.2",
engine: "c2990dca591cba766e3b7ef5d9e8a84796e47ab7",
};
Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError;
Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError;
Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError;
Prisma.PrismaClientInitializationError = PrismaClientInitializationError;
Prisma.PrismaClientValidationError = PrismaClientValidationError;
Prisma.Decimal = Decimal;
/**
* Re-export of sql-template-tag
*/
Prisma.sql = sqltag;
Prisma.empty = empty;
Prisma.join = join;
Prisma.raw = raw;
Prisma.validator = Public.validator;
/**
* Extensions
*/
Prisma.getExtensionContext = Extensions.getExtensionContext;
Prisma.defineExtension = Extensions.defineExtension;
/**
* Shorthand utilities for JSON filtering
*/
Prisma.DbNull = objectEnumValues.instances.DbNull;
Prisma.JsonNull = objectEnumValues.instances.JsonNull;
Prisma.AnyNull = objectEnumValues.instances.AnyNull;
Prisma.NullTypes = {
DbNull: objectEnumValues.classes.DbNull,
JsonNull: objectEnumValues.classes.JsonNull,
AnyNull: objectEnumValues.classes.AnyNull,
};
/**
* Enums
*/
exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
ReadUncommitted: "ReadUncommitted",
ReadCommitted: "ReadCommitted",
RepeatableRead: "RepeatableRead",
Serializable: "Serializable",
});
exports.Prisma.PostScalarFieldEnum = {
id: "id",
name: "name",
createdAt: "createdAt",
updatedAt: "updatedAt",
createdById: "createdById",
};
exports.Prisma.AccountScalarFieldEnum = {
id: "id",
userId: "userId",
type: "type",
provider: "provider",
providerAccountId: "providerAccountId",
refresh_token: "refresh_token",
access_token: "access_token",
expires_at: "expires_at",
token_type: "token_type",
scope: "scope",
id_token: "id_token",
session_state: "session_state",
refresh_token_expires_in: "refresh_token_expires_in",
};
exports.Prisma.SessionScalarFieldEnum = {
id: "id",
sessionToken: "sessionToken",
userId: "userId",
expires: "expires",
};
exports.Prisma.UserScalarFieldEnum = {
id: "id",
name: "name",
email: "email",
emailVerified: "emailVerified",
image: "image",
};
exports.Prisma.VerificationTokenScalarFieldEnum = {
identifier: "identifier",
token: "token",
expires: "expires",
};
exports.Prisma.SortOrder = {
asc: "asc",
desc: "desc",
};
exports.Prisma.PostOrderByRelevanceFieldEnum = {
name: "name",
createdById: "createdById",
};
exports.Prisma.NullsOrder = {
first: "first",
last: "last",
};
exports.Prisma.AccountOrderByRelevanceFieldEnum = {
id: "id",
userId: "userId",
type: "type",
provider: "provider",
providerAccountId: "providerAccountId",
refresh_token: "refresh_token",
access_token: "access_token",
token_type: "token_type",
scope: "scope",
id_token: "id_token",
session_state: "session_state",
};
exports.Prisma.SessionOrderByRelevanceFieldEnum = {
id: "id",
sessionToken: "sessionToken",
userId: "userId",
};
exports.Prisma.UserOrderByRelevanceFieldEnum = {
id: "id",
name: "name",
email: "email",
image: "image",
};
exports.Prisma.VerificationTokenOrderByRelevanceFieldEnum = {
identifier: "identifier",
token: "token",
};
exports.Prisma.ModelName = {
Post: "Post",
Account: "Account",
Session: "Session",
User: "User",
VerificationToken: "VerificationToken",
};
/**
* Create the Client
*/
const config = {
generator: {
name: "client",
provider: {
fromEnvVar: null,
value: "prisma-client-js",
},
output: {
value:
"/var/home/zaremate/Documents/cc-create-shop/cc-create-shop/generated/prisma",
fromEnvVar: null,
},
config: {
engineType: "library",
},
binaryTargets: [
{
fromEnvVar: null,
value: "rhel-openssl-3.0.x",
native: true,
},
],
previewFeatures: [],
sourceFilePath:
"/var/home/zaremate/Documents/cc-create-shop/cc-create-shop/prisma/schema.prisma",
isCustomOutput: true,
},
relativeEnvPaths: {
rootEnvPath: null,
schemaEnvPath: "../../.env",
},
relativePath: "../../prisma",
clientVersion: "6.19.2",
engineVersion: "c2990dca591cba766e3b7ef5d9e8a84796e47ab7",
datasourceNames: ["db"],
activeProvider: "mysql",
postinstall: false,
inlineDatasources: {
db: {
url: {
fromEnvVar: "DATABASE_URL",
value: null,
},
},
},
inlineSchema:
'// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\ngenerator client {\n provider = "prisma-client-js"\n output = "../generated/prisma"\n}\n\ndatasource db {\n provider = "mysql"\n // NOTE: When using mysql or sqlserver, uncomment the @db.Text annotations in model Account below\n // Further reading:\n // https://next-auth.js.org/adapters/prisma#create-the-prisma-schema\n // https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#string\n url = env("DATABASE_URL")\n}\n\nmodel Post {\n id Int @id @default(autoincrement())\n name String\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n createdBy User @relation(fields: [createdById], references: [id])\n createdById String\n\n @@index([name])\n}\n\n// Necessary for Next auth\nmodel Account {\n id String @id @default(cuid())\n userId String\n type String\n provider String\n providerAccountId String\n refresh_token String? @db.Text\n access_token String? // @db.Text\n expires_at Int?\n token_type String?\n scope String?\n id_token String? // @db.Text\n session_state String?\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n refresh_token_expires_in Int?\n\n @@unique([provider, providerAccountId])\n}\n\nmodel Session {\n id String @id @default(cuid())\n sessionToken String @unique\n userId String\n expires DateTime\n user User @relation(fields: [userId], references: [id], onDelete: Cascade)\n}\n\nmodel User {\n id String @id @default(cuid())\n name String?\n email String? @unique\n emailVerified DateTime?\n image String?\n accounts Account[]\n sessions Session[]\n posts Post[]\n}\n\nmodel VerificationToken {\n identifier String\n token String @unique\n expires DateTime\n\n @@unique([identifier, token])\n}\n',
inlineSchemaHash:
"c08474639a944941f1c88b34cba4f0bee4e979c206a6c528fbeed6fac72671f9",
copyEngine: true,
};
config.dirname = "/";
config.runtimeDataModel = JSON.parse(
'{"models":{"Post":{"fields":[{"name":"id","kind":"scalar","type":"Int"},{"name":"name","kind":"scalar","type":"String"},{"name":"createdAt","kind":"scalar","type":"DateTime"},{"name":"updatedAt","kind":"scalar","type":"DateTime"},{"name":"createdBy","kind":"object","type":"User","relationName":"PostToUser"},{"name":"createdById","kind":"scalar","type":"String"}],"dbName":null},"Account":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"userId","kind":"scalar","type":"String"},{"name":"type","kind":"scalar","type":"String"},{"name":"provider","kind":"scalar","type":"String"},{"name":"providerAccountId","kind":"scalar","type":"String"},{"name":"refresh_token","kind":"scalar","type":"String"},{"name":"access_token","kind":"scalar","type":"String"},{"name":"expires_at","kind":"scalar","type":"Int"},{"name":"token_type","kind":"scalar","type":"String"},{"name":"scope","kind":"scalar","type":"String"},{"name":"id_token","kind":"scalar","type":"String"},{"name":"session_state","kind":"scalar","type":"String"},{"name":"user","kind":"object","type":"User","relationName":"AccountToUser"},{"name":"refresh_token_expires_in","kind":"scalar","type":"Int"}],"dbName":null},"Session":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"sessionToken","kind":"scalar","type":"String"},{"name":"userId","kind":"scalar","type":"String"},{"name":"expires","kind":"scalar","type":"DateTime"},{"name":"user","kind":"object","type":"User","relationName":"SessionToUser"}],"dbName":null},"User":{"fields":[{"name":"id","kind":"scalar","type":"String"},{"name":"name","kind":"scalar","type":"String"},{"name":"email","kind":"scalar","type":"String"},{"name":"emailVerified","kind":"scalar","type":"DateTime"},{"name":"image","kind":"scalar","type":"String"},{"name":"accounts","kind":"object","type":"Account","relationName":"AccountToUser"},{"name":"sessions","kind":"object","type":"Session","relationName":"SessionToUser"},{"name":"posts","kind":"object","type":"Post","relationName":"PostToUser"}],"dbName":null},"VerificationToken":{"fields":[{"name":"identifier","kind":"scalar","type":"String"},{"name":"token","kind":"scalar","type":"String"},{"name":"expires","kind":"scalar","type":"DateTime"}],"dbName":null}},"enums":{},"types":{}}',
);
defineDmmfProperty(exports.Prisma, config.runtimeDataModel);
config.engineWasm = {
getRuntime: async () => require("./query_engine_bg.js"),
getQueryEngineWasmModule: async () => {
const loader = (await import("#wasm-engine-loader")).default;
const engine = (await loader).default;
return engine;
},
};
config.compilerWasm = undefined;
config.injectableEdgeEnv = () => ({
parsed: {
DATABASE_URL:
(typeof globalThis !== "undefined" && globalThis["DATABASE_URL"]) ||
(typeof process !== "undefined" &&
process.env &&
process.env.DATABASE_URL) ||
undefined,
},
});
if (
(typeof globalThis !== "undefined" && globalThis["DEBUG"]) ||
(typeof process !== "undefined" && process.env && process.env.DEBUG) ||
undefined
) {
Debug.enable(
(typeof globalThis !== "undefined" && globalThis["DEBUG"]) ||
(typeof process !== "undefined" && process.env && process.env.DEBUG) ||
undefined,
);
}
const PrismaClient = getPrismaClient(config);
exports.PrismaClient = PrismaClient;
Object.assign(exports, Prisma);

10
next.config.js Normal file
View File

@ -0,0 +1,10 @@
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
import "./src/env.js";
/** @type {import("next").NextConfig} */
const config = {};
export default config;

6861
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

53
package.json Normal file
View File

@ -0,0 +1,53 @@
{
"name": "cc-create-shop",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"build": "next build",
"check": "next lint && tsc --noEmit",
"db:generate": "prisma migrate dev",
"db:migrate": "prisma migrate deploy",
"db:push": "prisma db push",
"db:studio": "prisma studio",
"dev": "next dev --turbo",
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,mdx}\" --cache",
"format:write": "prettier --write \"**/*.{ts,tsx,js,jsx,mdx}\" --cache",
"postinstall": "prisma generate",
"lint": "next lint",
"lint:fix": "next lint --fix",
"preview": "next build && next start",
"start": "next start",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@auth/prisma-adapter": "^2.7.2",
"@prisma/client": "^6.6.0",
"@t3-oss/env-nextjs": "^0.12.0",
"next": "^15.2.3",
"next-auth": "5.0.0-beta.25",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"zod": "^3.24.2"
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.1",
"@tailwindcss/postcss": "^4.0.15",
"@types/node": "^20.14.10",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"eslint": "^9.23.0",
"eslint-config-next": "^15.2.3",
"postcss": "^8.5.3",
"prettier": "^3.5.3",
"prettier-plugin-tailwindcss": "^0.6.11",
"prisma": "^6.6.0",
"tailwindcss": "^4.0.15",
"typescript": "^5.8.2",
"typescript-eslint": "^8.27.0"
},
"ct3aMetadata": {
"initVersion": "7.40.0"
},
"packageManager": "npm@11.6.2"
}

5
postcss.config.js Normal file
View File

@ -0,0 +1,5 @@
export default {
plugins: {
"@tailwindcss/postcss": {},
},
};

4
prettier.config.js Normal file
View File

@ -0,0 +1,4 @@
/** @type {import('prettier').Config & import('prettier-plugin-tailwindcss').PluginOptions} */
export default {
plugins: ["prettier-plugin-tailwindcss"],
};

75
prisma/schema.prisma Normal file
View File

@ -0,0 +1,75 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
output = "../generated/prisma"
}
datasource db {
provider = "mysql"
// NOTE: When using mysql or sqlserver, uncomment the @db.Text annotations in model Account below
// Further reading:
// https://next-auth.js.org/adapters/prisma#create-the-prisma-schema
// https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#string
url = env("DATABASE_URL")
}
model Post {
id Int @id @default(autoincrement())
name String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
createdBy User @relation(fields: [createdById], references: [id])
createdById String
@@index([name])
}
// Necessary for Next auth
model Account {
id String @id @default(cuid())
userId String
type String
provider String
providerAccountId String
refresh_token String? @db.Text
access_token String? // @db.Text
expires_at Int?
token_type String?
scope String?
id_token String? // @db.Text
session_state String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
refresh_token_expires_in Int?
@@unique([provider, providerAccountId])
}
model Session {
id String @id @default(cuid())
sessionToken String @unique
userId String
expires DateTime
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
}
model User {
id String @id @default(cuid())
name String?
email String? @unique
emailVerified DateTime?
image String?
accounts Account[]
sessions Session[]
posts Post[]
}
model VerificationToken {
identifier String
token String @unique
expires DateTime
@@unique([identifier, token])
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,3 @@
import { handlers } from "~/server/auth";
export const { GET, POST } = handlers;

25
src/app/layout.tsx Normal file
View File

@ -0,0 +1,25 @@
import "~/styles/globals.css";
import { type Metadata } from "next";
import { Geist } from "next/font/google";
export const metadata: Metadata = {
title: "Create T3 App",
description: "Generated by create-t3-app",
icons: [{ rel: "icon", url: "/favicon.ico" }],
};
const geist = Geist({
subsets: ["latin"],
variable: "--font-geist-sans",
});
export default function RootLayout({
children,
}: Readonly<{ children: React.ReactNode }>) {
return (
<html lang="en" className={`${geist.variable}`}>
<body>{children}</body>
</html>
);
}

37
src/app/page.tsx Normal file
View File

@ -0,0 +1,37 @@
import Link from "next/link";
export default function HomePage() {
return (
<main className="flex min-h-screen flex-col items-center justify-center bg-gradient-to-b from-[#2e026d] to-[#15162c] text-white">
<div className="container flex flex-col items-center justify-center gap-12 px-4 py-16">
<h1 className="text-5xl font-extrabold tracking-tight text-white sm:text-[5rem]">
Create <span className="text-[hsl(280,100%,70%)]">T3</span> App
</h1>
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 md:gap-8">
<Link
className="flex max-w-xs flex-col gap-4 rounded-xl bg-white/10 p-4 text-white hover:bg-white/20"
href="https://create.t3.gg/en/usage/first-steps"
target="_blank"
>
<h3 className="text-2xl font-bold">First Steps </h3>
<div className="text-lg">
Just the basics - Everything you need to know to set up your
database and authentication.
</div>
</Link>
<Link
className="flex max-w-xs flex-col gap-4 rounded-xl bg-white/10 p-4 text-white hover:bg-white/20"
href="https://create.t3.gg/en/introduction"
target="_blank"
>
<h3 className="text-2xl font-bold">Documentation </h3>
<div className="text-lg">
Learn more about Create T3 App, the libraries it uses, and how to
deploy it.
</div>
</Link>
</div>
</div>
</main>
);
}

52
src/env.js Normal file
View File

@ -0,0 +1,52 @@
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";
export const env = createEnv({
/**
* Specify your server-side environment variables schema here. This way you can ensure the app
* isn't built with invalid env vars.
*/
server: {
AUTH_SECRET:
process.env.NODE_ENV === "production"
? z.string()
: z.string().optional(),
AUTH_DISCORD_ID: z.string(),
AUTH_DISCORD_SECRET: z.string(),
DATABASE_URL: z.string().url(),
NODE_ENV: z
.enum(["development", "test", "production"])
.default("development"),
},
/**
* Specify your client-side environment variables schema here. This way you can ensure the app
* isn't built with invalid env vars. To expose them to the client, prefix them with
* `NEXT_PUBLIC_`.
*/
client: {
// NEXT_PUBLIC_CLIENTVAR: z.string(),
},
/**
* You can't destruct `process.env` as a regular object in the Next.js edge runtimes (e.g.
* middlewares) or client-side so we need to destruct manually.
*/
runtimeEnv: {
AUTH_SECRET: process.env.AUTH_SECRET,
AUTH_DISCORD_ID: process.env.AUTH_DISCORD_ID,
AUTH_DISCORD_SECRET: process.env.AUTH_DISCORD_SECRET,
DATABASE_URL: process.env.DATABASE_URL,
NODE_ENV: process.env.NODE_ENV,
},
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially
* useful for Docker builds.
*/
skipValidation: !!process.env.SKIP_ENV_VALIDATION,
/**
* Makes it so that empty strings are treated as undefined. `SOME_VAR: z.string()` and
* `SOME_VAR=''` will throw an error.
*/
emptyStringAsUndefined: true,
});

56
src/server/auth/config.ts Normal file
View File

@ -0,0 +1,56 @@
import { PrismaAdapter } from "@auth/prisma-adapter";
import { type DefaultSession, type NextAuthConfig } from "next-auth";
import DiscordProvider from "next-auth/providers/discord";
import { db } from "~/server/db";
/**
* Module augmentation for `next-auth` types. Allows us to add custom properties to the `session`
* object and keep type safety.
*
* @see https://next-auth.js.org/getting-started/typescript#module-augmentation
*/
declare module "next-auth" {
interface Session extends DefaultSession {
user: {
id: string;
// ...other properties
// role: UserRole;
} & DefaultSession["user"];
}
// interface User {
// // ...other properties
// // role: UserRole;
// }
}
/**
* Options for NextAuth.js used to configure adapters, providers, callbacks, etc.
*
* @see https://next-auth.js.org/configuration/options
*/
export const authConfig = {
providers: [
DiscordProvider,
/**
* ...add more providers here.
*
* Most other providers require a bit more work than the Discord provider. For example, the
* GitHub provider requires you to add the `refresh_token_expires_in` field to the Account
* model. Refer to the NextAuth.js docs for the provider you want to use. Example:
*
* @see https://next-auth.js.org/providers/github
*/
],
adapter: PrismaAdapter(db),
callbacks: {
session: ({ session, user }) => ({
...session,
user: {
...session.user,
id: user.id,
},
}),
},
} satisfies NextAuthConfig;

10
src/server/auth/index.ts Normal file
View File

@ -0,0 +1,10 @@
import NextAuth from "next-auth";
import { cache } from "react";
import { authConfig } from "./config";
const { auth: uncachedAuth, handlers, signIn, signOut } = NextAuth(authConfig);
const auth = cache(uncachedAuth);
export { auth, handlers, signIn, signOut };

16
src/server/db.ts Normal file
View File

@ -0,0 +1,16 @@
import { env } from "~/env";
import { PrismaClient } from "../../generated/prisma";
const createPrismaClient = () =>
new PrismaClient({
log:
env.NODE_ENV === "development" ? ["query", "error", "warn"] : ["error"],
});
const globalForPrisma = globalThis as unknown as {
prisma: ReturnType<typeof createPrismaClient> | undefined;
};
export const db = globalForPrisma.prisma ?? createPrismaClient();
if (env.NODE_ENV !== "production") globalForPrisma.prisma = db;

6
src/styles/globals.css Normal file
View File

@ -0,0 +1,6 @@
@import "tailwindcss";
@theme {
--font-sans: var(--font-geist-sans), ui-sans-serif, system-ui, sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

86
start-database.sh Executable file
View File

@ -0,0 +1,86 @@
#!/usr/bin/env bash
# Use this script to start a docker container for a local development database
# TO RUN ON WINDOWS:
# 1. Install WSL (Windows Subsystem for Linux) - https://learn.microsoft.com/en-us/windows/wsl/install
# 2. Install Docker Desktop or Podman Deskop
# - Docker Desktop for Windows - https://docs.docker.com/docker-for-windows/install/
# - Podman Desktop - https://podman.io/getting-started/installation
# 3. Open WSL - `wsl`
# 4. Run this script - `./start-database.sh`
# On Linux and macOS you can run this script directly - `./start-database.sh`
set -a
source .env
DB_PASSWORD=$(echo "$DATABASE_URL" | awk -F':' '{print $3}' | awk -F'@' '{print $1}')
DB_PORT=$(echo "$DATABASE_URL" | awk -F':' '{print $4}' | awk -F'\/' '{print $1}')
DB_NAME=$(echo "$DATABASE_URL" | awk -F'/' '{print $4}')
DB_CONTAINER_NAME="$DB_NAME-mysql"
if ! [ -x "$(command -v docker)" ] && ! [ -x "$(command -v podman)" ]; then
echo -e "Docker or Podman is not installed. Please install docker or podman and try again.\nDocker install guide: https://docs.docker.com/engine/install/\nPodman install guide: https://podman.io/getting-started/installation"
exit 1
fi
# determine which docker command to use
if [ -x "$(command -v docker)" ]; then
DOCKER_CMD="docker"
elif [ -x "$(command -v podman)" ]; then
DOCKER_CMD="podman"
fi
if ! $DOCKER_CMD info > /dev/null 2>&1; then
echo "$DOCKER_CMD daemon is not running. Please start $DOCKER_CMD and try again."
exit 1
fi
if command -v nc >/dev/null 2>&1; then
if nc -z localhost "$DB_PORT" 2>/dev/null; then
echo "Port $DB_PORT is already in use."
exit 1
fi
else
echo "Warning: Unable to check if port $DB_PORT is already in use (netcat not installed)"
read -p "Do you want to continue anyway? [y/N]: " -r REPLY
if ! [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Aborting."
exit 1
fi
fi
if [ "$($DOCKER_CMD ps -q -f name=$DB_CONTAINER_NAME)" ]; then
echo "Database container '$DB_CONTAINER_NAME' already running"
exit 0
fi
if [ "$($DOCKER_CMD ps -q -a -f name=$DB_CONTAINER_NAME)" ]; then
$DOCKER_CMD start "$DB_CONTAINER_NAME"
echo "Existing database container '$DB_CONTAINER_NAME' started"
exit 0
fi
if [ "$DB_PASSWORD" == "password" ]; then
echo "You are using the default database password"
read -p "Should we generate a random password for you? [y/N]: " -r REPLY
if ! [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Please change the default password in the .env file and try again"
exit 1
fi
# Generate a random URL-safe password
DB_PASSWORD=$(openssl rand -base64 12 | tr '+/' '-_')
if [[ "$(uname)" == "Darwin" ]]; then
# macOS requires an empty string to be passed with the `i` flag
sed -i '' "s#:password@#:$DB_PASSWORD@#" .env
else
sed -i "s#:password@#:$DB_PASSWORD@#" .env
fi
fi
$DOCKER_CMD run -d \
--name $DB_CONTAINER_NAME \
-e MYSQL_ROOT_PASSWORD="$DB_PASSWORD" \
-e MYSQL_DATABASE="$DB_NAME" \
-p "$DB_PORT":3306 \
docker.io/mysql && echo "Database container '$DB_CONTAINER_NAME' was successfully created"

42
tsconfig.json Normal file
View File

@ -0,0 +1,42 @@
{
"compilerOptions": {
/* Base Options: */
"esModuleInterop": true,
"skipLibCheck": true,
"target": "es2022",
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"isolatedModules": true,
"verbatimModuleSyntax": true,
/* Strictness */
"strict": true,
"noUncheckedIndexedAccess": true,
"checkJs": true,
/* Bundled projects */
"lib": ["dom", "dom.iterable", "ES2022"],
"noEmit": true,
"module": "ESNext",
"moduleResolution": "Bundler",
"jsx": "preserve",
"plugins": [{ "name": "next" }],
"incremental": true,
/* Path Aliases */
"baseUrl": ".",
"paths": {
"~/*": ["./src/*"]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.cjs",
"**/*.js",
".next/types/**/*.ts"
],
"exclude": ["node_modules", "generated"]
}