Skip to content

Commit

Permalink
migrate website to app dir #96
Browse files Browse the repository at this point in the history
  • Loading branch information
djobbo committed Oct 12, 2023
1 parent b5270bd commit 29adb2a
Show file tree
Hide file tree
Showing 190 changed files with 10,867 additions and 5,023 deletions.
19 changes: 0 additions & 19 deletions .devcontainer/.zshrc

This file was deleted.

28 changes: 4 additions & 24 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,14 @@
FROM node:18

RUN userdel -r node

ARG USERNAME=corehalla
ARG USER_UID=1001
ARG USER_GID=$USER_UID

# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
#
&& apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

RUN apt-get update
RUN apt-get install -y \
curl \
zsh

# set home
ENV HOME /home/$USERNAME
ENV WORKSPACE_PATH $HOME/workspace
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

ENV SHELL /bin/zsh

# Install Oh-My-Zsh
RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true

USER $USERNAME
RUN npm install -g pnpm

ENV NODE_ENV development

RUN git config --global --add safe.directory /workspace
55 changes: 0 additions & 55 deletions .devcontainer/corehalla.zsh-theme

This file was deleted.

58 changes: 28 additions & 30 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
{
"name": "Corehalla",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
"mounts": [
"source=${localWorkspaceFolder},target=/home/corehalla/workspace,type=bind",
"source=${localWorkspaceFolder}/.devcontainer/.zshrc,target=/home/corehalla/.zshrc,type=bind",
"source=${localWorkspaceFolder}/.devcontainer/corehalla.zsh-theme,target=/home/corehalla/.oh-my-zsh/custom/themes/corehalla.zsh-theme,type=bind"
"source=${localWorkspaceFolder},target=/workspace,type=bind",
"source=${localWorkspaceFolder}/.devcontainer/zsh/.zshrc,target=/root/.zshrc,type=bind",
"source=${localWorkspaceFolder}/.devcontainer/zsh/devcontainer.zsh-theme,target=/root/.oh-my-zsh/custom/themes/devcontainer.zsh-theme,type=bind"
],
"workspaceFolder": "/home/corehalla/workspace",
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/bin/zsh"
}
}
},

"customizations": {
"vscode": {
"extensions": [
Expand All @@ -25,28 +14,37 @@
"Prisma.prisma",
"eamodio.gitlens",
"mhutchie.git-graph",
"GitHub.vscode-pull-request-github"
]
"GitHub.vscode-pull-request-github",
"ms-azuretools.vscode-docker",
"usernamehw.errorlens"
],
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/bin/zsh"
}
}
}
}
},

"forwardPorts": [3000, 3001, 3002],

"dockerComposeFile": "docker-compose.yml",
"service": "app",
"forwardPorts": [
3000,
3001,
3002
],
"portsAttributes": {
"3000": {
"label": "Corehalla Web",
"onAutoForward": "notify"
"label": "Corehalla Web"
},
"3001": {
"label": "Supabase Studio",
"onAutoForward": "notify"
"label": "Supabase Studio"
},
"3002": {
"label": "Corehalla Worker",
"onAutoForward": "notify"
"label": "Corehalla Worker"
}
},
"postCreateCommand": "sudo curl -fsSL https://get.pnpm.io/install.sh | sh - && pnpm ci:install && pnpm setup:env",
"containerUser": "corehalla",
"remoteUser": "corehalla"
}
"postStartCommand": "pnpm ci:install && pnpm setup:env"
}
7 changes: 7 additions & 0 deletions .devcontainer/zsh/.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ZSH_THEME="devcontainer"

plugins=(git)

source $HOME/.oh-my-zsh/oh-my-zsh.sh

cd /workspace
26 changes: 26 additions & 0 deletions .devcontainer/zsh/devcontainer.zsh-theme
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
local LC_ALL="" LC_CTYPE="en_US.UTF-8"
autoload -U colors && colors

prompt_git() {
setopt prompt_subst
autoload -Uz vcs_info

zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:git:*' check-for-changes true
zstyle ':vcs_info:git:*' stagedstr "%{$fg_bold[green]%}!%{$reset_color%}"
zstyle ':vcs_info:git:*' unstagedstr "%{$fg_bold[yellow]%}?%{$reset_color%}"
zstyle ':vcs_info:*' formats " › %b%c%u"
zstyle ':vcs_info:*' actionformats " › %b%c%u %{$fg_bold[red]%}[%a]%{$reset_color%}"
vcs_info

echo -n ${vcs_info_msg_0_}$reset
}

build_prompt() {
echo -n "%{$fg[gray]%}corehalla%{$reset_color%}%{$fg[blue]%}%~%{$reset_color%}"
prompt_git
echo
echo "🚀 › "
}

export PROMPT='$(build_prompt)'
56 changes: 56 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module.exports = {
root: true,
extends: [
"next/core-web-vitals",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jsx-a11y/strict",
],
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
"jsx-a11y",
"sort-imports-es6-autofix",
"prettier",
],
settings: {
next: {
rootDir: ["app/", "packages/*/"],
},
},
rules: {
"no-console": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"prettier/prettier": "error",
"no-var": "error",
"sort-imports-es6-autofix/sort-imports-es6": [
"error",
{
ignoreCase: false,
ignoreMemberSort: false,
memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
},
],
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
fixStyle: "inline-type-imports",
},
],
"object-shorthand": [
2,
"always",
{
avoidExplicitReturnArrows: true,
},
],
},
}
45 changes: 0 additions & 45 deletions .eslintrc.yml

This file was deleted.

38 changes: 38 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

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

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# pnpm
.pnpm-store
6 changes: 6 additions & 0 deletions app/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"printWidth": 80,
"tabWidth": 4,
"trailingComma": "all"
}
Loading

0 comments on commit 29adb2a

Please sign in to comment.