Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

UnityInFlow/expense-tracker-kotlin

Repository files navigation

Expense Tracker — Pure Kotlin

Learn Kotlin basics by building an Expense Tracker. No frameworks — just Kotlin and fun main().

Workshop Structure

Step Topic What we build
Step 1 Variables and Functions val, var, fun, string templates
Step 2 Data Class data class Expense, copy(), toString()
Step 3 HashMap In-memory database, null safety ?.
Step 4 Service Class ExpenseService — logic in one place

Each step has:

  • start — project with TODO comments (your tasks)
  • final — complete solution with explanatory comments

How to Work With This Repository

Option A — Folders (recommended for beginners)

No git knowledge needed. Just download and open folders.

1. Download the repository:

Click the green Code button → Download ZIP on this page. Unzip the file.

2. Start — Step 1:

  • Open IntelliJ IDEA
  • File → Open → select the step-01-start folder
  • Wait for dependencies to download
  • Run: mvn compile exec:java Or: Right-click Main.kt → Run
  • Output appears in the terminal

3. When done or stuck:

Open step-01-final/ — it has the complete solution with explanations.

4. Continue to the next step:

Close the project. Open step-02-start/. Repeat.

Step-by-step flow:

step-01-start/  →  complete TODOs  →  compare with  →  step-01-final/
step-02-start/  →  complete TODOs  →  compare with  →  step-02-final/
step-03-start/  →  complete TODOs  →  compare with  →  step-03-final/
step-04-start/  →  complete TODOs  →  compare with  →  step-04-final/

Option B — Git branches (for advanced users)

Each step has its own branch with files at the root level.

1. Clone the repository:

git clone https://github.com/UnityInFlow/expense-tracker-kotlin.git
cd expense-tracker-kotlin

2. Switch to the first step:

git checkout step-01-start

3. Work on the tasks:

Edit the files — complete code where you see // TODO:. Run: mvn compile exec:java

4. When done or stuck:

git stash                     # save your changes aside
git checkout step-01-final    # switch to the solution

5. Continue to the next step:

git checkout step-02-start

All branches:

step-01-start    step-01-final
step-02-start    step-02-final
step-03-start    step-03-final
step-04-start    step-04-final

Tip — compare your work with the solution:

git diff step-01-final -- src/

Tools

Tool Usage
IntelliJ IDEA Community All steps
JDK 21 Compilation and execution

Next: Spring Boot Version

Want to turn this into an HTTP API? expense-tracker-spring

About

Expense Tracker — Pure Kotlin (no Spring). Step-by-step workshop for learning Kotlin basics.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages