Skip to content

Commit 912f5ee

Browse files
author
Maxim
committed
first commit
0 parents  commit 912f5ee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+10110
-0
lines changed

.env.example

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Since the ".env" file is gitignored, you can use the ".env.example" file to
2+
# build a new ".env" file when you clone the repo. Keep this file up-to-date
3+
# when you add new variables to `.env`.
4+
5+
# This file will be committed to version control, so make sure not to have any
6+
# secrets in it. If you are cloning this repo, create a copy of this file named
7+
# ".env" and populate it with your secrets.
8+
9+
# When adding additional environment variables, the schema in "/src/env.js"
10+
# should be updated accordingly.
11+
12+
# Drizzle
13+
DATABASE_URL="postgresql://postgres:password@localhost:5432/next-postgres"
14+
15+
# Next Auth
16+
# You can generate a new secret on the command line with:
17+
# openssl rand -base64 32
18+
# https://next-auth.js.org/configuration/options#secret
19+
# NEXTAUTH_SECRET=""
20+
NEXTAUTH_URL="http://localhost:3000"
21+
22+
# Next Auth Discord Provider
23+
DISCORD_CLIENT_ID=""
24+
DISCORD_CLIENT_SECRET=""

.eslintrc.cjs

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
const config = {
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"project": true
6+
},
7+
"plugins": [
8+
"@typescript-eslint",
9+
"drizzle"
10+
],
11+
"extends": [
12+
"next/core-web-vitals",
13+
"plugin:@typescript-eslint/recommended-type-checked",
14+
"plugin:@typescript-eslint/stylistic-type-checked"
15+
],
16+
"ignorePatterns": ["src/components/ui/**/*"],
17+
"rules": {
18+
"@typescript-eslint/array-type": "off",
19+
"@typescript-eslint/consistent-type-definitions": "off",
20+
"@typescript-eslint/consistent-type-imports": [
21+
"warn",
22+
{
23+
"prefer": "type-imports",
24+
"fixStyle": "inline-type-imports"
25+
}
26+
],
27+
"@typescript-eslint/no-unused-vars": [
28+
"warn",
29+
{
30+
"argsIgnorePattern": "^_"
31+
}
32+
],
33+
"@typescript-eslint/require-await": "off",
34+
"@typescript-eslint/no-misused-promises": [
35+
"error",
36+
{
37+
"checksVoidReturn": {
38+
"attributes": false
39+
}
40+
}
41+
],
42+
"drizzle/enforce-delete-with-where": [
43+
"error",
44+
{
45+
"drizzleObjectName": [
46+
"db",
47+
"ctx.db"
48+
]
49+
}
50+
],
51+
"drizzle/enforce-update-with-where": [
52+
"error",
53+
{
54+
"drizzleObjectName": [
55+
"db",
56+
"ctx.db"
57+
]
58+
}
59+
]
60+
}
61+
}
62+
module.exports = config;

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# database
12+
/prisma/db.sqlite
13+
/prisma/db.sqlite-journal
14+
db.sqlite
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
next-env.d.ts
20+
21+
# production
22+
/build
23+
24+
# misc
25+
.DS_Store
26+
*.pem
27+
28+
# debug
29+
npm-debug.log*
30+
yarn-debug.log*
31+
yarn-error.log*
32+
.pnpm-debug.log*
33+
34+
# local env files
35+
# 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
36+
.env
37+
.env*.local
38+
39+
# vercel
40+
.vercel
41+
42+
# typescript
43+
*.tsbuildinfo
44+
45+
# idea files
46+
.idea

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Create T3 App
2+
3+
This is a [T3 Stack](https://create.t3.gg/) project bootstrapped with `create-t3-app`.
4+
5+
- [Next.js](https://nextjs.org)
6+
- [NextAuth.js](https://next-auth.js.org)
7+
- [Prisma](https://prisma.io)
8+
- [Drizzle](https://orm.drizzle.team)
9+
- [Tailwind CSS](https://tailwindcss.com)
10+
- [tRPC](https://trpc.io)
11+
- [Shadcn UI](https://ui.shadcn.com)
12+
13+
## Learn More
14+
15+
To learn more about the [T3 Stack](https://create.t3.gg/), take a look at the following resources:
16+
17+
- [Documentation](https://create.t3.gg/)
18+
- [Learn the T3 Stack](https://create.t3.gg/en/faq#what-learning-resources-are-currently-available) — Check out these awesome tutorials
19+
20+
## How do I deploy this?
21+
22+
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.
23+
24+
# Configuration Instructions
25+
26+
## Database Setup
27+
28+
1. Run `./start-database.sh` to start a local postgres database in a docker container
29+
2. Run `npm run db:push` to push the models to the database
30+
3. Update your schema in `drizzle/schema.ts`
31+
4. Run `npm run db:push` to push the new schema to the database
32+
33+
## TRPC Setup
34+
35+
1. All TRPC routes are defined in `src/server/api/routers`
36+
2. Add new TRPC routers in `src/server/api/routers`
37+
3. Resolve TRPC router imports in `src/server/api/root.ts`
38+
39+
## Auth Setup
40+
41+
1. Add auth providers to `src/server/auth.ts`
42+
2. Include proper environment variables for auth providers in `.env` and `src/env.js`

components.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": true,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "tailwind.config.ts",
8+
"css": "src/styles/globals.css",
9+
"baseColor": "zinc",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "~/components",
15+
"utils": "~/lib/utils",
16+
"ui": "~/components/ui",
17+
"lib": "~/lib",
18+
"hooks": "~/hooks"
19+
}
20+
}

drizzle.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { type Config } from "drizzle-kit";
2+
3+
import { env } from "~/env";
4+
5+
export default {
6+
schema: "./src/server/db/schema.ts",
7+
dialect: "postgresql",
8+
dbCredentials: {
9+
url: env.DATABASE_URL,
10+
},
11+
tablesFilter: [`next_postgres_*`],
12+
} satisfies Config;

next.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
3+
* for Docker builds.
4+
*/
5+
await import("./src/env.js");
6+
7+
/** @type {import("next").NextConfig} */
8+
const config = {};
9+
10+
export default config;

0 commit comments

Comments
 (0)