A simple web application to monitor files on remote server
-
Ruby version
2.3 -
System dependencies
rails 5.1, rubygems, node.js -
Database creation
No database needed for now.
if database is needed in future, then edit 'config/database.yml' file and add root passowrd and then runrake db:create
-
Database initialization
No database needed (if database is needed, the runrake db:migrate
) -
Services
needs redis server to be running and working -
Deployment instructions
- Navigate to project directory
- run
bundle install
- start redis server by running
redis-server
- start rails server by running
rails server
- Navigate to
localhost:3000
for getting continuous update of log file - Navigate to
localhost:3000?user_id={userId}
for getting continuous update of log file for perticular user
-
...
-
How it works
- When server starts, it begin monitoring a log file (located as 'test_file.txt' in project root) and continuously broadcasts changes in given file to "logs" channel
- When users visits "/?user_id=1", the webpage subscribes to "user_1" channel and server then continuously broadcasts changes to "users_1" channel
- similarly for "/?user_id=2"