GithubHelp home page GithubHelp logo

jfyuen / timesheets Goto Github PK

View Code? Open in Web Editor NEW
4.0 5.0 1.0 3.66 MB

A small app to track user time by projects and activities

License: MIT License

JavaScript 88.21% CSS 8.35% HTML 2.97% Dockerfile 0.48%

timesheets's Introduction

Timesheets

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.

Run

Before anything, install dependencies with npm install. If no database path (${DB_PATH}) is set, it will create one in the app root directory.

Production

$ npm run main

The app starts on port 8080 by default.

Development

Update REACT_APP_BACKEND_URL if neeeded.

$ REACT_APP_BACKEND_URL=http://localhost:8081 npm start

and node

$ node server/index.js

The app starts on port 8081 by default.

Docker

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}/timesheets

Administration

For 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.

Add a new user

To add a new user:

INSERT INTO USERS(NAME, ARRIVAL_DATE, COMMENTS, LASTNAME, FIRSTNAME) VALUES('${NAME}', '${DATE}', '${COMMENT}', '${LAST_NAME}', '${FIRST_NAME}');

Hide a user from the list

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}';

Add non working days

INSERT INTO NON_WORKING_DAYS(DAY) VALUES('${DATE_TO_HIDE}');

Add a new entry

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});

timesheets's People

Contributors

dependabot[bot] avatar jfyuen avatar ltempier avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

ltempier

timesheets's Issues

leave date problem

Pb with leave date field in the database : when date of the day is greater than leave date, user is not visible.
What would be nice: compare leave date to the select date in the form instead of date of the day.

Workaround : replace leave-date by NULL

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.