WRSC / tracking

WRSC boat tracking system with web dashboard
Other
13 stars 7 forks source link

Refactoring app #1

Open nicolas2lee opened 6 years ago

nicolas2lee commented 6 years ago

Some important tips to keep the app staying modern:

  1. Should not use MVC pattern when things get complicated, should use Domain Driven Development
  2. Should add unitary test, integration test, e2e test, cucumber is a good choice
  3. Add logs and monitoring for web app, historically no logs stored in file
  4. Maybe decouple the dependency of some use cases, add a messaging service layer, convert to message driven
  5. perhaps multi threading for performance optimization, also some big data framework could be a good choice (hadoop, spark, flink ? any big data framework supports ruby ?)
  6. add cache for the web app (since none till today)
  7. rethink variable name, function name and class name, take some meaningful names
  8. maybe use some workflow engine (normally 4 types of competitions, so maybe not need it) & business rule engine (does the competition rule changes each year ? or the score calculation changes each year ? If these things change frequently, then workflow engine & rules engine may be efficient)
  9. reactjs + redux or angular + ngrx is a good choice for front-end (although I use angular for my company, but personally I prefer reactjs )
takluyver commented 6 years ago

I'm on board with adding some tests, but no big rewrites or new technology stacks, please. It's already done what it needs to do for the last couple of years, and the needs for this year will not be radically different.

Specifically, I'm saying no to points 1, 4, 5, 6, 8 and 9.

For the others: 2 is a good idea. 3 sounds good, but I think something is already logged (the files I got from the 2017 hosts included a ~500MB log file). 7 is OK if we can make clear improvements in readability, but let's do it gradually, piece by piece. And if the changes aren't a clear improvement, we'll leave them, because consistency is useful too.

At the moment, my priorities are to figure out:

nicolas2lee commented 6 years ago

I did not know what is the issue for you to launch all tests. But it works perfectly for me, anyway some tests failed in local, because I did not configure the db correctly. I am sure rake test works, at least, it works in my local env.

To run the server locally, you just need to run rails s. As indicated in README.md, you need to export the key export SECRET_KEY_BASE=blah. Anyway it is a hidden bug, since normally with dev env, we do not need config this env variable.

What's more, I had configured vagrant for dev env in branch develop, for people who know vagrant, maybe it is convenient.

I add this wiki page to setup the dev env https://github.com/WRSC/tracking/wiki/Setup-dev-env

For IDE, I use intellij, since I am a java developer, I am familiar with Intellij

takluyver commented 6 years ago

It was SECRET_KEY_BASE that I was missing for the tests - I figured it out after that message above, so I wrote some instructions in the README. :-)

It sounds like you're more familiar with Ruby & Rails than me - can you see why we need SECRET_KEY_BASE even in development?

Thanks for the wiki page, that looks very useful.

I regularly use Pycharm, which is the Python version of the Intellij family. But it doesn't look like Rubymine has a free version, and I probably won't buy an IDE just for this project. So far, I'm using Atom to edit stuff.