This project is a small rest-api application for tracking people's time on projects and tasks.
- User authentication
- create projets
- create tasks and associate them to projects
- keep track of tasks started and time spend per task
- pause, continue and restart tasks
- keep track of projects by user and the associated tasks
- virtualenvwrapper, install it from (https://virtualenvwrapper.readthedocs.io/en/latest/install.html)
- Python 3.6 or higher.
- PostgreSQL 10
$ mkvirtualenv project_tracker --python=python3
$ git clone https://github.com/ChronoFrank/project_tracker.git
$ workon project_tracker
$ pip install -r requirements.txt
Create a new database in your PostgreSQL server and create a settings_loca.py file
$ touch /project_tracker/settings_local.py
── project_tracker
├── manage.py
├── project_tracker
│ ├── __init__.py
│ ├── settings_local.py #new file created
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── project_tracking
│ ├── admin.py
│ ├── apps.py
│ ├── __init__.py
edit the file with your database configuration.
DATABASES = {
'default': {
'ENGINE':'django.db.backends.postgresql_psycopg2', # '.postgresql_psycopg2', '.mysql', or '.oracle'
'NAME': 'project_tracker',
'USER': '<PostgresSQL--user>',
'PASSWORD': '<PostgresSQL--password>',
'HOST':'127.0.0.1', # Set to empty string for localhost.
'PORT':'5432', # Set to empty string for default.
},
}
Then you can sync the database.
$ python manage.py migrate
$ python manage.py test
# if we want to get the coverage report:
coverage run ./manage.py test; coverage report
$ python manage.py runserver 12001
$ python manage.py createsuperuser
- the api documentation is at http://localhost:12001/docs
- to use the endpoints you must get the access_token provided by /api/v1/access_token/ the token will have a duration of 5 minutes, after that you must user the /api/v1/refresh_token/ to get a new one.
- all the endpoints must have the Authorization header with the access_token as value
- You also can import the project_tracker.postman_collection.json in postman to test the endpoints.
Happy coding :)