Skip to content

Commit e779602

Browse files
committed
Nest CRUD README
1 parent 76865b2 commit e779602

File tree

2 files changed

+45
-58
lines changed

2 files changed

+45
-58
lines changed

Nest-CRUD/README.md

+34-58
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,51 @@
1-
<p align="center">
2-
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
3-
</p>
4-
5-
[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master
6-
[travis-url]: https://travis-ci.org/nestjs/nest
7-
[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux
8-
[linux-url]: https://travis-ci.org/nestjs/nest
9-
10-
<p align="center">A progressive <a href="http://nodejs.org" target="blank">Node.js</a> framework for building efficient and scalable server-side applications, heavily inspired by <a href="https://angular.io" target="blank">Angular</a>.</p>
11-
<p align="center">
12-
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
13-
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
14-
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a>
15-
<a href="https://travis-ci.org/nestjs/nest"><img src="https://api.travis-ci.org/nestjs/nest.svg?branch=master" alt="Travis" /></a>
16-
<a href="https://travis-ci.org/nestjs/nest"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></a>
17-
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#5" alt="Coverage" /></a>
18-
<a href="https://gitter.im/nestjs/nestjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge"><img src="https://badges.gitter.im/nestjs/nestjs.svg" alt="Gitter" /></a>
19-
<a href="https://opencollective.com/nest#backer"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
20-
<a href="https://opencollective.com/nest#sponsor"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
21-
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-dc3d53.svg"/></a>
22-
<a href="https://twitter.com/nestframework"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
23-
</p>
24-
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
25-
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
26-
27-
## Description
28-
29-
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
30-
31-
## Installation
1+
# Nestjs MongoDB CRUD
322

33-
```bash
34-
$ npm install
35-
```
3+
Simple MongoDB CRUD example demonstrating the Nestjs application structure as well as how you can work with databases. For an in-depth explanation of the application and the basic Nestjs concepts, you can follow [this article](https://gabrieltanner.org/blog/nestjs-crashcourse).
364

37-
## Running the app
5+
## Requirements
386

39-
```bash
40-
# development
41-
$ npm run start
7+
- [NodeJS](https://nodejs.org/en/)
8+
- MongoDB database
429

43-
# watch mode
44-
$ npm run start:dev
10+
## Getting started
4511

46-
# production mode
47-
$ npm run start:prod
48-
```
12+
### Installing dependencies
4913

50-
## Test
14+
First, you need to install all the needed dependencies.
5115

5216
```bash
53-
# unit tests
54-
$ npm run test
17+
$ npm install
18+
```
5519

56-
# e2e tests
57-
$ npm run test:e2e
20+
### Configuring the database
5821

59-
# test coverage
60-
$ npm run test:cov
22+
Before starting the application, you will need to create a MongoDB database and edit the connection string in the `app.modules.ts` file to match your database configuration. The repository includes a Docker-Compose file that helps you start MongoDB.
23+
24+
```
25+
docker-compose up
6126
```
6227

63-
## Support
28+
The default database configuration in the `app.module.ts` file looks like this:
6429

65-
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
30+
```
31+
@Module({
32+
imports: [MongooseModule.forRoot('mongodb://localhost/nest')],
33+
})
34+
```
6635

67-
## Stay in touch
36+
If you are not running the database on your local machine, replace localhost with the correct IP-Address.
6837

69-
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
70-
- Website - [https://nestjs.com](https://nestjs.com/)
71-
- Twitter - [@nestframework](https://twitter.com/nestframework)
38+
### Starting the application
7239

73-
## License
40+
After installing the dependencies, you can run the application using one of the following commands.
7441

75-
Nest is [MIT licensed](LICENSE).
42+
```bash
43+
# development
44+
$ npm run start
45+
46+
# watch mode
47+
$ npm run start:dev
48+
49+
# production mode
50+
$ npm run start:prod
51+
```

Nest-CRUD/docker-compose.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '3.7'
2+
services:
3+
mongodb:
4+
image: mongo:latest
5+
ports:
6+
- 27017:27017
7+
volumes:
8+
- mongodb_data:/data/db
9+
10+
volumes:
11+
mongodb_data:

0 commit comments

Comments
 (0)