Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rahul2104/demo-node
Nodejs project structure for api using expressjs,socket.io
https://github.com/rahul2104/demo-node
expressjs mongodb nodejs redis-server socket swagger
Last synced: 19 days ago
JSON representation
Nodejs project structure for api using expressjs,socket.io
- Host: GitHub
- URL: https://github.com/rahul2104/demo-node
- Owner: rahul2104
- Created: 2019-09-13T06:15:53.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-26T11:54:19.000Z (about 2 years ago)
- Last Synced: 2024-10-06T21:17:50.737Z (about 1 month ago)
- Topics: expressjs, mongodb, nodejs, redis-server, socket, swagger
- Language: JavaScript
- Size: 26.6 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node js Structure
Nodejs project structure using expressjs,socket.io
## Install
### Install current stable version of nodejs
```Shell
curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.shsudo bash nodesource_setup.sh
sudo apt install nodejs
sudo apt-get install g++ build-essential
Nodejs current version check
nodejs -v
```
### Install redis server
```Shell
sudo apt updatesudo apt install redis-server
```
### Install mongodbInstall new version of mongodb
```Shell
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo service mongod start
sudo service mongod stop
```
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/## Env setup
create .env file in root folderadd all key from env.example
## Database connection
default database info (mongodb)db name - demo
db port - 27017 (default mongodb port)
db user - demo
db pass - demo
## Redis server
it is use for token storedefault redis server setup
server: 'localhost',
port: 6379, (default redis port)
## Development server
base url -
http://localhost:5001Basic Auth api security
basic auth credentials
username- demo
password - demo## Staging server
base url -
http://localhost:5002## Production server
base url -
http://localhost:5003## Swagger Doc link
http://localhost:5001/apiDocs/v1/
```Shell
basic auth credentials
username- demo
password - demo
```