├── apps └── web │ ├── .env │ ├── .gitignore │ ├── static │ ├── favicon.png │ └── opengraph.png │ ├── src │ ├── routes │ │ ├── auth-demo │ │ │ ├── guarded-page │ │ │ │ ├── +page.svelte │ │ │ │ └── +page.server.ts │ │ │ └── +page.svelte │ │ ├── api │ │ │ └── trpc │ │ │ │ └── [trpc] │ │ │ │ └── +server.ts │ │ ├── drinks │ │ │ ├── [id] │ │ │ │ ├── +page.server.ts │ │ │ │ └── +page.svelte │ │ │ ├── +page.server.ts │ │ │ └── +page.svelte │ │ ├── +layout.svelte │ │ └── +page.svelte │ ├── lib │ │ ├── server │ │ │ ├── db │ │ │ │ └── index.ts │ │ │ └── authjs │ │ │ │ └── index.ts │ │ ├── api │ │ │ ├── procedures │ │ │ │ ├── publicProcedure.ts │ │ │ │ └── authedProcedure.ts │ │ │ ├── routes │ │ │ │ ├── public-viewer │ │ │ │ │ ├── _router.ts │ │ │ │ │ ├── session.router.ts │ │ │ │ │ └── drinks │ │ │ │ │ │ ├── drinks.schema.ts │ │ │ │ │ │ ├── drinks.router.ts │ │ │ │ │ │ └── drinks.json │ │ │ │ └── authed-viewer │ │ │ │ │ └── _router.ts │ │ │ ├── trpc.ts │ │ │ ├── middlewares │ │ │ │ ├── perfMiddleware.ts │ │ │ │ └── sessionMiddleware.ts │ │ │ ├── root.ts │ │ │ ├── createContext.ts │ │ │ ├── client.ts │ │ │ ├── trpc-load.ts │ │ │ └── handle.ts │ │ └── drinks │ │ │ ├── queries │ │ │ └── index.ts │ │ │ └── components │ │ │ └── DrinksGrid.svelte │ ├── hooks.server.ts │ ├── app.html │ ├── app.d.ts │ └── app.css │ ├── postcss.config.cjs │ ├── .eslintignore │ ├── README.md │ ├── tailwind.config.cjs │ ├── vite.config.js │ ├── tsconfig.json │ ├── svelte.config.js │ └── package.json ├── packages ├── database │ ├── .env │ ├── .gitignore │ ├── index.ts │ ├── package.json │ └── prisma │ │ └── schema.prisma ├── core │ ├── index.ts │ ├── class-utils.ts │ ├── tsconfig.json │ └── package.json ├── ui │ ├── index.ts │ ├── components │ │ ├── card │ │ │ ├── CardContent.svelte │ │ │ ├── CardFooter.svelte │ │ │ ├── CardDescription.svelte │ │ │ ├── CardHeader.svelte │ │ │ ├── index.ts │ │ │ ├── Card.svelte │ │ │ └── CardTitle.svelte │ │ ├── badge │ │ │ ├── index.ts │ │ │ └── Badge.svelte │ │ ├── pulse │ │ │ └── Pulse.svelte │ │ └── button │ │ │ ├── index.ts │ │ │ └── Button.svelte │ ├── tsconfig.json │ └── package.json ├── tsconfig │ ├── package.json │ ├── tsconfig-base.json │ └── tsconfig-svelte-library.json └── config │ ├── eslint-preset.js │ ├── prettier-preset.js │ ├── package.json │ └── tailwind-preset.js ├── .npmrc ├── pnpm-workspace.yaml ├── .eslintrc.cjs ├── .prettierrc.js ├── commitlint.config.cjs ├── .husky ├── pre-push ├── commit-msg └── pre-commit ├── .lintstagedrc ├── .prettierignore ├── .env.example ├── .gitignore ├── turbo.json ├── package.json ├── CONTRIBUTING.md └── README.md /apps/web/.env: -------------------------------------------------------------------------------- 1 | ../../.env -------------------------------------------------------------------------------- /packages/database/.env: -------------------------------------------------------------------------------- 1 | ../../.env -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | auto-install-peers = true 2 | -------------------------------------------------------------------------------- /packages/database/.gitignore: -------------------------------------------------------------------------------- 1 | !.env 2 | -------------------------------------------------------------------------------- /packages/core/index.ts: -------------------------------------------------------------------------------- 1 | export * from './class-utils' -------------------------------------------------------------------------------- /packages/database/index.ts: -------------------------------------------------------------------------------- 1 | export * from '@prisma/client'; -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - "apps/*" 3 | - "packages/*" 4 | -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = require("./packages/config/eslint-preset"); 2 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require("./packages/config/prettier-preset"); -------------------------------------------------------------------------------- /commitlint.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ['@commitlint/config-conventional'] }; 2 | -------------------------------------------------------------------------------- /.husky/pre-push: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | pnpm type-check 5 | -------------------------------------------------------------------------------- /apps/web/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | !.env 7 | -------------------------------------------------------------------------------- /apps/web/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/multiplehats/jaydens-stack/HEAD/apps/web/static/favicon.png -------------------------------------------------------------------------------- /apps/web/static/opengraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/multiplehats/jaydens-stack/HEAD/apps/web/static/opengraph.png -------------------------------------------------------------------------------- /apps/web/src/routes/auth-demo/guarded-page/+page.svelte: -------------------------------------------------------------------------------- 1 |
Guarded page. Only if you have an active session you can see this.
-------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npx --no -- commitlint --edit $1 5 | 6 | 7 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | # pnpm 5 | pnpm run lint-staged 6 | # pnpx lint-staged -------------------------------------------------------------------------------- /apps/web/postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /apps/web/src/lib/server/db/index.ts: -------------------------------------------------------------------------------- 1 | import { PrismaClient } from '@prisma/client'; 2 | 3 | export const prisma = new PrismaClient(); 4 | -------------------------------------------------------------------------------- /packages/ui/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./components/button"; 2 | export * from "./components/badge"; 3 | export * from "./components/card"; -------------------------------------------------------------------------------- /.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "apps/**/*.{js,ts,svelte,svx}": [ 3 | "eslint --fix" 4 | ], 5 | "packages/components/**/*.{js,ts,svelte,svx}": [ 6 | "eslint --fix" 7 | ] 8 | } -------------------------------------------------------------------------------- /apps/web/src/routes/api/trpc/[trpc]/+server.ts: -------------------------------------------------------------------------------- 1 | import { trpcServerHandle } from "$lib/api/handle"; 2 | 3 | export const GET = trpcServerHandle; 4 | export const POST = trpcServerHandle; 5 | -------------------------------------------------------------------------------- /packages/core/class-utils.ts: -------------------------------------------------------------------------------- 1 | import { type ClassValue, clsx } from 'clsx'; 2 | import { twMerge } from 'tailwind-merge'; 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)); 6 | } 7 | -------------------------------------------------------------------------------- /apps/web/.eslintignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | 10 | # Ignore files for PNPM, NPM and YARN 11 | pnpm-lock.yaml 12 | package-lock.json 13 | yarn.lock 14 | -------------------------------------------------------------------------------- /apps/web/src/lib/api/procedures/publicProcedure.ts: -------------------------------------------------------------------------------- 1 | import perfMiddleware from "../middlewares/perfMiddleware"; 2 | import { tRPCContext } from "../trpc"; 3 | 4 | const publicProcedure = tRPCContext.procedure.use(perfMiddleware); 5 | 6 | export default publicProcedure; 7 | -------------------------------------------------------------------------------- /apps/web/README.md: -------------------------------------------------------------------------------- 1 | # SvelteKit application 2 | 3 | This is a SvelteKit application that utilises components from `@acme/ui`, as well as utilities from `@acme/core`. It also includes an example of fetching data with tRPC on the server, and hydrating Tanstack Query on the client. 4 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .svelte-kit 3 | node_modules 4 | /build 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | vite.config.js* 10 | 11 | # Ignore files for PNPM, NPM and YARN 12 | pnpm-lock.yaml 13 | pnpm-workspace.yaml 14 | package-lock.json 15 | yarn.lock 16 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | DATABASE_URL="" 2 | 3 | ## Use openssl rand -base64 32 to generate a secret 4 | AUTH_SECRET="" 5 | 6 | # Optional: When deploying your app outside Vercel, set the AUTH_TRUST_HOST variable to true for other hosting providers like Cloudflare Pages or Netlify. 7 | # AUTH_TRUST_HOST -------------------------------------------------------------------------------- /apps/web/tailwind.config.cjs: -------------------------------------------------------------------------------- 1 | const base = require("@acme/config/tailwind-preset"); 2 | 3 | /** @type {import('tailwindcss').Config} */ 4 | export default { 5 | presets: [base], 6 | content: ["./src/**/*.{html,js,svelte,ts}", "../../packages/ui/components/**/*.{svelte,ts}"], 7 | }; 8 | -------------------------------------------------------------------------------- /apps/web/vite.config.js: -------------------------------------------------------------------------------- 1 | import { sveltekit } from '@sveltejs/kit/vite'; 2 | import tsconfigPaths from 'vite-tsconfig-paths'; 3 | 4 | /** @type {import('vite').UserConfig} */ 5 | const config = { 6 | plugins: [sveltekit(), tsconfigPaths()] 7 | }; 8 | 9 | export default config; 10 | -------------------------------------------------------------------------------- /packages/tsconfig/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@acme/tsconfig", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "files": [ 6 | "tsconfig-base.json", 7 | "tsconfig-svelte-library.json" 8 | ], 9 | "devDependencies": { 10 | "@tsconfig/svelte": "3.0.0" 11 | } 12 | } -------------------------------------------------------------------------------- /packages/ui/components/card/CardContent.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 |
9 |
21 | An example of how to use tRPC with Tanstack Query. Gets the data on the server and hydrates the 22 | initial page. Then uses createInfiniteQuery to fetch more data on the client. 23 |
24 |Check back later for more drinks.
31 |24 | You can only test this locally. Check your terminal for the login link. 25 |
26 | 27 |61 | You're logged in as. Your user ID is: {$session.data.session?.user.id} 62 |
63 | 64 | 65 |
2 |
3 |
79 | A modern monorepo boilerplate focused on developer experience, scalability, and performance. Start small 80 | and scale up with confidence. 81 |
82 | 83 | {#if $session.data?.session} 84 |85 | You're logged in as. Your user ID is: {$session.data.session?.user.id} 86 |
87 | {/if} 88 |