Skip to content

Commit

Permalink
environment setup
Browse files Browse the repository at this point in the history
  • Loading branch information
owens1127 committed Sep 18, 2024
1 parent 7253ba1 commit ac3db87
Show file tree
Hide file tree
Showing 108 changed files with 1,400 additions and 1,376 deletions.
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
16 changes: 16 additions & 0 deletions .github/actions/format.yml
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
16 changes: 16 additions & 0 deletions .github/actions/lint.yml
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
16 changes: 16 additions & 0 deletions .github/actions/typecheck.yml
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
20 changes: 20 additions & 0 deletions .github/workflows/static-checks.yml
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
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Dependencies
node_modules
.pnp
.pnp.js

# Local env files
.env
Expand All @@ -27,12 +23,14 @@ out/
build
dist


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

# Volumes
volumes/*

# Misc
.DS_Store
*.pem
Empty file removed .npmrc
Empty file.
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode"]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
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"
}
129 changes: 70 additions & 59 deletions README.md
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.
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,
];
14 changes: 14 additions & 0 deletions apps/db/package.json
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"
}
}
9 changes: 0 additions & 9 deletions apps/docs/.eslintrc.js

This file was deleted.

36 changes: 0 additions & 36 deletions apps/docs/.gitignore

This file was deleted.

36 changes: 0 additions & 36 deletions apps/docs/README.md

This file was deleted.

Binary file removed apps/docs/app/favicon.ico
Binary file not shown.
Binary file removed apps/docs/app/fonts/GeistMonoVF.woff
Binary file not shown.
Binary file removed apps/docs/app/fonts/GeistVF.woff
Binary file not shown.
Loading

0 comments on commit ac3db87

Please sign in to comment.