// ClientBase base version
If you have not .env
file in root folder create it and fill it. This file set
environment (global) variables for current application.
We must use STAGE env for develop and testing.
MONGO_CONNECTION_STRING=mongodb://localhost:27017/clientBase
JWT_KEY=jwtSecretKey
JWT_EXPIRES_IN=10d
CLIENT_HOST=http://localhost:8000
MAIL_SILENT=false
AWS_SES_ACCESS_KEY_ID=AKI...
AWS_SES_SECRET_ACCESS_KEY=bTz/c...
AWS_SES_FROM=i@...
AWS_SES_REGION=us-west-2
SENTRY=
Run npm install
.
Check if you have locally installed nodemon
and mongodb
.
npm run local
start the server locally with connection to local MongoDB.
Try to send request from Postman "GET localhost:5000/info", If you happen to have Postman already installed if not read Step 3 (yes you can skip steps). If you get response 'Status 200' your server is active and working fine.
- Follow https://github.com/yogiMap/yogiMapServer
- Click on
Clone or download
button and copy the path. - Open your WebStorm and close current project.
- Click on
Check out from Version Control
. - Paste the path into
URL
field. - Chose directory for your project. Create a pasv-server folder in the list of your WebStorm projects, if needed. ALERT! Make sure you remember that directory, we will have to find it later.
- Click
Clone
button.
Windows 7
Please use version 4.29 or older!!! There is dropdown menu on the right-hand side when you will be choosing which version to download!
Windows 10 and higher
please follow this tutorial.
- Follow https://www.mongodb.com/download-center/community?jmp=docs and download MongoDB Community Edition.
- Use this tutorial to install your MongoDB.
Specialties
For Windows 7
During the installation you need to make sure all the rest of the applications are closed such as: 1.Browsers (Chrome,FireFox,Opera, EI etc.) 2.All Webstorm projects etc.
-
Any other active application When Installation bar/process will hang up for few min (2-3min), at around 85%, please open your System Monitor (shortcut - Ctrl+Shift+Esc) and close process powershell.exe - it is unintended behavior, but it will finish installation process and everything should run fine after REBOOT! DO NOT FORGET TO REBOOT!!!
-
Run MongoDB-Compass - of course you should install MongoDB-Compass first. To install it use this link https://www.mongodb.com/try/download/compass and get the latest version.
-
Make New Connection. For that, find the
MONGO_CONNECTION_STRING
path in.env
file located in the pasv-server project. Copymongodb://localhost:27017/codewars
and paste it in the text area ( Paste your connection string (SRV or Standard )). -
Press
connect
. If it connects you should see collection access page on the left side and be able to play with DB. -
To properly run your environment you will need to add information to Path Environment Variable As example, usually it is following path to the MongoDB server ( "C:\Program Files\MongoDB\Server\4.2\bin" ) This is how to do so.
System Properties -> Environment Variables -> Path -> Edit -> New -> paste your path Add it to both System and User Environments, you can call it "MongoDB"
- Go to the official Mongo DB page make sure all commands below haven't changed: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/
- Check if all additional command-line tools are installed before (according to the article)
- Go to the Mac terminal, run commands down below (run all commands according
to latest MongoDB version):
- Brew tap mongodb/brew
- Brew install mongodb-community@4.2
- Brew services start mongodb-community@4.2
- Download MongoDB Compass, (Connect on localhost:27017)
- Follow https://www.getpostman.com/downloads/.
- Choose your OS and press
Download
. - Create a new workspace.
- Click on
const
button. Then click onChoose files
. - Now you need find a directory with your project. Then select
docs
folder and thenpostman
folder. - Choose
ClientBase.postman_collection.json
andClientBase-LOCAL.postman_environment.json
files in /yourProjectDirectory/docs/postman and open them both - In the upper right corner of the Postman interface, find a drop-down
with
No Environment
field. Change it toClientBase-LOCAL
.
- Open WebStorm and pasv-server project.
- Use
npm install
command to download all modules. - Install nodemon. To install nodemon, type
npm install nodemon
. Then close and reopen WebStorm. - Use
npm run local
command to start server.- If you have Windows OS - it is not so bad, but add to fun of setting up
the environment. Open
File
->Settings
->Tools
->Terminal
and make sure that in theShell path
you haveC:\Program Files\Git\bin\sh.exe
. - Then use
npm config set script-shell "C:\Program Files\git\bin\bash.exe"
command and try to usenpm run local
command once again. If it is still not working, use your head and hands, possibly Google, even if that did not help - go https://www.apple .com/shop/ and get a new Apple MacPC or Laptop, any will do.
- If you have Windows OS - it is not so bad, but add to fun of setting up
the environment. Open
- After all, open Postman and open
ClientBase Collection
. Click on it, then findINFO
folder and sendGET localhost:5000/info
request. - If you get a status 200 response - my warmest congratulations all is set and working fine, hug yourself!
May the FORCE BE WITH YOU!