hangxingliu / vscode-coding-tracker

:clock10: A coding activities tracker(time, file, type)
GNU General Public License v3.0
169 stars 36 forks source link

Time Tracking with a Team #21

Open yorrd opened 6 years ago

yorrd commented 6 years ago

Hi, thanks for this awesome software, we just like you want to get away from wakatime. Is there a way to have multiple members on the same server? We're 3 people and currently reporting into the same server. This sucks because there is no way to split the data. What do you suggest? Running two servers won't work because the IP is already taken.

Maybe we could use multiple tokens for this?

Thanks a lot! Yorrd

hangxingliu commented 6 years ago

I will reply you about team tracking details later because my current deadline is tomorrow.

Now, You can just set different computer id for different members for reporting in total.

And current server API could split data but front end report split by computer/member has been made yet.

P.s.

Multiple tokens are not support now.

yorrd commented 6 years ago

@hangxingliu how much work do you expect would that be to allow for multiple users connecting to the same server?

hangxingliu commented 6 years ago

multiple users connect to same server is easy. but split data follow by different user/computer id in report page is difficult (because page UI and logic need changed)

I think I will create a new branch 0.7.0 for multiple token feature in server repository. And this feature could be use around 10th May.

hangxingliu commented 6 years ago

@yorrd A small survey:

  1. How do you launch server side program on your server (npm start/pm2/forever ...)
  2. Do you met some server side bug util now (dirty database file or other)
  3. Do you think is add token-file future a good idea?

The token-file future in my brain now is like following:

  1. you can launch server side program by optional argument --token-file ${fileName} to enable multi-token future.
  2. token-file is a json file to descripe token array, and which token should upload data with special computerId or project path.
yorrd commented 6 years ago

@hangxingliu thanks for getting back to me on this!

  1. we use pm2 for process management
  2. no, we have not yet had any trouble on the server! Haven't done too much though, it's just running for the past two weeks day after day without interruption :)
  3. do you mean having a file which contains all possible tokens? What about just accepting anything and then storing the data with that token. Then you could aggregate all existing tokens from the data which was submitted to the database

makes complete sense! Only thing I'm wondering: what do you need the project path in the token file for?

Thanks for putting so much effort into this!

hangxingliu commented 6 years ago

@yorrd maybe wrong grammar in my reply lead to meaning be misunderstood.

Actually, why i add token into server side program is used for keeping security. Because your server maybe on the public network (everyone can visit it by ip or hostname), so if the server side program allow upload tracking data without correct token. then everyone included hacker could upload bad data.

And the reason why I allow token in token-file associate with project or computerId is used for limiting role of token, In my mind now, the token file will looks like this:

{
    "token": [
        {
            "remark": "Token for Mike",
            "token": "mike-has-a-cat",
            "computerId": "MikeComputer"
        }, {
            "remark": "Token for Nick with project A",
            "token": "nick-works-hard-in-project-A",
            "computerId": ["NickComputer", "NickLaptop"],
            "project": "projectA"
        }, {
            "remark": "Token for myself",
            "token": "a-token-can-upload-everything"
        }
    ]
}
hangxingliu commented 6 years ago

@yorrd Actually, I have little doubt about point 3 of your reply:

What about just accepting anything and then storing the data with that token. Then you could aggregate all existing tokens from the data which was submitted to the database

Do you means allow everyone upload data with any token. and split tracking data by different token?


P.s.

Thanks for your result of survey. and by the way, there maybe a bug in multi-instances launched by pm2 (Dirty database file be created, and I will fix it in the future).

And if you find other bug please send issue to this project, because I will refactory this old project for more useful and effective.

yorrd commented 6 years ago

Okay, I think I know what you're going at now. So from the multi-user perspective you would have

So to achieve multi-user capabilities, this is more of a frontend-question? If I understand correctly, the current frontend would have to be changed in a way to allow filtering and comparing by computerId for each graph or something along these lines, right?

hangxingliu commented 6 years ago

Yeah, The frontend pages would be changed. And multi cimputerId could be associated.

And I am working on server side project. So you can sustained attention and give me some feedback.

hangxingliu commented 6 years ago

@yorrd Latest commit in server side repo support token file. And --token-file cli argument could set special token. and server program will load default token file in home directory: $HOME/.coding-tracker-token.json

P.s.

And frontend modifications and other optimize I will update in recent days. And you can report bug to me if you are still using it.

yorrd commented 6 years ago

@hangxingliu sorry for the late reply, things got busy here.

First of all, thank you very much, the system seems to work perfectly. I have done preliminary testing and the permission system works very well! I was able to restrict reports via token, upload from different machines via token, etc etc. Very nice :) If we encounter bugs in the future, I'll let you know!

Now the next question is about the frontend. Are you working on this? Do you need help with anything specific? Looking forward to the future, we will possibly even use this in a research paper :)

hangxingliu commented 6 years ago

Yes, I am still developing this extension and server. But I have a front-end work too. So the development progress will not very fast.

And if you want to this help the server side development, it maybe a good opportunity now, Because I am thinking about refactory server side front-end.

I want to refactory it step by step, and base on React/Preact technology for easy maintain by anyone. (by the way, current front-end be created long time ago, it is not friendly for development by other people)


And if you want to know/join somethings else, you can also comment in here or my Email hangxingliu@gmail.com (You can create a Discord channel for discuss development about this extension if you use Discord)