From 1347e6d97599c890e296bd2ea1ddb99efdebb81e Mon Sep 17 00:00:00 2001 From: Nishant Date: Sun, 7 Jul 2024 14:06:16 +0530 Subject: [PATCH] update readme & dockerfiles --- README.md | 2 +- apps/express-server/Dockerfile | 2 +- apps/express-server/README.md | 14 +++++++---- apps/express-server/package.json | 2 +- apps/nestjs-server/Dockerfile | 2 +- apps/nestjs-server/README.md | 9 +++++-- apps/nestjs-server/package.json | 2 +- apps/next-client/Dockerfile | 2 +- apps/next-client/README.md | 40 ++++---------------------------- apps/next-client/package.json | 5 ++-- apps/react-client/Dockerfile | 2 +- apps/react-client/package.json | 2 +- turbo.json | 2 +- 13 files changed, 33 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index f7b41ed..dc2714b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## Features - [Turborepo](https://turborepo.org/) -- [React](https://reactjs.org/) v18, [NestJs](https://nestjs.com/) v14.1, [ExpressJS](https://expressjs.com/), [NestJS](https://nestjs.com/) v10.3 +- [React](https://reactjs.org/), [NestJs](https://nestjs.com/), [ExpressJS](https://expressjs.com/), [NestJS](https://nestjs.com/) - 100% [Typescript](https://www.typescriptlang.org/) - [Prettier](https://prettier.io/) and Eslint setup alongside `pre-commit` hook. - [Mui](https://mui.com/) and [Redux](https://redux.js.org/) preconfigured. diff --git a/apps/express-server/Dockerfile b/apps/express-server/Dockerfile index c9d300d..f652cec 100644 --- a/apps/express-server/Dockerfile +++ b/apps/express-server/Dockerfile @@ -1,5 +1,5 @@ # Base Image -FROM node:20-alpine3.18 as phase1 +FROM node:20-alpine3.18 AS phase1 WORKDIR /app diff --git a/apps/express-server/README.md b/apps/express-server/README.md index 77e5289..c46caa7 100644 --- a/apps/express-server/README.md +++ b/apps/express-server/README.md @@ -6,8 +6,14 @@ Express JS Application with Typescript ```bash # development -$ yarn run dev +$ yarn dev -# production mode -$ yarn run start:prod -``` \ No newline at end of file +# build & run production code +$ yarn prod +``` + +### Features + +- Express app configured +- Preconfigured logger - [winston](https://www.npmjs.com/package/winston) for logging request and errors +- Producion Dockerfile \ No newline at end of file diff --git a/apps/express-server/package.json b/apps/express-server/package.json index 1a9ea45..fd6622f 100644 --- a/apps/express-server/package.json +++ b/apps/express-server/package.json @@ -7,7 +7,7 @@ "dev": "nodemon src/index.ts", "build": "rimraf dist && tsc", "start": "ts-node dist/index.js", - "start:prod": "yarn build && yarn start", + "prod": "yarn build && yarn start", "lint": "eslint --fix ." }, "dependencies": { diff --git a/apps/nestjs-server/Dockerfile b/apps/nestjs-server/Dockerfile index af6b97b..739d447 100644 --- a/apps/nestjs-server/Dockerfile +++ b/apps/nestjs-server/Dockerfile @@ -21,4 +21,4 @@ COPY --chown=node:node ./apps/nestjs-server apps/nestjs-server RUN yarn # run server in prod env -CMD ["yarn", "workspace", "nestjs-server", "start:prod"] +CMD ["yarn", "workspace", "nestjs-server", "prod"] diff --git a/apps/nestjs-server/README.md b/apps/nestjs-server/README.md index 4cf3637..593dc29 100644 --- a/apps/nestjs-server/README.md +++ b/apps/nestjs-server/README.md @@ -8,8 +8,8 @@ # development $ yarn run dev -# production mode -$ yarn run start:prod +# build & run in production mode +$ yarn run prod ``` ## Test @@ -24,3 +24,8 @@ $ yarn run test:e2e # test coverage $ yarn run test:cov ``` + +### Features + +- Routes directory +- Dockerfile \ No newline at end of file diff --git a/apps/nestjs-server/package.json b/apps/nestjs-server/package.json index 4847823..b62e8e1 100644 --- a/apps/nestjs-server/package.json +++ b/apps/nestjs-server/package.json @@ -8,7 +8,7 @@ "dev": "nest start --watch", "start": "NODE_ENV=production node dist/main", "start:debug": "nest start --debug --watch", - "start:prod": "yarn run build && yarn run start", + "prod": "yarn run build && yarn run start", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "test": "jest", "test:watch": "jest --watch", diff --git a/apps/next-client/Dockerfile b/apps/next-client/Dockerfile index 2ab3450..0093596 100644 --- a/apps/next-client/Dockerfile +++ b/apps/next-client/Dockerfile @@ -31,4 +31,4 @@ RUN yarn workspace next-client build # Expose the port Next.js app runs on (default is 3000) EXPOSE 3000 -CMD [ "yarn", "workspace", "next-client", "start:prod" ] \ No newline at end of file +CMD [ "yarn", "workspace", "next-client", "start" ] \ No newline at end of file diff --git a/apps/next-client/README.md b/apps/next-client/README.md index 37d3ca4..300a079 100644 --- a/apps/next-client/README.md +++ b/apps/next-client/README.md @@ -1,38 +1,6 @@ -This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). +# next-client -## Getting Started +### Features -First, run the development server: - -```bash -npm run dev -# or -yarn dev -# or -pnpm dev -# or -bun dev -``` - -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. - -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. - -This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. - -## Learn More - -To learn more about Next.js, take a look at the following resources: - -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! - -## Deploy on Vercel - -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. - -Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. - -Nextjs with Docker [example](https://github.com/vercel/next.js/tree/canary/examples/with-docker) \ No newline at end of file +- Integrated Mui with theme +- Dockerfile \ No newline at end of file diff --git a/apps/next-client/package.json b/apps/next-client/package.json index 3c97972..4b42794 100644 --- a/apps/next-client/package.json +++ b/apps/next-client/package.json @@ -4,9 +4,10 @@ "author": "Nishant Kohli", "private": true, "scripts": { - "dev": "next dev -p 3003", + "dev": "next dev -p 3001", "build": "next build", - "start:prod": "yarn run build && next start", + "start": "next start", + "prod": "yarn run build && yarn run start", "lint": "next lint --fix ." }, "dependencies": { diff --git a/apps/react-client/Dockerfile b/apps/react-client/Dockerfile index eaef47c..1370d7a 100644 --- a/apps/react-client/Dockerfile +++ b/apps/react-client/Dockerfile @@ -1,5 +1,5 @@ # Base Image -FROM node:20-alpine3.18 as phase1 +FROM node:20-alpine3.18 AS phase1 WORKDIR /app diff --git a/apps/react-client/package.json b/apps/react-client/package.json index b01bc28..bd5d331 100644 --- a/apps/react-client/package.json +++ b/apps/react-client/package.json @@ -7,7 +7,7 @@ "dev": "react-scripts start", "build": "react-scripts build", "start": "serve -s build", - "start:prod": "yarn build && yarn start", + "prod": "yarn build && yarn start", "test": "react-scripts test", "lint": "eslint --fix .", "eject": "react-scripts eject" diff --git a/turbo.json b/turbo.json index 86812b8..b575c03 100644 --- a/turbo.json +++ b/turbo.json @@ -14,7 +14,7 @@ "build": { "dependsOn": ["^build"] }, - "start:prod": { + "prod": { "dependsOn": [] }, "test": {