This code should be reviewed listening the Rainbow ππ€πΆπ΅
The staff scheduling application allows users to create an account and log in to the system. The application supports two user roles: Staff User and Admin. Staff Users can view their own schedule for any period of time up to one year, and they can see the schedules of their coworkers. Admins, on the other hand, have more powerful permissions. They can edit and delete all users, create, edit, and delete schedules for users, and order the users list by accumulated work hours per arbitrary period up to one year.
Schedules in the application contain the work date, the user assigned to the schedule, and the shift length in hours. The application provides relevant REST endpoints that can be accessed and interacted with via Postman or other similar software. It also includes relevant unit tests and a documentation page using Open API specifications. Finally, the application is dockerized and includes a README file describing how to run the project.
npm install
npm run build
npm run start:dev
npm start:prod
npm run test
You migth have to configurate dotenv this way couse sometimes the library doenst work properly couse sometimes the library doenst work properly.
dotenv.config({ path: 'C:/your/path/staff-scheduling-system/.env' });
- This app implements a .env file that store all the database credentials and environment variables and also, you need to import dotenv to the database connection, the index.ts file and the JWT file.
Change from :
DB_HOST=localhost
to
DB_HOST=host.docker.internal
This is because its necesary for docker to emulate your database address as if its not local.
docker build --no-cache -t node-backend .
docker run --add-host host.docker.internal:host-gateway -p 8080 -d node-backend
This will expose the port from our localserver