Skip to content

Commit

Permalink
Merge pull request #217 from RL-IDLE/rec
Browse files Browse the repository at this point in the history
Rec
  • Loading branch information
rharkor authored Nov 7, 2023
2 parents 81cd043 + f1a4a7a commit 2c01485
Show file tree
Hide file tree
Showing 293 changed files with 12,864 additions and 1,021 deletions.
66 changes: 33 additions & 33 deletions .devcontainer/.p10k.zsh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated by Powerlevel10k configuration wizard on 2023-09-13 at 13:25 UTC.
# Generated by Powerlevel10k configuration wizard on 2023-10-17 at 12:07 UTC.
# Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 48479.
# Wizard options: awesome-patched + powerline, large icons, classic, unicode, light,
# 12h time, angled separators, sharp heads, sharp tails, 2 lines, solid, no frame,
# compact, many icons, concise, transient_prompt, instant_prompt=verbose.
# Wizard options: nerdfont-complete + powerline, small icons, classic, unicode, light,
# 24h time, round separators, round heads, sharp tails, 2 lines, disconnected,
# left frame, sparse, many icons, fluent, transient_prompt, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate
Expand Down Expand Up @@ -37,7 +37,7 @@
vcs # git status
# =========================[ Line #2 ]=========================
newline # \n
prompt_char # prompt symbol
# prompt_char # prompt symbol
)

# The list of segments shown on the right. Fill it with less important segments.
Expand Down Expand Up @@ -95,7 +95,7 @@
midnight_commander # midnight commander shell (https://midnight-commander.org/)
nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
chezmoi_shell # chezmoi shell (https://www.chezmoi.io/)
# vi_mode # vi mode (you don't need this if you've enabled prompt_char)
vi_mode # vi mode (you don't need this if you've enabled prompt_char)
# vpn_ip # virtual private network indicator
# load # CPU load
# disk_usage # disk usage
Expand All @@ -118,10 +118,10 @@
)

# Defines character set used by powerlevel10k. It's best to let `p10k configure` set it for you.
typeset -g POWERLEVEL9K_MODE=awesome-patched
typeset -g POWERLEVEL9K_MODE=nerdfont-complete
# When set to `moderate`, some icons will have an extra space after them. This is meant to avoid
# icon overlap when using non-monospace fonts. When set to `none`, spaces are not added.
typeset -g POWERLEVEL9K_ICON_PADDING=moderate
typeset -g POWERLEVEL9K_ICON_PADDING=none

# When set to true, icons appear before content on both sides of the prompt. When set
# to false, icons go after content. If empty or not set, icons go before content in the left
Expand All @@ -137,13 +137,13 @@
typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=

# Add an empty line before each prompt.
typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false
typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=true

# Connect left prompt lines with these symbols. You'll probably want to use the same color
# as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below.
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX=
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX=
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%242F╭─'
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%242F├─'
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%242F╰─'
# Connect right prompt lines with these symbols.
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX=
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX=
Expand All @@ -153,7 +153,7 @@
# '─'. The last two make it easier to see the alignment between left and right prompt and to
# separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false
# for more compact prompt if using this option.
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=''
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' '
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND=
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND=
if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then
Expand All @@ -170,20 +170,20 @@
typeset -g POWERLEVEL9K_BACKGROUND=238

# Separator between same-color segments on the left.
typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='%246F\uE0B1'
typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='%246F\uE0B5'
# Separator between same-color segments on the right.
typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='%246F\uE0B3'
typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='%246F\uE0B7'
# Separator between different-color segments on the left.
typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0'
typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B4'
# Separator between different-color segments on the right.
typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2'
typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B6'
# To remove a separator between two segments, add "_joined" to the second segment name.
# For example: POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(os_icon context_joined)

# The right end of left prompt.
typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0'
typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B4'
# The left end of right prompt.
typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2'
typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B6'
# The left end of left prompt.
typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2'
# The right end of right prompt.
Expand Down Expand Up @@ -356,7 +356,7 @@

#####################################[ vcs: git status ]######################################
# Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon.
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uE220 '
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 '

# Untracked files icon. It's really a question mark, your font isn't broken.
# Change the value of this parameter to show a different icon.
Expand Down Expand Up @@ -504,7 +504,7 @@
# Custom icon.
# typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Custom prefix.
# typeset -g POWERLEVEL9K_VCS_PREFIX='%248Fon '
typeset -g POWERLEVEL9K_VCS_PREFIX='%248Fon '

# Show status of repositories of these types. You can add svn and/or hg if you are
# using them. If you do, your prompt may become slow even when your current directory
Expand All @@ -524,7 +524,7 @@

# Status on success. No content, just an icon. No need to show it if prompt_char is enabled as
# it will signify success by turning green.
typeset -g POWERLEVEL9K_STATUS_OK=false
typeset -g POWERLEVEL9K_STATUS_OK=true
typeset -g POWERLEVEL9K_STATUS_OK_FOREGROUND=70
typeset -g POWERLEVEL9K_STATUS_OK_VISUAL_IDENTIFIER_EXPANSION=''

Expand All @@ -536,7 +536,7 @@

# Status when it's just an error code (e.g., '1'). No need to show it if prompt_char is enabled as
# it will signify error by turning red.
typeset -g POWERLEVEL9K_STATUS_ERROR=false
typeset -g POWERLEVEL9K_STATUS_ERROR=true
typeset -g POWERLEVEL9K_STATUS_ERROR_FOREGROUND=160
typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION=''

Expand Down Expand Up @@ -565,7 +565,7 @@
# Custom icon.
# typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Custom prefix.
# typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%248Ftook '
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%248Ftook '

#######################[ background_jobs: presence of background jobs ]#######################
# Don't show the number of background jobs.
Expand Down Expand Up @@ -941,7 +941,7 @@
# Custom icon.
# typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Custom prefix.
# typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%248Fwith '
typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%248Fwith '

###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]###
# Python virtual environment color.
Expand All @@ -954,7 +954,7 @@
# Separate environment name from Python version only with a space.
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
# Custom icon.
typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION='🐍'
# typeset -g POWERLEVEL9K_VIRTUALENV_VISUAL_IDENTIFIER_EXPANSION=''

#####################[ anaconda: conda environment (https://conda.io/) ]######################
# Anaconda environment color.
Expand Down Expand Up @@ -987,7 +987,7 @@
typeset -g POWERLEVEL9K_ANACONDA_CONTENT_EXPANSION='${${${${CONDA_PROMPT_MODIFIER#\(}% }%\)}:-${CONDA_PREFIX:t}}'

# Custom icon.
typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION='🐍'
# typeset -g POWERLEVEL9K_ANACONDA_VISUAL_IDENTIFIER_EXPANSION=''

################[ pyenv: python environment (https://github.com/pyenv/pyenv) ]################
# Pyenv color.
Expand All @@ -1013,7 +1013,7 @@
typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_CONTENT:#$P9K_PYENV_PYTHON_VERSION(|/*)}:+ $P9K_PYENV_PYTHON_VERSION}'

# Custom icon.
typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='🐍'
# typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION=''

################[ goenv: go environment (https://github.com/syndbg/goenv) ]################
# Goenv color.
Expand Down Expand Up @@ -1372,7 +1372,7 @@
POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}'

# Custom prefix.
# typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%248Fat '
typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%248Fat '

#[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]#
# Show aws only when the command you are typing invokes one of these tools.
Expand Down Expand Up @@ -1562,7 +1562,7 @@
# Custom icon.
# typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Custom prefix.
# typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%248Fin '
typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%248Fin '

###############################[ public_ip: public IP address ]###############################
# Public IP color.
Expand Down Expand Up @@ -1623,7 +1623,7 @@
# Show battery in yellow when it's discharging.
typeset -g POWERLEVEL9K_BATTERY_DISCONNECTED_FOREGROUND=178
# Battery pictograms going from low to high level of charge.
typeset -g POWERLEVEL9K_BATTERY_STAGES=('%K{232}▁' '%K{232}▂' '%K{232}▃' '%K{232}▄' '%K{232}▅' '%K{232}▆' '%K{232}▇' '%K{232}█')
typeset -g POWERLEVEL9K_BATTERY_STAGES='\uf58d\uf579\uf57a\uf57b\uf57c\uf57d\uf57e\uf57f\uf580\uf581\uf578'
# Don't show the remaining time to charge/discharge.
typeset -g POWERLEVEL9K_BATTERY_VERBOSE=false

Expand Down Expand Up @@ -1657,15 +1657,15 @@
# Current time color.
typeset -g POWERLEVEL9K_TIME_FOREGROUND=66
# Format for the current time: 09:51:02. See `man 3 strftime`.
typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%I:%M:%S %p}'
typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}'
# If set to true, time will update when you hit enter. This way prompts for the past
# commands will contain the start times of their commands as opposed to the default
# behavior where they contain the end times of their preceding commands.
typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false
# Custom icon.
# typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Custom prefix.
# typeset -g POWERLEVEL9K_TIME_PREFIX='%248Fat '
typeset -g POWERLEVEL9K_TIME_PREFIX='%248Fat '

# Example of a user-defined prompt segment. Function prompt_example will be called on every
# prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or
Expand Down
13 changes: 7 additions & 6 deletions .devcontainer/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ ZSH_THEME="powerlevel10k/powerlevel10k"
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
plugins=(git zsh-autosuggestions)

source $ZSH/oh-my-zsh.sh

Expand Down Expand Up @@ -108,11 +108,12 @@ source $ZSH/oh-my-zsh.sh
# alias ohmyzsh="mate ~/.oh-my-zsh"
DISABLE_AUTO_UPDATE=true
DISABLE_UPDATE_PROMPT=true
ZSH_THEME="powerlevel10k/powerlevel10k"

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true
source /home/node/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH=$BUN_INSTALL/bin:$PATH
export PATH=$BUN_INSTALL/bin:$PATH

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
16 changes: 9 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "next-boilerplate",
"name": "rl-idle",

// Update the 'dockerComposeFile' list if you have more compose files or use different names.
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
Expand All @@ -19,10 +19,7 @@

"portsAttributes": {
"3000": {
"label": "backend"
},
"3001": {
"label": "web"
"label": "nextjs"
},
"5432": {
"label": "postgres"
Expand All @@ -36,27 +33,32 @@
},

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "./scripts/install-zsh10k.sh && ./scripts/install-bun.sh && ./scripts/git-hooks.sh && npm install",
"postCreateCommand": "bash ./scripts/install/install.sh",

// Configure tool-specific properties.
"customizations": {
"postCreateCommand": "./scripts/install-zsh10k.sh && ./scripts/install-bun.sh && ./scripts/git-hooks.sh && npm install",
"postCreateCommand": "bash ./scripts/install/install.sh",
"vscode": {
"extensions": [
"formulahendry.auto-rename-tag",
"aaron-bond.better-comments",
"WallabyJs.console-ninja",
"EditorConfig.EditorConfig",
"dsznajder.es7-react-js-snippets",
"dbaeumer.vscode-eslint",
"tombonnike.vscode-status-bar-format-toggle",
"github.vscode-github-actions",
"GitHub.copilot",
"GitHub.copilot-chat",
"GitHub.copilot-labs",
"eamodio.gitlens",
"ecmel.vscode-html-css",
"Zignd.html-css-class-completion",
"yzhang.markdown-all-in-one",
"esbenp.prettier-vscode",
"rvest.vs-code-prettier-eslint",
"Prisma.prisma",
"bradlc.vscode-tailwindcss",
"donjayamanne.githistory",
"ms-azuretools.vscode-docker",
"ftonato.password-generator",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: "npm"
Expand All @@ -48,7 +48,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: "npm"
Expand Down
23 changes: 16 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: |
BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
GENV=$([[ $BRANCH == 'main' ]] && echo 'production' || echo 'unknown')
GENV=$([[ $BRANCH == 'rec' ]] && $GENV='unknown' && echo 'rec' || echo $GENV)
GENV=$([[ $BRANCH == 'rec' ]] && [[ $GENV == 'unknown' ]] && echo 'stagging' || echo $GENV)
echo "env=$GENV" >> $GITHUB_OUTPUT
echo "env=$GENV"
id: extract-env
Expand All @@ -56,21 +56,30 @@ jobs:
working-directory: ./backend
run: |
touch .env
echo ENV=production >> .env
echo ENV=${{ steps.extract-env.outputs.env }} >> .env
echo DATABASE_URL="postgresql://${{ vars.DATABASE_USER }}:${{ secrets.DATABASE_PASS }}@db:5432/${{ vars.DATABASE_NAME }}?schema=public" >> .env
echo REDIS_HOST=localhost >> .env
echo DATABASE_KIND=postgres >> .env
echo DATABASE_HOST=db >> .env
echo DATABASE_PORT=5432 >> .env
echo DATABASE_NAME=${{ vars.DATABASE_NAME }} >> .env
echo DATABASE_USER=${{ vars.DATABASE_USER }} >> .env
echo DATABASE_PASS=${{ secrets.DATABASE_PASS }} >> .env
echo REDIS_HOST=redis >> .env
echo REDIS_USERNAME= >> .env
echo REDIS_PASSWORD=${{ secrets.REDIS_PASSWORD }} >> .env
echo REDIS_PORT=6379 >> .env
echo REDIS_URL=redis://redis:6379 >> .env
echo REDIS_USE_TLS=false >> .env
echo BASE_URL=${{ vars.BASE_URL }} >> .env
echo PASSWORD_HASHER_SECRET=${{ secrets.PASSWORD_HASHER_SECRET }} >> .env
echo STRIPE_SECRET_KEY=${{ secrets.STRIPE_SECRET_KEY }} >> .env
- name: Create frontend env
working-directory: frontend
run: |
touch .env
echo VITE_ENV=production >> .env
echo VITE_API_URL=http://api:3000 >> .env
echo VITE_ENV=${{ steps.extract-env.outputs.env }} >> .env
echo VITE_API_URL=${{ vars.BASE_URL }} >> .env
echo VITE_STRIPE_PUBLIC_KEY=${{ secrets.STRIPE_PUBLIC_KEY }} >> .env
- name: Login to docker
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -103,7 +112,7 @@ jobs:
scp -P ${{ vars.SSH_PORT }} docker/docker-compose.${{ steps.extract-env.outputs.env }}.yml ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ secrets.SOURCE_PATH }}/docker-compose.yml
scp -P ${{ vars.SSH_PORT }} .env ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ secrets.SOURCE_PATH }}/.env
- name: Deploy to production
- name: Deploy to ${{ steps.extract-env.outputs.env }}
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.MYBOT_APP_ID }}
private_key: ${{ secrets.MYBOT_PRIVATE_KEY }}
Expand All @@ -30,7 +30,7 @@ jobs:
fetch-depth: 0
token: ${{ steps.generate_token.outputs.token }}
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install dependencies
Expand Down
Loading

0 comments on commit 2c01485

Please sign in to comment.