Assumptions
- Only single client/daemon will upload/sync file content
- Parallel file content update/sync for the same file, may not work perfectly or can change the order of file contents
- Application user has write permission to create/write files.
To Run -
- Create a virtual environment and install the required dependencies from requirement.txt
- To run web server from terminal - python run.py
- Make sure APPLICATION_HOST constant value is updated with web server host name/ip in interactive_daemon.py
- To run interactive file daemon - python interactive_daemon.py
-- Use /file POST api to create new file entry to be sync on server with payload {"file_name": <file_name>, "user_name": <user_name>} -- Use /files GET api to get list of all files info including their token -- Use /file/content/ GET api to get file content for given token -- Use /file/content/ PATCH api to get sync file content for given token with payload {"contents": <content_to_sync>}