Ninety Camera is a smart monitoring platform for security cameras which can detect human intrusions from camera footage and notify users about the intruder. The whole system is come up with a desktop application, mobile applicatin and a web application. This is the web server of the system which contain the backend of the web application and backend of the mobile application. This server is responsible for
- User Authentication
 - User Authrorization
 - User registration and login
 - Communicate between desktop and the mobile app
 - Send intrusion notifications
 - Communicate system data with the mobile app
 
For the database of the application PostgreSQL is used. As well as for prisma ORM is used for managing the databsase. Currently azure postgreSQL database is used as the database server.
And following are the environmental variables that used for the project.
- DATABASE_URL="Url for the remote database"
 - TOKEN_SECRET="secret code for create jwt tokens"
 - TOKEN_EXPIRE_TIME="time for a jwt token to expire"
 - APP_PASSWORD="Google account password for sending the forgot password tokens"
 
You need to place above environmental variables on a .env files to run the application. As well as to run in the development environment you need to set PORT environmental variable also.
And firebase config file is required to send the notifications to the mobile apps. Change the firebase-conf.json at src/services/. You can take this configuration file from firebase by creating a project.
- User CRUD operations
 - System CRUD operations
 - Camera CRUD operations
 - Notification services
 - Email sending services
 
- Express.js
 - Prisma
 - PostgreSQL
 - SocketIO
 - Firebase
 
- NodeJS installed in the PC
 - Locally or remote postgreSQL server
 - Firebase project
 
- Clone the Repository
 - Execute 
npm ito install the dependencies - Run 
npx prisma migrate devto deploy the db schema - Run 
node index.jsto start the server 
- Fork the repository to your account
 - Clone the repository to your pc
 - Execute 
npm ito install the dependencies - Run 
npx prisma migrate devto deploy the db schema. - Execute 
node index.jsto start the server (Or otherwise you can user nodemon for this process) 
- Testing is done using Jest
 - Testing is done inside docker containers
 - To run tests you need to install docker to your system
 - Execute 
npm run docker:upcommand to initialize the docker container - Execute 
npm testcommand to run the tests - Execute 
npm run docker:downcommand to stop the docker container - All the tests are located inside the tests directory