ECM uses a number of open source projects to work properly:
- node.js - evented I/O for the backend
- Express - fast node.js network app framework @tjholowaychuk
- Gulp - the streaming build system
- Mongoose - Mongodb ORM
ECM requires Node.js v12+ and MongoDB v4+ to run.
Install MongoDB into your system...
Open Terminal (terminal 1) Run Mongodb
$ mongod
Open Another Terminal (terminal 2) Create new User in Mongodb
$ mongo
> use ecm
> db.createUser(
{
user: "root",
pwd: "root",
roles:
[
{ role: "readWrite", db: "ecm" }
]
}
)
Close this terminal (terminal 2)
Now Go back to the "mongod" Terminal and press Ctrl + C to stop. It should show the output looks like this. (terminal 1)
$ mongod // press Ctrl + C to stop process
2018-10-24T15:54:16.868+0500 I CONTROL [initandlisten] MongoDB starting : pid=11376 port=27017 dbpath=C:\data\db\ 64-bit host=DESKTOP-PH3E1MA
.....................................................................
.....................................................................
2018-10-24T15:54:19.107+0500 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2018-10-24T15:54:19.107+0500 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'C:/data/db/diagnostic.data'
2018-10-24T15:54:19.134+0500 I NETWORK [initandlisten] waiting for connections on port 27017
^C
And Now Run mongodb with authentication (terminal 1)
$ mongod --auth
................................................................................
torage engine, so setting the active storage engine to 'wiredTiger'.
2018-10-24T15:56:03.352+0500 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=4G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2018-10-24T15:56:06.092+0500 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'C:/data/db/diagnostic.data'
2018-10-24T15:56:06.092+0500 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2018-10-24T15:56:06.096+0500 I NETWORK [initandlisten] waiting for connections on port 27017
If mongodb runs successfully then go the next step
$ git clone https://github.com/NarsunOrg/{project}
Install the dependencies and devDependencies and start the server.
$ cd ecm
$ npm install -d
$ npm run
output:
$ node server
> Connecting to database...
Connected to database...
Server Running on port 3000
Simply rename the .env-example file to .env in the project folder
$ mv .env-example .env
You can customize your changes as you want by changing .env file in the project folder
Name | EndPoint |
---|---|
Docs | http://localhost:3000/docs |
return api's documentation page
Name | EndPoint |
---|---|
Docs | https://docs.google.com/document/d/1zLmRIfX8Yzn_z5EM2bdkJlbnxc7ZWSzGUVWq4GIH2vA/edit?usp=sharing |
Name | EndPoint |
---|---|
game | http://localhost:3000/web/game |
return Test game web page
ECM uses Gulp for fast development. Make a change in your file and instantanously see your updates!
Open your favorite Terminal and run these commands.
Install Gulp globally
$ npm install --global gulp
Run Gulp in the ecm project ecm:
$ gulp
$ npm test
127.0.0.1:3000
i.e
127.0.0.1:3000/api/v1/Users
MIT
Developed by Umer Ahmad Shahzad