Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nartc/nest-mean
NestJS Tutorial Repository
https://github.com/nartc/nest-mean
angular expressjs mean-stack mongodb mongoose nestjs nestjs-typegoose nodejs typescript
Last synced: 29 days ago
JSON representation
NestJS Tutorial Repository
- Host: GitHub
- URL: https://github.com/nartc/nest-mean
- Owner: nartc
- Created: 2018-08-11T19:05:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T02:25:53.000Z (almost 2 years ago)
- Last Synced: 2024-10-30T20:07:58.348Z (about 1 month ago)
- Topics: angular, expressjs, mean-stack, mongodb, mongoose, nestjs, nestjs-typegoose, nodejs, typescript
- Language: TypeScript
- Size: 1.2 MB
- Stars: 364
- Watchers: 14
- Forks: 81
- Open Issues: 47
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-nestjs - MEAN Todo with NestJS - 一个使用 NestJS 和 Swagger 的简单 Todo 应用程序。包含授权/身份验证。 (资源)
- awesome-nestjs - MEAN Todo with NestJS - A simple Todo application with NestJS and Swagger. Included Authorization/Authentication. (Resources)
README
# NestJS Tutorial Repository
Repository will be separated into `server` and `client` directory for **NestJS** backend and **Angular** frontend resepctively.
- [x] Server repository
- [x] Client repository
- [x] Docker support
- [x] Hook up Server and Client## Server-side (NestJS)
This repository houses the Project's backend written using **NestJS**
- **NSwag**: Nswag allows us to generate API Calls to our Backend on our Frontend in forms of Functions. The abstraction of **HttpClientModule** takes place in the generated file.
- **Steps**:
1. `cd ./server` & `npm i` to install all dependencies for Server side
2. Have an instance of **MongoDB** running (`mongod`). If you use an IDE like WebStorm, I have a script called: `mongo:local` that is going to run `mongod` subsequently so you can setup a `Compound Run Configuration` with `start:dev` and `mongo:local` to start the Backend with ease.
3. `npm run start:dev` to start the server
- **Note**: If there's issue connecting to local MongoDB and you make sure that you already have `mongod` running, go to `config/default.ts` and check if the `MONGO_URI` is correct.## Client-side (Angular)
This repository houses the Project's frontend written using **Angular 6**
- **Ant Design**: The components design is by AntDesign (https://ng.ant.design/docs/introduce/en). I really like the subtle looks of AntDesign.
- **Steps**: `npm i` to install all the dependencies then just start the application with `ng serve`
- **Note**: Might be worth it to take a look at `proxy.conf.json` and how I setup the CLI to use the `proxy` file when serving so that we can call our backend on `localhost:3000`. This is so-called **Cross Domains Request** and our backend does not have CORS setup. Proxy will help us making the requests from `4200` to `3000`.## Docker
Docker is supported.
- **Branch**: `docker`
- **Steps**: Just clone the repository, check out `docker` branch then from `root` directory, run `docker-compose up` and Docker will take over.
- **Note**: Angular application will be served by NGINX on `localhost`; Nest application will be running on `localhost:3000`; **cAdvisor** which monitors our containers will be running on `localhost:8080`. Again, it's worthwhile to explore the Dockerfile in both `client` and `server` directory; also `nginx.conf` and `docker-compose.yml` to get the gist of how Docker and Docker Compose work.P.S: Pull Requests, Contributions are most definitely welcomed :)