Skip to content

Commit

Permalink
refactor: Moved items of backend folder to root (#65)
Browse files Browse the repository at this point in the history
* refactored backend folder

* fixed tests

* fixed tests
  • Loading branch information
rajdip-b authored Apr 22, 2024
1 parent 426d1ea commit 2233f65
Show file tree
Hide file tree
Showing 82 changed files with 121 additions and 270 deletions.
File renamed without changes.
File renamed without changes.
10 changes: 1 addition & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ on:
- '!main'
- '!develop'
- '*'
paths: ['apps/api/**']
pull_request:
paths: ['apps/api/**']

jobs:
lint:
Expand All @@ -22,10 +20,8 @@ jobs:
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
working-directory: ./backend
run: pnpm install
- name: Run Prettier (Pre-commit or in workflow)
working-directory: ./backend
- name: Run ESLint
run: pnpm lint

test:
Expand All @@ -39,14 +35,10 @@ jobs:
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
working-directory: ./backend
run: pnpm install
- name: Run ESLint
working-directory: ./backend
run: pnpm lint
- name: Run unit tests
working-directory: ./backend
run: pnpm run test:unit
- name: Run e2e tests
working-directory: ./backend
run: pnpm run test:e2e
15 changes: 10 additions & 5 deletions .github/workflows/prod-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ on:
push:
branches:
- main
paths: ['backend/**', '.github/workflows/prod-backend.yml']
paths:
[
'src/**',
'.github/workflows/prod-backend.yml',
'Dockerfile',
'package.json',
'fly.backend.toml',
]

env:
DATABASE_URL: ${{ secrets.DB_PROD_URL }}
Expand All @@ -22,15 +29,13 @@ jobs:
- name: Install pnpm
run: npm install -g pnpm
- name: pnpm install
working-directory: ./backend
run: pnpm install
- name: Deploy migrations
working-directory: ./backend
run: pnpm db:deploy-migrations
- name: Deploy to prod
run: |
~/.fly/bin/fly deploy \
--config fly.backend.toml \
--dockerfile ./backend/Dockerfile \
--dockerfile Dockerfile \
--app culero-stage-api \
--access-token ${{ secrets.FLY_ACCESS_TOKEN }}
--access-token ${{ secrets.FLY_ACCESS_TOKEN }}
13 changes: 9 additions & 4 deletions .github/workflows/stage-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ on:
push:
branches:
- develop
paths: ['backend/**', '.github/workflows/stage-backend.yml']
paths:
[
'src/**',
'.github/workflows/prod-backend.yml',
'Dockerfile',
'package.json',
'fly.backend.toml',
]

env:
DATABASE_URL: ${{ secrets.DB_STAGE_URL }}
Expand All @@ -22,15 +29,13 @@ jobs:
- name: Install pnpm
run: npm install -g pnpm
- name: pnpm install
working-directory: ./backend
run: pnpm install
- name: Deploy migrations
working-directory: ./backend
run: pnpm db:deploy-migrations
- name: Deploy to stage
run: |
~/.fly/bin/fly deploy \
--config fly.backend.toml \
--dockerfile ./backend/Dockerfile \
--dockerfile Dockerfile \
--app culero-stage-api \
--access-token ${{ secrets.FLY_ACCESS_TOKEN }}
177 changes: 28 additions & 149 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,163 +1,42 @@
# ---- macOS ----
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# compiled output
/dist
/node_modules

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# ---- Node ----
# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz
# OS
.DS_Store

# Yarn Integrity file
.yarn-integrity
# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# dotenv environment variable files
.env
.env.stage
.env.prod
.env.stage

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

.vscode/
.idea/

**/coverage-e2e/
data/
coverage-e2e/
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions backend/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ WORKDIR /app

RUN npm i -g pnpm

COPY backend/package.json .
COPY backend/tsconfig.json .
COPY package.json .
COPY tsconfig.json .

RUN pnpm install

COPY backend .
COPY . .

RUN pnpm db:generate-types
RUN pnpm build
Expand Down
16 changes: 0 additions & 16 deletions Makefile

This file was deleted.

File renamed without changes.
39 changes: 0 additions & 39 deletions backend/.gitignore

This file was deleted.

Loading

0 comments on commit 2233f65

Please sign in to comment.