react_backend_final
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.2%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: NarutoUchiha39
- Language: JavaScript
- Default Branch: main
- Homepage: https://react-backend-final.vercel.app
- Size: 942 KB
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
React with express Backend and python interface for people counting
Steps to run the project :
Git clone the repository from
https://github.com/PeopleCounter/React_Backend.gitGo to
React_Backend/Daashboard_2.0/Dashboardand run the commandnpm installto install all the dependencies.Go to
React_Backend/Backendand runnpm installto install all the dependenciesGo to
React_Backend/Backend/index.mjsand typenodemon index.mjsto get theexpress serverup and running on port3000. Theweb socketserver is present on port4001The fron end (using
ReactandVite) runs on port5137Go to
React_Backend/Backend/Pythonand runPeopleCounter.pyto start people countingFor python use
pip install opencv-pythonto download the latest version of opencv python
List of Dependencies :
How does our web application work ? :
On opening the front end using
vite, a login page opens up. The user has to login before the main dashboard can be accessed.For the login we have used Mongo DB as our database with
mongooseas our database driver.For safety of our resources from
Cross Origin Requestswe have usedexpress's CORSlibrary to which URLs are allowed to access our backendFor the parsig of responses we use the
express.jsonmiddleware. We send and receive data in the json format. A custom form handler is used to extract essential details from the form and send it injsonformat to the serverThe server validates the credentials in the form and after validating the credentials it stores users
csrf tokenin the session and sends a copy of the token to the user. For any further post request client has to send the csrf token where it is matched against the csrf token in the server. If they are same, the POST request is accepted else it is rejectedFor the real time people counting, we have used
opencv. We have made a small optimization for conservation of the number of POST request made.Every 5 seconds a function is run that checks if the total number of people comming in and going out is same as the number of people comming in and going out in the previous 5 seconds. If they are same don't make a POST request to the server
In case they are not same a POST request is made to the server and the new count is stored in the mongo DB database. The server is connected to the client via
Web Socket. As a result the new counts are immediately reflected on the web browser resulting in less time delay between updating and showing the update to the userWe have also used
multi threadingin the people counting code. The code to send POST request run on a different thread than the one used for counting. Thus counting isn't affected by the POST request made every 5 secondsOn the client side we have made use of
useEffect hookto connect to the websocket running on port 4001. We have made use of theuseState hookto update the count displayed in the browser
Owner
- Login: NarutoUchiha39
- Kind: user
- Repositories: 2
- Profile: https://github.com/NarutoUchiha39
Citation (CITATION.cff)
GitHub Events
Total
Last Year
Dependencies
- 125 dependencies
- axios ^1.5.1
- body-parser ^1.20.2
- cors ^2.8.5
- dotenv ^16.3.1
- express ^4.18.2
- express-session ^1.17.3
- fast-csv ^4.3.6
- loadash ^1.0.0
- mongodb ^5.7.0
- mongoose ^7.3.2
- socket.io ^4.7.1
- socket.io-client ^4.7.1
- 303 dependencies
- @types/jquery ^3.5.16 development
- @types/node ^20.5.1 development
- @types/react ^18.2.14 development
- @types/react-dom ^18.2.6 development
- @types/react-table ^7.7.14 development
- @vitejs/plugin-react ^4.0.1 development
- eslint ^8.44.0 development
- eslint-plugin-react ^7.32.2 development
- eslint-plugin-react-hooks ^4.6.0 development
- eslint-plugin-react-refresh ^0.4.1 development
- vite ^4.4.0 development
- @react-oauth/google ^0.11.0
- @tanstack/react-table ^8.9.3
- chart.js ^4.3.2
- class-variance-authority ^0.7.0
- clsx ^2.0.0
- datatables.net-dt ^1.13.6
- lucide-react ^0.268.0
- react ^18.2.0
- react-chartjs-2 ^5.2.0
- react-dom ^18.2.0
- react-router-dom ^6.14.1
- react-table ^7.8.0
- socket.io ^4.7.2
- socket.io-client ^4.7.1

