Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Repo #2

Merged
merged 9 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
POSTGRES_USER=user
POSTGRES_PASSWORD=password
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.lockb binary diff=lockb
15 changes: 15 additions & 0 deletions .github/actions/format/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Lint"
description: "Lint the project using Prettier"

runs:
using: composite
steps:
- uses: oven-sh/setup-bun@v1
with:
bun-version: 1.1.27

- shell: bash
run: bun install --frozen-lockfile

- shell: bash
run: bun format
17 changes: 17 additions & 0 deletions .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Lint"
description: "Lint the project using ESLint"

runs:
using: composite
steps:
- uses: oven-sh/setup-bun@v1
with:
bun-version: 1.1.27

- shell: bash
run: bun install --frozen-lockfile

- shell: bash
run: |
bun lint
bunx sherif@latest
15 changes: 15 additions & 0 deletions .github/actions/typecheck/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Type-check"
description: "Type-check the project using TSC"

runs:
using: composite
steps:
- uses: oven-sh/setup-bun@v1
with:
bun-version: 1.1.27

- shell: bash
run: bun install --frozen-lockfile

- shell: bash
run: bun typecheck
23 changes: 23 additions & 0 deletions .github/workflows/static-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Static Pull Request Checks

on:
pull_request:

jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/typecheck

format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/format

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/lint
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Dependencies
node_modules

# Local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Testing
coverage

# Turbo
.turbo

# Vercel
.vercel

# Build Outputs
.next/
out/
build
dist

# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Volumes
volumes/*

# Misc
.DS_Store
*.pem
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"yoavbls.pretty-ts-errors",
"bradlc.vscode-tailwindcss"
]
}
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Next.js",
"type": "node-terminal",
"request": "launch",
"command": "bun dev",
"cwd": "${workspaceFolder}/apps/web/",
"skipFiles": ["<node_internals>/**"]
}
]
}
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }],
"eslint.useFlatConfig": true,
"eslint.workingDirectories": [
{ "pattern": "apps/*/" },
{ "pattern": "packages/*/" },
{ "pattern": "tooling/*/" }
],
"prettier.ignorePath": ".gitignore",
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
],
"tailwindCSS.experimental.configFile": "./tooling/tailwind/web.ts",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.preferences.autoImportFileExcludePatterns": [
"next/router.d.ts",
"next/dist/client/router.d.ts"
],
"typescript.tsdk": "./node_modules/typescript/lib"
}
99 changes: 81 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,92 @@
# Create T3 App
# Good Dog Monorepo

This is a [T3 Stack](https://create.t3.gg/) project bootstrapped with `create-t3-app`.
This repository is a monorepo for the Good Dog Licensing project, managed with TurboRepo and Bun.

## What's next? How do I make an app with this?
## Table of Contents

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.
- [Good Dog Monorepo](#good-dog-monorepo)
- [Table of Contents](#table-of-contents)
- [Structure](#structure)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Running Scripts](#running-scripts)

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.
## Structure

- [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)
The repository is organized as follows:

## Learn More
- **apps/**: Contains the main applications.
- **db/**: Database-related scripts and configurations.
- **web/**: The web application built with Next.js.
- **packages/**: Contains shared packages.
- **trpc/**: tRPC-related code.
- **ui/**: UI components and utilities.
- **tooling/**: Contains configuration and tooling for the project.
- **eslint/**: ESLint configurations.
- **github/**: GitHub Actions and workflows.
- **prettier/**: Prettier configurations.
- **tailwind/**: Tailwind CSS configurations.
- **typescript**: TypeScript configurations.
- **.vscode/**: Contains Visual Studio Code settings and recommended extensions.
- **node_modules/**: Contains installed dependencies.
- **package.json**: Contains project metadata and scripts.
- **tsconfig.json**: Contains TypeScript configuration.
- **README.md**: The main documentation file for the project.

To learn more about the [T3 Stack](https://create.t3.gg/), take a look at the following resources:
## Getting Started

- [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
### Prerequisites

You can check out the [create-t3-app GitHub repository](https://github.com/t3-oss/create-t3-app) — your feedback and contributions are welcome!
- [Node.js](https://nodejs.org/) >= 20
- [Bun](https://bun.sh/) >= 1.1.27
- [Docker](https://www.docker.com/) >= 20.10.7

## How do I deploy this?
### Installation

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.
1. Clone the repository:

```sh
git clone git@github.com:sandboxnu/good-dog-licensing.git
cd good-dog
```

2. Install dependencies:

```sh
bun install
```

3. Create env file

```sh
cp .env.example .env
```

4. Start the dev enviornment:

```sh
bun dev
```

### Running Scripts

The following scripts are available in the root `package.json`:

- `build`: Build all packages and applications.
- `clean`: Clean all `node_modules` and Turbo cache.
- `db:up`: Start the database.
- `db:down`: Stop the database.
- `db:push`: Push database schema changes.
- `db:generate`: Generate database client.
- `db:migrate`: Run database migrations.
- `db:studio`: Open the database Studio.
- `dev`: Start all the development apps.
- `dev:web`: Start only the web app.
- `format`: Check code formatting.
- `format:fix`: Fix code formatting.
- `lint`: Run linting.
- `lint:fix`: Fix linting issues.
- `typecheck`: Run TypeScript type checks.
- `shad-add`: Add a new UI component using Shadcn.
- `generate:package`: Generate a new package.
14 changes: 14 additions & 0 deletions apps/db/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3.8"

services:
postgres:
image: postgres:15
restart: always
environment:
POSTGRES_DB: "good-dog"
POSTGRES_USER: "${POSTGRES_USER:-username}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-password}"
volumes:
- ../../volumes/postgres:/var/lib/postgresql/data
ports:
- "${POSTGRES_PORT:-5432}:5432"
9 changes: 9 additions & 0 deletions apps/db/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import baseConfig from "@good-dog/eslint/base";

/** @type {import('typescript-eslint').Config} */
export default [
{
ignores: [],
},
...baseConfig,
];
13 changes: 13 additions & 0 deletions apps/db/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "@good-dog/db",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "docker-compose -f compose.yml up",
"up": "docker-compose -f compose.yml up -d",
"down": "docker-compose -f compose.yml down",
"clean": "rm -rf .turbo node_modules",
"format": "prettier --check . --ignore-path ../../.gitignore"
}
}
83 changes: 83 additions & 0 deletions apps/web/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 47.4% 11.2%;

--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;

--popover: 0 0% 100%;
--popover-foreground: 222.2 47.4% 11.2%;

--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;

--card: 0 0% 100%;
--card-foreground: 222.2 47.4% 11.2%;

--primary: 222.2 47.4% 11.2%;
--primary-foreground: 210 40% 98%;

--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;

--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;

--destructive: 0 100% 50%;
--destructive-foreground: 210 40% 98%;

--ring: 215 20.2% 65.1%;

--radius: 0.5rem;
}

.dark {
--background: 224 71% 4%;
--foreground: 213 31% 91%;

--muted: 223 47% 11%;
--muted-foreground: 215.4 16.3% 56.9%;

--accent: 216 34% 17%;
--accent-foreground: 210 40% 98%;

--popover: 224 71% 4%;
--popover-foreground: 215 20.2% 65.1%;

--border: 216 34% 17%;
--input: 216 34% 17%;

--card: 224 71% 4%;
--card-foreground: 213 31% 91%;

--primary: 210 40% 98%;
--primary-foreground: 222.2 47.4% 1.2%;

--secondary: 222.2 47.4% 11.2%;
--secondary-foreground: 210 40% 98%;

--destructive: 0 63% 31%;
--destructive-foreground: 210 40% 98%;

--ring: 216 34% 17%;

--radius: 0.5rem;
}
}

@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
font-feature-settings:
"rlig" 1,
"calt" 1;
}
}
Loading