-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Next and Nestjs apps, upgrade libs (#6)
* apps folder * turborepo initial setup * fix missing turbo scripts * fix fastify server build * minor fix * github actions changes * add Dockerfiles * minor changes * updated packages * build frontend success * build images success * wip * wip * prod grade dockerfiles * upgrade root pkgs * upgrade frontend packages wip ts-eslint in nest pkg.json issue fix frontend build issue add nextjs app * update corelib pkgs * react pkg setup done * upgrade next-client pkgs * next-client config wip * add latest nestjs * eslint wip * eslint and prettier setup * config lint-staged * add nestjs and express server * next-client runs sorta * upgrade root pkgs * express-server pkg update npm pkgs to latest * update frontend pkg npm modules * update nestjs-server pkg npm modules * next-client done
- Loading branch information
1 parent
79074d0
commit 825eb90
Showing
122 changed files
with
7,308 additions
and
4,651 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
node_modules | ||
dist | ||
build | ||
coverage | ||
.next | ||
.turbo | ||
.eslintrc.js | ||
*.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
name: ci | ||
# name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
# on: | ||
# push: | ||
# branches: | ||
# - 'main' | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
# jobs: | ||
# docker: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Check out code | ||
# uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
# - name: Set up QEMU | ||
# uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
# - name: Set up Docker Buildx | ||
# uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Get current date | ||
id: date | ||
run: echo "::set-output name=date::$(date +'%Y_%m_%d_%H_%m')" | ||
# - name: Get current date | ||
# id: date | ||
# run: echo "::set-output name=date::$(date +'%Y_%m_%d_%H_%m')" | ||
|
||
- name: Build Server Image | ||
run: docker build -f ./apps/fastify-server/Dockerfile -t ${{secrets.DOCKER_HUB_USERNAME}}/rnm-server:${{ steps.date.outputs.date }} . | ||
# - name: Build Server Image | ||
# run: docker build -f ./apps/fastify-server/Dockerfile -t ${{secrets.DOCKER_HUB_USERNAME}}/rnm-server:${{ steps.date.outputs.date }} . | ||
|
||
- name: Build Frontend Image | ||
run: docker build -f ./apps/frontend/Dockerfile -t ${{ secrets.DOCKER_HUB_USERNAME }}/rnm-frontend:${{ steps.date.outputs.date }} . | ||
# - name: Build Frontend Image | ||
# run: docker build -f ./apps/frontend/Dockerfile -t ${{ secrets.DOCKER_HUB_USERNAME }}/rnm-frontend:${{ steps.date.outputs.date }} . | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
# - name: Login to DockerHub | ||
# uses: docker/login-action@v2 | ||
# with: | ||
# username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
# password: ${{ secrets.DOCKER_HUB_PASSWORD }} | ||
|
||
- name: Push Backend Image to Docker Hub | ||
run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/rnm-server:${{ steps.date.outputs.date }} | ||
# - name: Push Backend Image to Docker Hub | ||
# run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/rnm-server:${{ steps.date.outputs.date }} | ||
|
||
- name: Push Frontend Image to Docker Hub | ||
run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/rnm-frontend:${{ steps.date.outputs.date }} | ||
# - name: Push Frontend Image to Docker Hub | ||
# run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/rnm-frontend:${{ steps.date.outputs.date }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
name: github-actions | ||
# name: github-actions | ||
|
||
on: [push] | ||
# on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
# jobs: | ||
# build: | ||
# runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.15.0] | ||
os: [ubuntu-latest, macos-latest] | ||
# strategy: | ||
# matrix: | ||
# node-version: [20.10.0] | ||
# os: [ubuntu-latest] | ||
|
||
steps: | ||
- name: Git Checkout | ||
uses: actions/checkout@v2 | ||
# steps: | ||
# - name: Git Checkout | ||
# uses: actions/checkout@v4 | ||
|
||
- name: Setup Node env | ||
uses: actions/setup-node@v2.1.4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'yarn' | ||
# - name: Setup Node env | ||
# uses: actions/setup-node@v3 | ||
# with: | ||
# node-version: ${{ matrix.node-version }} | ||
# cache: 'yarn' | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
# - name: Install dependencies | ||
# run: yarn | ||
|
||
- name: Build @core/lib | ||
run: yarn build:lib | ||
# - name: Build @core/lib | ||
# run: yarn lib:build | ||
|
||
- name: Build frontend | ||
run: yarn frontend:build | ||
# - name: Build frontend | ||
# run: yarn frontend:build | ||
|
||
- name: Build fastify-server | ||
run: yarn fastify-server:build | ||
# - name: Build fastify-server | ||
# run: yarn fastify-server:build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,44 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
# folders | ||
node_modules | ||
.pnp | ||
.pnp.js | ||
.turbo | ||
.next | ||
.vercel | ||
logs | ||
|
||
# production | ||
build | ||
dist | ||
*.tsbuildinfo | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
apps/**/build | ||
apps/**/dist | ||
**.tsbuildinfo | ||
/.nyc_output | ||
|
||
# misc | ||
.DS_Store | ||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env.* | ||
*.log | ||
.pnp.js | ||
*.pem | ||
next-env.d.ts | ||
|
||
# IDEs and editors | ||
/.idea | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
# IDE - VSCode | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx lint-staged | ||
npx lint-staged | ||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,46 @@ | ||
# folders | ||
node_modules | ||
public | ||
build | ||
dist | ||
.next | ||
.vercel | ||
|
||
src/assets/images | ||
src/assets/icons | ||
|
||
.env | ||
.env.prod | ||
.env.testing | ||
# config-files | ||
nest-cli.json | ||
package.json | ||
package-lock.json | ||
test/jest-e2e.json | ||
tsconfig.json | ||
tsconfig.build.json | ||
turbo.json | ||
yarn.lock | ||
|
||
.eslintrc.json | ||
.eslintrc | ||
.eslintrc.* | ||
.eslintcache | ||
|
||
.gitignore | ||
.prettierignore | ||
.prettierrc | ||
.prettierrc.* | ||
.tsbuildinfo | ||
|
||
yarn.lock | ||
yarn-error.log | ||
# static asset files | ||
*.jpg | ||
*.jpeg | ||
*.png | ||
*.svg | ||
*.otf | ||
*.ttf | ||
*.woff | ||
|
||
README.md | ||
# custom files | ||
*.js | ||
*.jsx | ||
*.ts | ||
*.tsx | ||
*.md | ||
*.log | ||
*.d.ts | ||
*.yml | ||
*.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
{ | ||
"printWidth": 80, | ||
"singleQuote": true, | ||
"useTabs": true, | ||
"tabWidth": 4, | ||
"semi": true, | ||
"bracketSpacing": true | ||
} | ||
"arrowParens": "avoid", | ||
"bracketSameLine": false, | ||
"bracketSpacing": true, | ||
"endOfLine": "lf", | ||
"htmlWhitespaceSensitivity": "css", | ||
"printWidth": 80, | ||
"semi": true, | ||
"singleAttributePerLine": false, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "es5", | ||
"useTabs": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: ['@nish1896'] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Base Image | ||
FROM node:20-alpine3.18 as phase1 | ||
|
||
WORKDIR /app | ||
|
||
# Run yarn only if package.json changes | ||
# copied tsconfig as shared-ui's tsconfig extends rootDir's tsconfig | ||
COPY turbo.json . | ||
COPY tsconfig.json . | ||
COPY package.json . | ||
|
||
# first create these directories, else the copying won't work. | ||
RUN mkdir -p packages/shared | ||
RUN mkdir -p apps/server | ||
|
||
# copying only the required packages | ||
COPY ./packages/shared/package.json packages/shared | ||
COPY ./packages/shared packages/shared | ||
|
||
COPY ./apps/server/package.json apps/server | ||
COPY ./apps/server apps/server | ||
|
||
# install node_modules | ||
RUN yarn | ||
RUN yarn build:lib | ||
|
||
# build server | ||
RUN yarn build-apps | ||
|
||
# run server in dev env | ||
CMD ["yarn", "workspace ecom-mern-server", "build:run"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# express-server | ||
|
||
Express JS Application with Typescript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "express-server", | ||
"author": "Nishant Kohli", | ||
"version": "1.0.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "nodemon -r tsconfig-paths/register src/index.ts", | ||
"build": "rimraf dist & tsc", | ||
"build:run": "ts-node dist/index.js", | ||
"lint": "eslint --fix ." | ||
}, | ||
"dependencies": { | ||
"cors": "^2.8.5", | ||
"express": "^4.18.2", | ||
"winston": "3.11.0" | ||
}, | ||
"devDependencies": { | ||
"@types/cors": "^2.8.17", | ||
"@types/express": "^4.17.21", | ||
"@types/node": "^20.11.17", | ||
"eslint": "^8.56.0", | ||
"nodemon": "^3.0.3", | ||
"rimraf": "^5.0.5", | ||
"ts-node": "^10.9.2", | ||
"tsconfig-paths": "^4.2.0", | ||
"typescript": "^5.3.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Define all environment variables in this file and then | ||
* export across other modules. | ||
*/ | ||
|
||
const env = process.env; | ||
|
||
export const ENV_VARS = Object.freeze({ | ||
port: env.port ?? 5000, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './env_vars'; |
Oops, something went wrong.