Skip to content

Web and API codebase for File Tracking System (FST)

Notifications You must be signed in to change notification settings

this-pama/Traque-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Traquer

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

Technical stack:

  • 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

Install required packages for back-end:

yarn install

Serve the backend:

yarn start

Install required packages for front-end in a different terminal:

cd frontend && yarn install

Serving the frontend:

 yarn start

Open browser and Seed required uer role data in db:

URL_PATH/v1/seed/user-role

Open postman and create root user:

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
}

Refer to API documentation on how to activate account

Deployment

sudo npm install pm2 -g
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

About

Web and API codebase for File Tracking System (FST)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages