-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
108 changed files
with
1,400 additions
and
1,376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
POSTGRES_USER=user | ||
POSTGRES_PASSWORD=password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: "Lint" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: 1.1.27 | ||
|
||
- shell: bash | ||
run: bun install --frozen-lockfile | ||
|
||
- shell: bash | ||
run: bun run format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: "Lint" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: 1.1.27 | ||
|
||
- shell: bash | ||
run: bun install --frozen-lockfile | ||
|
||
- shell: bash | ||
run: bun run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: "Type-check" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: 1.1.27 | ||
|
||
- shell: bash | ||
run: bun install --frozen-lockfile | ||
|
||
- shell: bash | ||
run: bun run typecheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Static Pull Request Checks | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
typecheck: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: ./.github/actions/typecheck | ||
|
||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: ./.github/actions/format | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: ./.github/actions/lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["esbenp.prettier-vscode"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"typescript.tsdk": "./node_modules/typescript/lib", | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,92 @@ | ||
# Turborepo starter | ||
# Good Dog Monorepo | ||
|
||
This is an official starter Turborepo. | ||
This repository is a monorepo for the Good Dog Licensing project, managed with TurboRepo and Bun. | ||
|
||
## Using this example | ||
## Table of Contents | ||
|
||
Run the following command: | ||
- [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) | ||
|
||
```sh | ||
npx create-turbo@latest | ||
``` | ||
|
||
## What's inside? | ||
|
||
This Turborepo includes the following packages/apps: | ||
|
||
### Apps and Packages | ||
## Structure | ||
|
||
- `docs`: a [Next.js](https://nextjs.org/) app | ||
- `web`: another [Next.js](https://nextjs.org/) app | ||
- `@repo/ui`: a stub React component library shared by both `web` and `docs` applications | ||
- `@repo/eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`) | ||
- `@repo/typescript-config`: `tsconfig.json`s used throughout the monorepo | ||
The repository is organized as follows: | ||
|
||
Each package/app is 100% [TypeScript](https://www.typescriptlang.org/). | ||
- **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. | ||
|
||
### Utilities | ||
## Getting Started | ||
|
||
This Turborepo has some additional tools already setup for you: | ||
### Prerequisites | ||
|
||
- [TypeScript](https://www.typescriptlang.org/) for static type checking | ||
- [ESLint](https://eslint.org/) for code linting | ||
- [Prettier](https://prettier.io) for code formatting | ||
- [Node.js](https://nodejs.org/) >= 20 | ||
- [Bun](https://bun.sh/) >= 1.1.27 | ||
- [Docker](https://www.docker.com/) >= 20.10.7 | ||
|
||
### Build | ||
### Installation | ||
|
||
To build all apps and packages, run the following command: | ||
1. Clone the repository: | ||
|
||
``` | ||
cd my-turborepo | ||
pnpm build | ||
``` | ||
|
||
### Develop | ||
```sh | ||
git clone git@github.com:sandboxnu/good-dog-licensing.git | ||
cd good-dog | ||
``` | ||
|
||
To develop all apps and packages, run the following command: | ||
2. Install dependencies: | ||
|
||
``` | ||
cd my-turborepo | ||
pnpm dev | ||
```sh | ||
bun install | ||
``` | ||
|
||
### Remote Caching | ||
3. Create env file | ||
|
||
Turborepo can use a technique known as [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines. | ||
|
||
By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup), then enter the following commands: | ||
|
||
``` | ||
cd my-turborepo | ||
npx turbo login | ||
```sh | ||
cp .env.example .env | ||
``` | ||
|
||
This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview). | ||
|
||
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo: | ||
4. Start the dev enviornment: | ||
|
||
```sh | ||
bun dev | ||
``` | ||
npx turbo link | ||
``` | ||
|
||
## Useful Links | ||
|
||
Learn more about the power of Turborepo: | ||
|
||
- [Tasks](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks) | ||
- [Caching](https://turbo.build/repo/docs/core-concepts/caching) | ||
- [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching) | ||
- [Filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering) | ||
- [Configuration Options](https://turbo.build/repo/docs/reference/configuration) | ||
- [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference) | ||
### 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"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", | ||
"typecheck": "tsc --noEmit --emitDeclarationOnly false" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.