How to get started and writing an actual program instead of iex

Open your text editor, throw in the exact code you have, save it as any_name.exs (note the .exs) and run: elixir /path/to/the/file/any_name.exs).

There, you went from iex to your “first program” (technically your first script I guess, but mind that later).

I’m being super simplistic here but the message is that at the end of the day, elixir programs are just a bunch of files. Basically everything you can do in your iex session as you’ve been doing, you can throw in a file and you’re good to go.

Think about iex as just a way to mess around in a sandbox and then “persist” your findings in modules/functions within files.
You can also go the other way around. Write some code, open an iex session and test what you wrote.

It seems that you’re trying to take in too much on a single sip.

Also, normally one would initiate a project with mix new project_name and maybe some flags to get a decent amount of boilerplate done.
When you do this and start an iex session, all the code you wrote on the project files, will be available so you can see how things work.

Edit: Maybe take a look at this thread. The videos are really interesting and it might help you with your application idea.