Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swap76/nodejs_mongo_boilerplate
CRUD Blog using NodeJS,Express, MongoDB
https://github.com/swap76/nodejs_mongo_boilerplate
boilerplate express mongodb nodejs sentry
Last synced: about 2 months ago
JSON representation
CRUD Blog using NodeJS,Express, MongoDB
- Host: GitHub
- URL: https://github.com/swap76/nodejs_mongo_boilerplate
- Owner: Swap76
- License: agpl-3.0
- Created: 2019-04-17T04:28:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T00:53:25.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T13:14:09.363Z (2 months ago)
- Topics: boilerplate, express, mongodb, nodejs, sentry
- Language: JavaScript
- Homepage:
- Size: 1.12 MB
- Stars: 21
- Watchers: 3
- Forks: 10
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NodeJS Mongo BoilerPlate
CRUD API using NodeJS, Experss, MongoDB## About
This Repo is for beginners of NodeJS who wants to make a full API service. This repo has a good folder structure. Joi for validation of incoming data. Passport for encrypting passwords.
### Prerequisites
Following are the softwares requried to get this api up and running.
* [Node.js](https://nodejs.org) - Chrome's V8 Javascript Engine
* [MongoDB](https://mongodb.org) - NoSQL Database### Installing
- Getting the configuration ready
Copy the .env.example file at the same location and save as .env
```
cp .env.example .env
```
- Create account on MongoDB Atlas and paste the database URL in .env file- Create account on Sentry and paste the Sentry DNS into .env file (Only for production to get emails about errors)
- Install the packages mentioned in package.json file for getting all dependencies of the project.
```
npm install --save
```
- Starting the application
```
npm start
```## Getting started with the project with Docker
* Fork the repository on GitHub.
* Navigate to the folder of the repository.
* To run this project, you should have Docker installed on your system.
If you don't have Docker, you can visit [The official site of Docker](https://docs.docker.com/docker-for-mac/install/)
to install them on your system.* Building the Docker Image for Docker Hub
```
docker build -t your_dockerhub_username/your_project_name .
```
The . specifies that the build context is the current directory.* It will take a minute or two to build the image. Once it is complete, check your images:
```
docker images
```
You will see the image listed in the list.* Run the following command to build the container:
```
docker run -p 5000:5000 /
```
All requests of port 5000 will be forwarded to port 5000 of container* Once your container is up and running, you can inspect a list of your running containers with following command:
```
docker ps
```
You will see the image listed in the list.* With your container running, you can now visit your application by navigating your browser to ` http://your_server_ip`. You will see your application landing page once again:
* For stoping the container you can use following command:
```
docker stop
```
## Developers* **Swapnil Shinde** - [Swap76](https://github.com/Swap76)