Skip to content

Commit

Permalink
update readme & dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
nishkohli96 committed Jul 7, 2024
1 parent 96d1700 commit 1347e6d
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 53 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion apps/express-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base Image
FROM node:20-alpine3.18 as phase1
FROM node:20-alpine3.18 AS phase1

WORKDIR /app

Expand Down
14 changes: 10 additions & 4 deletions apps/express-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ Express JS Application with Typescript

```bash
# development
$ yarn run dev
$ yarn dev

# production mode
$ yarn run start:prod
```
# 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
2 changes: 1 addition & 1 deletion apps/express-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion apps/nestjs-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
9 changes: 7 additions & 2 deletions apps/nestjs-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
# development
$ yarn run dev

# production mode
$ yarn run start:prod
# build & run in production mode
$ yarn run prod
```

## Test
Expand All @@ -24,3 +24,8 @@ $ yarn run test:e2e
# test coverage
$ yarn run test:cov
```

### Features

- Routes directory
- Dockerfile
2 changes: 1 addition & 1 deletion apps/nestjs-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion apps/next-client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
CMD [ "yarn", "workspace", "next-client", "start" ]
40 changes: 4 additions & 36 deletions apps/next-client/README.md
Original file line number Diff line number Diff line change
@@ -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)
- Integrated Mui with theme
- Dockerfile
5 changes: 3 additions & 2 deletions apps/next-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion apps/react-client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base Image
FROM node:20-alpine3.18 as phase1
FROM node:20-alpine3.18 AS phase1

WORKDIR /app

Expand Down
2 changes: 1 addition & 1 deletion apps/react-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"build": {
"dependsOn": ["^build"]
},
"start:prod": {
"prod": {
"dependsOn": []
},
"test": {
Expand Down

0 comments on commit 1347e6d

Please sign in to comment.