added README.md + main.py
This commit is contained in:
parent
72ad6ec081
commit
9d33377ac1
87
README.md
Normal file
87
README.md
Normal file
@ -0,0 +1,87 @@
|
||||
# Time Dispatcher
|
||||
|
||||
### Table of contents
|
||||
<!-- TOC -->
|
||||
* [Prerequisites](#prerequisites)
|
||||
* [Installation](#installation)
|
||||
* [Run the app](#run-the-app)
|
||||
* [Production](#production)
|
||||
* [Development](#development)
|
||||
* [Updating](#updating)
|
||||
<!-- TOC -->
|
||||
|
||||
---
|
||||
|
||||
**Time Dispatcher** is a QoL tool to help you track, analyze and allocate your time spent on various projects.
|
||||
Here is a list of the main features available :
|
||||
- Import tasks, projects and time imputations from CSV (compatible with [Super Productivity](https://github.com/johannesjo/super-productivity))
|
||||
- Create parents to group multiple projects
|
||||
- Track your clock-ins / -outs and/or remote work
|
||||
- Mark each parent as either productive or not, i.e. whether its projects take a share of the "clocked" time
|
||||
- Automatically compute the time that should be reported as spent on each productive parent (for example to input in SageX)
|
||||
- View your monthly working times in a nice table or in a summarized form on the dashboard
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Python 3+
|
||||
|
||||
## Installation
|
||||
|
||||
1. Clone the repository
|
||||
```shell
|
||||
git clone https://git.kb28.ch/HEL/TimeDispatcher.git
|
||||
```
|
||||
2. Go inside the project directory
|
||||
```shell
|
||||
cd TimeDispatcher/
|
||||
```
|
||||
3. Install the Python requirements
|
||||
```shell
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
4. Apply the database migrations
|
||||
```shell
|
||||
python manage.py migrate
|
||||
```
|
||||
5. Set the appropriate settings in the `.env` file:
|
||||
1. Copy `.env.template` to `.env`
|
||||
```shell
|
||||
cp .env.template .env
|
||||
```
|
||||
2. Fill in the settings
|
||||
- `DJANGO_SECRET_KEY`: The secret key used by Django.
|
||||
This is a long random string.
|
||||
For example, it can be generated using Python with
|
||||
```python
|
||||
import secrets
|
||||
secrets.token_urlsafe(64)
|
||||
```
|
||||
- `DJANGO_ENV`: Current environment, either `prod` or `dev`
|
||||
- `DJANGO_HOSTS`: Comma-separated list of allowed hosts used by Django
|
||||
|
||||
## Run the app
|
||||
### Production
|
||||
1. Start the Uvicorn server
|
||||
```shell
|
||||
python main.py
|
||||
```
|
||||
2. Open [the app](http://localhost:8000/) in your browser
|
||||
|
||||
### Development
|
||||
1. Start the Django server
|
||||
```shell
|
||||
python manage.py runserver
|
||||
```
|
||||
2. Open [the app](http://localhost:8000/) in your browser
|
||||
|
||||
## Updating
|
||||
(Before updating to a new version, it is recommended to back up the database file, i.e. `db.sqlite3`)
|
||||
|
||||
To update to a new version:
|
||||
1. Download the new sources
|
||||
- from the [release page](https://git.kb28.ch/HEL/TimeDispatcher/releases)
|
||||
- or pull the new version with git
|
||||
2. Run the database migrations:
|
||||
```shell
|
||||
python manage.py migrate
|
||||
```
|
16
main.py
Normal file
16
main.py
Normal file
@ -0,0 +1,16 @@
|
||||
import uvicorn
|
||||
|
||||
from TimeDispatcher.asgi import application
|
||||
|
||||
|
||||
def main():
|
||||
uvicorn.run(
|
||||
application,
|
||||
host="127.0.0.1",
|
||||
port=8000,
|
||||
workers=1
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@ -1,3 +1,4 @@
|
||||
Django~=5.1.5
|
||||
djangorestframework~=3.15.2
|
||||
python-dotenv~=1.0.1
|
||||
uvicorn~=0.34.0
|
Loading…
x
Reference in New Issue
Block a user