
How to go from "hello world" to real applications?


#100daysOfCode #100DaysOfMLCode #Python

Each expense should have following attributes:
* title (string)
* amount (float)
* created_at (date)
* tags (list of strings)
Store expenses in TXT file.
Cover: Add expense, list expenses, get expense, edit expense, delete expense

Instead to storing/reading in/from TXT file start using SQLite.
Write script to copy all of the existing expenses from TXT file to database.
Don't use ORM at this point.

Represent expense with class Expense having attributes:
* title (string)
* amount (float)
* created_at (date)
* tags (list of strings)
Represent Database with class ExpenseRepository with methods: save, get_by_id, list, delete

Each command/query is class with method execute.
At initialization you need to provide all required data for execution.
Commands: AddExpense, EditExpense
Queries: GetById, ListAll
Maybe this post can help: https://testdriven.io/blog/modern-tdd/

Add tests for commands and queries
Example:
GIVEN valid data
WHEN execute method is called on AddExpense command
THEN record is created in database with same attributes as provided
The same post may help you: https://testdriven.io/blog/modern-tdd/

Use Flask to build the web application for your expense tracker
Reuse commands and queries inside views
Use Jinja2 for HTML templating
Add integration tests for endpoints

Start using PostgreSQL instead of SQLite
You should only edit ExpenseRepository
Create script to copy all existing data from SQLite to Postgres

Add sign up and login to your Flask application
Protect endpoints for expenses to allow only logged in users to use them
Allow user to only see own expenses

Dockerize your Flask application
Deploy to Heroku (don't use DB in docker, use it on Heroku) https://testdriven.io/blog/dockerizing-flask-with-postgres-gunicorn-and-nginx/


Start tracking your expenses
Even the most little ones
Don't forget to add them daily


Use Pandas and Matplotlib to analyze your expenses
Check frequency, check biggest amount, smallest amount, average amount, most frequent amount, most used tags, ...
Draw plots: number of expenses per day, amount spent per day


Build model which will predict tags based on title of expense
Use your existing records
Although your data set is small, try to build model as precise as possible


Don't forget to write blog post for each of these steps.
Don't forget to share your code for the project in public git repository such as Github, Gitlab, Bitbucket.
Don't forget to tweet about it.
Don't forget to add all the skills to LinkedIn.