GithubHelp home page GithubHelp logo

timesheet's Introduction

Timesheet

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.setup
  • Install Node.js dependencies with cd assets && npm install
  • Start Phoenix endpoint with mix phx.server

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

Learn more

Design Choices

Database

There are four entities in the database: users, sheets, tasks, jobs.

  • The users table store the identifications for all users, such as email, password_hash, name. A user can be either a manager or a worker, which will be distinguished by manager_id, a manager will have a nil for that column.

  • A sheet will have date, status(whether approved), and the id of user it belongs to. One user will have one sheets per day.

  • A task will have how many hours it cost, the note for describing it. There are two foreign keys: sheet_id denotes which sheet it belongs to, and job_id specifies what job this task focused.

  • A job will have a job code, budget hours, and a description(can be long). The jobs table cannot be modified in this prototype. There are two jobs in the database for test.

UI design

For this prototype, there is no way to sign up as a new user, I just provided five users in the database: 2 managers and 3 workers. The user need to login first. If he login as a manager, he will be redirect to an index page containing all the timesheets from the user he supervises. And he can view the detail of each timesheets by click show or approve a timesheet. If he login as a worker, he can see all his timesheets, and create a new timesheets.

To create a new timesheets, the worker need to specifiy tasks by selecting the job code, inputting how many hours spent and a note about the task. Tasks with negative hours will be ignore, while tasks with empty note will be filled with a default note.

timesheet's People

Contributors

sikang-hu avatar

Watchers

James Cloos avatar

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.