The repository contains the client and the server for a web application developed for a few companies for managing jobs and registering worked hours.
The software has been commisioned by said companies and replaces an old application, phased out due to its limitations in maintanability and security.
-
Employee
- Register personal worked hours for every job the employee contributes to
- Register hours worked by machines (operated by the employee) on a specific job
-
Administrator
- Manage users: create new ones, enable and disable them
- Create jobs and insert specific details, e.g. cost per worked hour
- Register vacations, time taken off or sick leaves of employees
- Aggregate worked hours per job and visualize costs
-
Server
- The server is developed in TypeScript and uses Express as a framework
- The server relies on a MySQL database
- The server uses Passport to manage the authentication process
-
Client
- The client is developed in TypeScript using the React library and the Bootstrap framework
The server exposes a set of APIs to operate and serves as static files the client, which in turn uses the APIs exposed by the server.
The software is usually deployed on an Heroku container, which runs the two scripts in the main package.json
.
To manually run the software, it would be advisable to manually run the server and, if not previously built, the client too.
The client can be run executing the npm start
command in the client
folder. The client will run on port 3000
and will contact the server on port 3001
. Otherwise, running the npm run build
command in the same folder will build the client, which will then be served by the server as a set of static files.
The server can be run executing the npm run dev
command in the server
folder. This will run the server using nodemon, so the server will be restarted at every change. Alternatevily, the server can be built by transpiling the TypeScript files (executing the npm run build
command in the same folder) and then run with npm start
.
In any case, the server will be run on port 3001
(if not otherwise specified by the environment variable, see below).
The tests written for the server part can be run by executing the npm run test
command in the server
folder.
The server requires several environment variables to operate. These are usually included in a .env
file located inside the server
folder (file which is obviosly not included in the repository for security reasons). These variables are:
-
Mandatory
APP_URL
: the URL the server is served from (used for CORS);DB_HOST
: the hostname of the database;DB_PORT
: the port of the connection to the database;DB_USERNAME
: the username for the database;DB_PASSWORD
: the password for the database;DB_NAME
: the name of the database;
-
Optional
PORT
: the port on which the server has to be served; defaults to3001
if absent.
This README is an initial description of what the software will eventually look like. Several features are yet to be developed or implemented.