- 1) Refactor ITU-MiniTwit to another language and technology of your choice.
- 2) Containerize ITU-MiniTwit with Docker.
- 3) Preparation for next time
Now that you know more or less how ITU-MiniTwit is working, your task is to evolve it away from from a Python/Flask application to the language and web framework of your choice. Prepare a new release with a first version of your rewritten version of your ITU-MiniTwit latest by Thursday, Feb. 15th, at 22:00)
Use your programming-fu and not your Google-fu! First, you will learn the most by doing so and second, we will setup and continuously run a copy-and-paste detection (CPD) tool that compares your systems to those of the other groups and last year's groups ;).
- Do not perform the "big rewrite" yet.
That is, try to create a one-to-one copy of what you currently have in
minitwit.py
. If you want to, reuse thestatic
artifacts, andtemplates
. However, your new application shall have the same features as the current ITU-MiniTwit. - That is, do not reimplement the application in Django, Ruby on Rails, ASP.Net Blazor, etc.
- You have to have a working ITU-MiniTwit by next week.
- A big rewrite is not feasible in this time.
- Map the current features of ITU-MiniTwit before refactoring.
- The test suite in
refactored_minitwit_tests.py
should pass for your refactored application too. Likely, you have to modify the setup method slightly so that it points to your application. However, all test methods of the API tests should pass on your refactored application.- You can execute these tests with
pytest refactored_minitwit_tests.py
- The test suite expects you refactored application to be accessible at http://localhost:5000. Change that URL if necessary.
- You can execute these tests with
- For now, do not refactor the test suite! First refactor your application. Once your new application is passing the tests, refactor the test suite to your language/framework of choice. Then, to double check, you also execute these tests against the original ITU-MiniTwit application.
- Rewrite the application in mini-steps at a time.
- For example, a very first step could be: Given a database, I want to show the public timeline.
- A second step could then be: I want to be able to see the public timeline of one user.
- ...
- Perhaps it is a good strategy to proceed end-point by end-point.
- Either choose a language that you know and want to practice (likely Java and C♯)
- or choose a language and framework that you always wanted to learn but never had the time to do so.
Likely, the first option is appropriate for BSc students and the second option for MSc students.
If I were in your position, I would consider one of the following:
- Nim with Jester
- Go with only the standard library or with Gorilla
- Crystal with Kemal
- Elixir with Phoenix
- Ruby with Sinatra
In case you choose Python as your implementation language you have to build a solution that does not rely on the Flask framework.
If you want to, you can continue to work on your Chirp! system from last semester. In case you do so, you have to refactor it as in the following:
- Remove the "login via GitHub" functionality.
- Add instead login functionality as in the original ITU-MiniTwit application. That is, use HTTP Session cookies to handle if a user is logged into your system.
- Likely, this documentation helps you to get started.
Remember to log and provide good arguments for the choice of programming language and framework. Likely, a feature mapping/comparison or a mini-benchmark is a good choice.
In case you use AI code assistants, you have to do the following:
- Check that what these systems suggest you to do is in line with what you actually want to do.
- Add
GitHub Copilot
,ChatGPT
, etc. as co-author to all commits in which you incorporate their work. See this documentation for how to do it. - Please keep a log with your experiences of using such systems and share your experiences with us.
For your refactoring work, use Docker. That is, create respective Dockerfiles (and if needed yet Docker Compose files) in your repository. These containerize your application and allow all team members to develop your application in a uniform environment.