Traquer is a passionate bird that helps you watch over your files while you go about your daily business. Traquer is a location file tracking system. A simulation of manual file movement to electronic file monitoring
-
Back-end: Node JS
-
Front-end: React JS 17
-
Database: Mongo DB
-
Configuration in
.env
-
MONGO_HOSTNAME=localhost
-
MONGO_PORT=27017
-
MAILTRAP_USERNAME=
-
MAILTRAP_PASSWORD=
-
EMAIL_SENDER=
-
NODE_ENV=development
-
SMS_USERNAME=
-
SMS_PASSWORD=
-
SMS_SENDER=
-
FILE_NUMBER_PREFIX=
-
SLA_HOURS=48
-
yarn install
yarn start
cd frontend && yarn install
yarn start
URL_PATH/v1/seed/user-role
POST:: URL_PATH/v1/user/add
{
"firstName": "",
"lastName" : "",
"email": "",
"telephone": 23480******,
"dob": "2021/01/12",
"gender": "M",
"designation": "Super Administrator",
"isSuper" : true,
"userRole": userRole_id
}
-
The assumption is that the Ubuntu server has been created and you have ssh into the server.
-
Install PM2 on ubuntu
sudo npm install pm2 -g
-
Clone git repo
git clone ${REPO_URL}
cd web
yarn install
yarn build
cd frontend
yarn install
yarn build
- Start the backend service
sudo pm2 start npm --name "app_name" -- start
- Configure NGINX to serve the Node.js API and React front-end. Example
sudo apt-get install -y nginx
- head to the following directory
cd /etc/nginx/sites-available/
- Delete the default file and create a new one with the following code:
server{
listen 80 default_server;
listen [::]:80 default_server;
server_name localhost;
# react app frontend files
location / {
root /home/ubuntu/web/frontend/build;
index index.html;
try_files $uri /index.html;
expires 30d;
}
# node api reverse proxy
location /v1 {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:4000;
proxy_set_header Host $http_host;
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
}
}
- Save the file and restart nginx using
sudo systemctl restart nginx