Skip to content

Commit 523d91f

Browse files
committed
feat: scaffold monorepo
1 parent 27a82e8 commit 523d91f

Some content is hidden

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

62 files changed

+19346
-712
lines changed

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
node_modules
3+
.turbo
4+
*.log
5+
.next
6+
dist
7+
dist-ssr
8+
*.local
9+
.env
10+
.cache
11+
server/dist
12+
public/dist
13+
.turbo

.prettierignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
node_modules
2+
.next
3+
build
4+
dist
5+
*.tsbuildinfo
6+
*.gitignore
7+
*.svg
8+
*.lock
9+
*.npmignore
10+
*.sql
11+
*.png
12+
*.jpg
13+
*.jpeg
14+
*.gif
15+
*.ico
16+
*.sh
17+
Dockerfile
18+
Dockerfile.*
19+
.env
20+
.env.*
21+
LICENSE
22+
*.log
23+
.DS_Store
24+
.dockerignore
25+
*.patch
26+
*.toml
27+
*.prisma

.vscode/settings.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"files.trimFinalNewlines": true,
3+
"files.trimTrailingWhitespace": true,
4+
"cSpell.autoFormatConfigFile": true,
5+
"editor.formatOnPaste": true,
6+
"editor.formatOnSave": true,
7+
"editor.formatOnSaveMode": "file",
8+
"javascript.format.enable": true,
9+
"json.format.enable": true,
10+
"eslint.format.enable": false,
11+
"css.format.enable": true,
12+
"css.format.newlineBetweenRules": true,
13+
"css.format.newlineBetweenSelectors": true,
14+
"css.format.preserveNewLines": true,
15+
"typescript.format.enable": true,
16+
"editor.codeActionsOnSave": {
17+
"source.fixAll": true
18+
}
19+
}

apps/portal/.env.local.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Prisma
2+
DATABASE_URL=postgresql://postgres:[PASSWORD]@localhost:5432/postgres
3+
4+
# Next Auth
5+
NEXTAUTH_SECRET=any_string_you_wish
6+
NEXTAUTH_URL=http://localhost:3000
7+
8+
# Next Auth GitHub Provider
9+
GITHUB_CLIENT_ID=a5164b1943b5413ff2f5
10+
GITHUB_CLIENT_SECRET=

apps/portal/.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['tih', 'next/core-web-vitals'],
4+
parserOptions: {
5+
tsconfigRootDir: __dirname,
6+
project: ['./tsconfig.json'],
7+
},
8+
};

apps/portal/.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
15+
# next.js
16+
/.next/
17+
/out/
18+
19+
# production
20+
/build
21+
22+
# misc
23+
.DS_Store
24+
*.pem
25+
26+
# debug
27+
npm-debug.log*
28+
yarn-debug.log*
29+
yarn-error.log*
30+
.pnpm-debug.log*
31+
32+
# local env files
33+
.env
34+
.env*.local
35+
36+
# vercel
37+
.vercel
38+
39+
# typescript
40+
*.tsbuildinfo

apps/portal/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Create T3 App
2+
3+
This is an app bootstrapped according to the [init.tips](https://init.tips) stack, also known as the T3-Stack.
4+
5+
## Why are there `.js` files in here?
6+
7+
As per [T3-Axiom #3](https://github.com/t3-oss/create-t3-app/tree/next#3-typesafety-isnt-optional), we take typesafety as a first class citizen. Unfortunately, not all frameworks and plugins support TypeScript which means some of the configuration files have to be `.js` files.
8+
9+
We try to emphasize that these files are javascript for a reason, by explicitly declaring its type (`cjs` or `mjs`) depending on what's supported by the library it is used by. Also, all the `js` files in this project are still typechecked using a `@ts-check` comment at the top.
10+
11+
## What's next? How do I make an app with this?
12+
13+
We try to keep this project as simple as possible, so you can start with the most basic configuration and then move on to more advanced configuration.
14+
15+
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.
16+
17+
- [Next-Auth.js](https://next-auth.js.org)
18+
- [Prisma](https://prisma.io)
19+
- [TailwindCSS](https://tailwindcss.com)
20+
- [tRPC](https://trpc.io) (using @next version? [see v10 docs here](https://trpc.io/docs/v10/))
21+
22+
Also checkout these awesome tutorials on `create-t3-app`.
23+
24+
- [Build a Blog With the T3 Stack - tRPC, TypeScript, Next.js, Prisma & Zod](https://www.youtube.com/watch?v=syEWlxVFUrY)
25+
- [Build a Live Chat Application with the T3 Stack - TypeScript, Tailwind, tRPC](https://www.youtube.com/watch?v=dXRRY37MPuk)
26+
- [Build a full stack app with create-t3-app](https://www.nexxel.dev/blog/ct3a-guestbook)
27+
- [A first look at create-t3-app](https://dev.to/ajcwebdev/a-first-look-at-create-t3-app-1i8f)
28+
29+
## How do I deploy this?
30+
31+
### Vercel
32+
33+
We recommend deploying to [Vercel](https://vercel.com/?utm_source=t3-oss&utm_campaign=oss). It makes it super easy to deploy NextJs apps.
34+
35+
- Push your code to a GitHub repository.
36+
- Go to [Vercel](https://vercel.com/?utm_source=t3-oss&utm_campaign=oss) and sign up with GitHub.
37+
- Create a Project and import the repository you pushed your code to.
38+
- Add your environment variables.
39+
- Click **Deploy**
40+
- Now whenever you push a change to your repository, Vercel will automatically redeploy your website!
41+
42+
### Docker
43+
44+
You can also dockerize this stack and deploy a container. See the [Docker deployment page](https://create-t3-app-nu.vercel.app/en/deployment/docker) for details.
45+
46+
## Useful resources
47+
48+
Here are some resources that we commonly refer to:
49+
50+
- [Protecting routes with Next-Auth.js](https://next-auth.js.org/configuration/nextjs#unstable_getserversession)

apps/portal/next-env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

apps/portal/next.config.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { env } from './src/env/server.mjs';
2+
3+
/**
4+
* Don't be scared of the generics here.
5+
* All they do is to give us autocompletion when using this.
6+
*
7+
* @template {import('next').NextConfig} T
8+
* @param {T} config - A generic parameter that flows through to the return type
9+
* @constraint {{import('next').NextConfig}}
10+
*/
11+
function defineNextConfig(config) {
12+
return config;
13+
}
14+
15+
export default defineNextConfig({
16+
reactStrictMode: true,
17+
swcMinify: true,
18+
});

0 commit comments

Comments
 (0)