Skip to content

Commit

Permalink
initial: 🎉 first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dino3616 committed Oct 22, 2023
0 parents commit ef23e3d
Show file tree
Hide file tree
Showing 380 changed files with 24,814 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "lockerai",
"workspaceFolder": "/workspaces/lockerai/",
"dockerComposeFile": ["../docker/docker-compose.development.yaml"],
"service": "app",
"customizations": {
"vscode": {
"extensions": [
"adam-bender.commit-message-editor",
"bierner.color-info",
"bradlc.vscode-tailwindcss",
"christian-kohler.path-intellisense",
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"ecmel.vscode-html-css",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"figma.figma-vscode-extension",
"formulahendry.auto-complete-tag",
"github.copilot",
"github.copilot-labs",
"github.vscode-github-actions",
"github.vscode-pull-request-github",
"graphql.vscode-graphql",
"gruntfuggly.todo-tree",
"hbenl.vscode-test-explorer",
"jock.svg",
"mikestead.dotenv",
"ms-ossdata.vscode-postgresql",
"orta.vscode-jest",
"stylelint.vscode-stylelint",
"usernamehw.errorlens",
"vincaslt.highlight-matching-tag",
"visualstudioexptteam.vscodeintellicode",
"wix.vscode-import-cost",
"wmaurer.change-case",
"yoavbls.pretty-ts-errors"
]
}
}
}
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# debug
**/*.log

# deliverable
**/.next/
**/build/
**/dist/
**/out/

# dependency
**/node_modules/
**/.pnpm-store/

# env file
**/.env*
!**/.env.example

# storybook
**/.storybook/static/

# testing
**/coverage

# typescript
**/*.tsbuildinfo
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
11 changes: 11 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
COMPOSE_PROJECT_NAME="lockerai"
SUPABASE_ACCESS_TOKEN=""
SUPABASE_ANON_KEY=""
SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_ID=""
SUPABASE_AUTH_EXTERNAL_GOOGLE_SECRET=""
SUPABASE_AUTH_EXTERNAL_GOOGLE_URL=""
SUPABASE_JWT_SECRET=""
SUPABASE_REFERENCE_ID=""
SUPABASE_SERVICE_ROLE_KEY=""
TURBO_TEAM=""
TURBO_TOKEN=""
55 changes: 55 additions & 0 deletions .github/filter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
api:
- .github/filter.yaml
- .github/workflows/api-*.yaml
- apps/api/**/*
- packages/**/*
- .npmrc
- package.json
- pnpm-workspace.yaml
- turbo.json

app:
- .github/filter.yaml
- .github/workflows/app-*.yaml
- apps/**/*
- packages/**/*
- .npmrc
- package.json
- pnpm-workspace.yaml
- turbo.json

catalog:
- .github/filter.yaml
- .github/workflows/catalog-*.yaml
- apps/catalog/**/*
- apps/website/**/*
- packages/**/*
- .npmrc
- package.json
- pnpm-workspace.yaml
- turbo.json

db:
- .github/filter.yaml
- .github/workflows/db-*.yaml
- apps/api/src/infra/drizzle/schema/**/*.ts

graphql:
- .github/filter.yaml
- .github/workflows/graphql-*.yaml
- apps/api/**/*
- packages/**/*
- .npmrc
- package.json
- pnpm-workspace.yaml
- turbo.json

website:
- .github/filter.yaml
- .github/workflows/website-*.yaml
- apps/website/**/*
- packages/**/*
- .npmrc
- package.json
- pnpm-workspace.yaml
- turbo.json
234 changes: 234 additions & 0 deletions .github/workflows/app-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
name: app test

on: push

env:
DATABASE_URL: postgresql://postgres:postgres@localhost:54322/postgres
NEXT_PUBLIC_GRAPHQL_ENDPOINT: ${{ secrets.NEXT_PUBLIC_GRAPHQL_ENDPOINT }}
NEXT_PUBLIC_WS_ENDPOINT: ${{ secrets.NEXT_PUBLIC_WS_ENDPOINT }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

jobs:
filter:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
app: ${{ steps.changes.outputs.app }}
steps:
- name: checkout
uses: actions/checkout@v4

- name: check for file changes
uses: dorny/paths-filter@v2
id: changes
with:
token: ${{ github.token }}
filters: .github/filter.yaml

install:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.app == 'true'
outputs:
STORE_PATH: ${{ steps.pnpm-env.outputs.STORE_PATH }}
steps:
- name: checkout
uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v3
with:
node-version-file: "package.json"

- name: setup pnpm
uses: pnpm/action-setup@v2
with:
run_install: false

- name: setup pnpm environment variable
id: pnpm-env
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: cache pnpm dependencies
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-env.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-dependencies-

- name: install dependencies
run: pnpm install --frozen-lockfile

format:
runs-on: ubuntu-latest
needs: install
steps:
- name: checkout
uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v3
with:
node-version-file: "package.json"

- name: setup pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
run_install: false

- name: restore pnpm dependencies
uses: actions/cache/restore@v3
with:
path: ${{ needs.install.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-dependencies-

- name: install dependencies
run: pnpm install --frozen-lockfile

- name: format
run: pnpm turbo run fmt

lint:
runs-on: ubuntu-latest
needs: install
steps:
- name: checkout
uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v3
with:
node-version-file: "package.json"

- name: setup pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
run_install: false

- name: restore pnpm dependencies
uses: actions/cache/restore@v3
with:
path: ${{ needs.install.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-dependencies-

- name: install
run: pnpm install --frozen-lockfile

- name: lint
run: pnpm turbo run lint -- --max-warnings=0

style-lint:
runs-on: ubuntu-latest
needs: install
steps:
- name: checkout
uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v3
with:
node-version-file: "package.json"

- name: setup pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
run_install: false

- name: restore pnpm dependencies
uses: actions/cache/restore@v3
with:
path: ${{ needs.install.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-dependencies-

- name: install dependencies
run: pnpm install --frozen-lockfile

- name: lint styles
run: pnpm turbo run style -- --max-warnings=0

build:
runs-on: ubuntu-latest
needs: install
steps:
- name: checkout
uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v3
with:
node-version-file: "package.json"

- name: setup pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
run_install: false

- name: restore pnpm dependencies
uses: actions/cache/restore@v3
with:
path: ${{ needs.install.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-dependencies-

- name: install dependencies
run: pnpm install --frozen-lockfile

- name: build
run: pnpm turbo run build

test:
runs-on: ubuntu-latest
needs: [install, build]
steps:
- name: checkout
uses: actions/checkout@v4

- name: setup supabase cli
uses: supabase/setup-cli@v1
with:
version: latest

- name: setup node
uses: actions/setup-node@v3
with:
node-version-file: "package.json"

- name: setup pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
run_install: false

- name: restore pnpm dependencies
uses: actions/cache/restore@v3
with:
path: ${{ needs.install.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-dependencies-

- name: install dependencies
run: pnpm install --frozen-lockfile

- name: authenticate to supabase
run: pnpm supabase link --project-ref ${{ secrets.SUPABASE_REFERENCE_ID }} --password ${{ secrets.SUPABASE_DATABASE_PASSWORD }}

- name: test
run: pnpm turbo run test

app-test-check:
runs-on: ubuntu-latest
needs: [format, lint, style-lint, build, test]
if: ${{ ! failure() }}
steps:
- name: check
run: echo "test is successfully executed."
Loading

0 comments on commit ef23e3d

Please sign in to comment.