# 🏁 Getting Started
Get started by reading the complete documentation here.

# Project Name
User Insights and Tracking

# Project Info
This Project was created with manual configured webpack and ReactJs

## 🛠️ Tech Stack FE
- React.js
- React Router
- React Context
- Webpack
- Axios for API calls
- ESLint + Babel
- MUI / Styled-components
- MSAL (SSO)
- React Testing Library
- etc.

## 📘 Overview
This is a React based frontend application for User Insights and Tracking.
In this application data is captured by the agent which is installed on systems, which then stores the user data into DB.
Frontend application consumes APIs from [backend/MSAL], 
This application Supports SSO (MSAL) based login, role and permission based access, and uses context for state mgmt, routing, session expiry, token expiry, auto logout on role change, etc. 

## 🏗️ Project Structure
src/
├── assets/ # Static images/fonts
├── context # For state management
├── components/ # Reusable components
├── common/ # Commonly Reusable components
├── hooks/ # Custom hooks/expiry mgmt
├── mock-data/ # mock data for unit testing
├── pages/ # Route-based components
├── services/ # API functions (Axios)
├── tests/ # Unit Testing
├── utils/ # Helper functions
├── App.js # Main app file
├── index.js # React root
├── authConfig.js # MSAL Config


## ⚙️ Running the Application

# Clone the repo
`git clone` https://github.com/CD-Internal-Projects/User-Insight-Tracking-UI.git

# Get the .env file
Ask for .env file, which is required to run the application and place it in the root of the project

# Install dependencies
npm install

# Run dev server
`npm start` 
Runs the app in the development mode.
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
The page will reload when you make changes.\
You may also see any lint errors in the console.

# Build
`npm run build` 
Builds the app for production to the `/build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
To learn React, check out the [React documentation](https://reactjs.org/).

# Run Testing
`npm run test`

# 🚀 Deploying Requirements

* PR Approval is Required and any changes requested after review is mandatory to complete.
* 80% Code coverage is required to deploy the application on any instance except Production as it's manually 
deployed by Cloud Team after Successful UAT.

# Additional Information (Ask Project manager for Credentials/Access)
* Development: https://userinsighttracking-dev.compunnel.com/  (git branch:  development - auto deployment ) 
* Pre-Production (QA): https://computraceportal-qa.compunnel.com/  (git branch:  pre-production - auto deployment)
* Production: https://computraceportal.compunnel.com/  (git branch:  main - manual deployment)
* Sonar Qube: https://cd-builds.compunnel.com/sonar/dashboard?id=userinsighttracking-dev-UI
* Jenkins: https://cd-builds.compunnel.com/login?from=%2Fjob%2FUserInsightTracking-UI%2Fjob%2Fdevelopment%2F
* Swagger: https://userinsighttracking-dev.compunnel.com/api/swagger/index.html