The server for the CareAway web application.
- Clone the repository
git clone https://github.com/CrystalChun/careaway-server.git
- Create a data folder to house your mongo data
- On terminal it's
mkdir data
- On terminal it's
- Start mongodb database
mongod --port 27017 --dbpath /path/to/data/folder/data
- Go into the project's folder
cd careaway-server
and runnode services
to start the server
To install the dependencies available in package.json, run npm install
.
Currently in the package.json:
- express
- morgan
- body-parser
- module-alias
- helmet
- cors
- promise
- mongodb
- consign
- crypto-js
- csurf
- csrf
- moment
- passport
- passport-local
The module-alias
library allows the following aliases to be used throughout the files on the server. It encapsulates the routes to each of these locations within the server to make the importing files both cleaner and less error-prone.
@root
.
Alias | Route |
---|---|
@account |
./services/account_management_service |
@accountModels |
./services/account_management_service/app/setup |
@accountConfig |
./services/account_management_service/config/index.js |
@accountAPI |
./services/account_management_service/app/api |
@accountAPP |
./services/account_management_service/config/app.js |
Alias | Route |
---|---|
@appointment |
./services/appointment_scheduling_service |
@appointmentModels |
./services/appointment_scheduling_service/app/setup |
@appointmentConfig |
./services/appointment_scheduling_service/config/index.js |
@appointmentAPI |
./services/appointment_scheduling_service/app/api |
@appointmentAPI |
./services/appointment_scheduling_service/config/app.js |
Alias | Route |
---|---|
@treatment |
./services/treatment_management_service |
@treatmentModels |
./services/treatment_management_service/app/setup |
@treatmentConfig |
./services/treatment_management_service/config/index.js |
@treatmentAPI |
./services/treatment_management_service/app/api |
@treatmentAPP |
./services/treatment_management_service/config/app.js |
Alias | Route |
---|---|
@configServer |
./services/config_server_service |
@configServerConfig |
./services/config_server_service/config/index.js |
@configServerAPI |
./services/config_server_service/app/api |
@configServerAPP |
./services/config_server_service/config/app.js |
Alias | Route |
---|---|
@models |
./models |
@dataAccess |
./data_access |
- use CareAway
- db.createCollection(“Conditions”)
- db.Conditions.insert({Condition: ["Asthma","Generalized Anxiety Disorder", "Diabetes", "High Blood Pressure", "Panic Disorder", "Social Anxiety Disorder" ]})