Introduction meeting summary, guidance & materials
NOTE: I highly advise you using a Linux/Unix-based (hence macOS is also fine) system for your development needs. As a B.Sc. student, you have received the school laptop that runs Ubuntu. Try to do the development on it. If you insist on using Windows you can use WSL.
Installation guide and pointers for the necessary tools.#
Shell#
- A shell is already installed on your system. When you launch the terminal, by default, you are interacting with the shell already. Unless you have changed it yourself, on Linux, it will most likely be the bash shell. You can check which one you are using by running
ps -p $$
- Run man to learn about any command in depth. The CLIs themselves often feature a –help or -h flag to print a short overview of the most basic functionality. Try to emerge yourself in the shell. Instead of dragging files from one location to another, try using the mv command. To copy files use cp command. To move between directories, use cd etc. Try to get creative and think of ways you are using your computer and instead of the regular, use the command line. Need to convert an image from JPG to PNG? Don’t use some website to do so, use the convert command. Transcoding from mkv to mp4? Use ffmpeg. Using overleaf to work on your LaTeX? Try to compile the document yourself using pdflatex from the texlive package. Unarchive a zip file? Use unzip. You get my point. Anything that you do on your computer, can be done using the command line utilities and try to force yourself to do it that way.
Git#
sudo apt install git
- to install git- https://learngitbranching.js.org/
- https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository
SQLite#
sudo apt install sqlite3
- to install sqlite3- When you run
sqlite3 filename.db
you start modifying the database file. If it’s not present already, the file’s going to be created. - Honestly, nothing really worth recommending if you know postgresql you know sqlite with the minor difference that you connect more easily and there are fewer features available. Google things as you need them.
Golang#
- Note: The project uses modern golang primitives which require golang version 1.23 or higher.
sudo snap install go --classic
- to install golang as the snap package manager keeps the most up-to-date version of golang. If you already have an installation of go (if you have usedsudo apt install golang
) you have to get rid of it usingsudo apt remove golang
and all the related packages. At the end, running go version should yield at least 1.23.- Learn how to write go by following: https://gobyexample.com/hello-world
Gin-specific documentation#
Architecture client-server#
- https://fitech101.aalto.fi/web-software-development/2-internet-and-http/4-architecture-client-server-model/
- https://immich.app/docs/developer/architecture/
Learning svelte#
- Check if you have the node package manager npm by running
npm version
and if it lists a bunch of items and not some command not found error, you’re good. If you don’t have it, runsudo apt install nodejs npm
and it should get installed. Instead of that, you can also try installing bun by following https://bun.sh/docs/installation It’s a faster alternative to nodejs. - https://learn.svelte.dev/tutorial/welcome-to-svelte
Learning jetpack compose android dev#
sudo snap install android-studio --classic
to install Android Studio for Android development.- https://developer.android.com/develop/ui/compose/tutorial - especially view the samples page.
Project overview and setting up the dev environment#
We are developing “codename SplitBit”. An app to help with cost keeping with friends and family. Similar to Splitwise but better as it is open source, free to use and written in a modern, lean and scalable technologies.
Our project uses the following architecture (subject to change): At its core lies the server process written in golang + gin that handles the requests made by the clients - i.e. via the web interface, an iOS app or an Android app.
Getting the repository#
To clone the github repository of the project, you need to first get added to ISDC GitHub organization. Message Mariusz Kuchta or write your github handle in here: https://hedgedoc.kuchta.dev/4Pz1YErLQsexO-fjfS5hrA?both Next, I urge you to add ssh keys to your Github account. This allows you to push changes to the git remote (using git push) without having to retype your Github password every time. To do so, check if you already have an ssh key for your user by running cat ~/.ssh/id_ed25519.pub
- if it says no such file or directory, you haven’t got one, you can easily generate it using ssh-keygen
command (when it prompts you for the password you can press enter to skip adding one). Run the cat command again after doing so to display your keypair’s public key that you need to copy and add to your GitHub account by going to settings > SSH and GPG keys: https://github.com/settings/keys. Click on add new SSH key and paste the aforementioned in there.
Now that’s done, go to the project repo at: https://github.com/ISDC-Helsinki/splitbit click on the green < > Code ↓ button, Click on SSH and copy the link present there. It should be git@github.com:ISDC-Helsinki/splitbit.git
Once you get the git repo link, you can go to your Projects folder (or if you don’t have one use mkdir to create it) and run git clone git@github.com:ISDC-Helsinki/splitbit.git
to get a copy of the repository locally. Now use cd splitbit
to change the directory to the project’s one and run ls
to view the contents.
Running the project#
The slashes in the headers indicate where you should execute the commands.
Server (/server)#
For the server, you need to have the go programming language and sqlite3 installed - refer to the sections above on how to do that.
The server handles the requests and communication with the database. SplitBit uses sqlite3 database as it’s primary datastore and before running the server, it needs to have the database file called test.db present in the same directory. You can easily initialize such file using the command sqlite3 test.db < initdb.sql
. After that in order to build the app you run go build
and ./server
runs the server. Now you clients are ready to interact with it.
Web Client (/web)#
For the web client, you need to have a nodejs runtime - refer to the learning svelte section above.
Copy file .env.example to .env and adjust the URL your client is running at (if you have changed it). Run npm install
to get all the dependencies and npm run dev -- --open
to get the client working.
Android Client (/android)#
For the android client, you need to have android studio installed - refer to the Learning jetpack compose android dev section
Open the project in Android Studio and you should be good to go. You can run the app inside an emulator. By default, it uses a public instance hosted on ISDC’s servers. If you are developing server features at the same time, you might want to change that to make your phone/emulator do its requests to your computer. To do so, modify baseUrl inside src/main/java/fi/isdc_helsinki/splitbit/repositories/ApiClient.kt with the local ip address you get from running commands such as ip address
or ifconfig
AND the port number the server is running on. Then modify the ip address inside app/src/main/res/xml/network_security_config.xml to allow android to make these calls.
Joining MatterMost & Getting help#
In case of problems with the setup, send a message on the Troubleshooting channel in MatterMost https://mattermost-isdc.kuchta.dev/signup_user_complete/?id=h3dnaz7zii8bxcyrkq99e813yy&md=link&sbr=fa so that someone else facing the issue, might have a ready answer.
I am also present at the Kumpula Campus almost every day and oftentimes you can find me in the Integralis hideout. If you want to get an in-person troubleshooting/mentoring session message me on either MatterMost or Telegram.