A small app to track user time by projects and activities. Hopefully to be used weekly.
Work is hierarchied by categories, projects and then tasks. If a project has only one task, it is autoselected and the task field is hidden. Therefore to restrict the work to a category and a project, a single tasks must be added in the database with the same name as the project.
A yearly calendar view allows the user to check he misses some time period.
Before anything, install dependencies with npm install.
If no database path (${DB_PATH}) is set, it will create one in the app root directory.
$ npm run mainThe app starts on port 8080 by default.
Update REACT_APP_BACKEND_URL if neeeded.
$ REACT_APP_BACKEND_URL=http://localhost:8081 npm startand node
$ node server/index.js
The app starts on port 8081 by default.
Use the bundled Dockerfile, change ${DB_PATH} and ${USER} to suits your needs.
$ docker build -t ${USER}/timesheets .
$ docker run -p 8080:8080 -v ${DB_PATH}:/data -d ${USER}/timesheetsFor any operation below, it is needed to modify the sqlite database.
To connect to the database: sqlite3 ${DB_PATH}. After a database update, it is best to restart the docker.
For every command below, replace variables in ${...} with what is to be added.
To add a new user:
INSERT INTO USERS(NAME, ARRIVAL_DATE, COMMENTS, LASTNAME, FIRSTNAME) VALUES('${NAME}', '${DATE}', '${COMMENT}', '${LAST_NAME}', '${FIRST_NAME}');A user is hidden from the list when his leave_date is after the current date:
UPDATE USERS SET LEAVE_DATE=${LEAVE_DATE}' WHERE NAME = '${NAME}';INSERT INTO NON_WORKING_DAYS(DAY) VALUES('${DATE_TO_HIDE}');Entries are stored by Categories / Projects / Activities.
To add everything:
INSERT INTO CATEGORIES(ID, NAME) VALUES(${NEW_CATEGORY_ID}, '${CATEGORY_NAME}');
INSERT INTO PROJECTS(ID, NAME, CATEGORY_ID) VALUES(${NEW_PROJECT_ID}, '${PROJECT_NAME}', ${NEW_CATEGORY_ID});
INSERT INTO ACTIVITIES(ID, NAME, PROJECT_ID) VALUES(${NEW_ACTIVITY_ID}, '${ACTIVITY_NAME}', ${NEW_PROJECT_ID});