An app that lets the user register information about a fishing trip. The idea was to create a database of information about fishing somewhere. People could look up different ocations for instance, and retrieve information about them, let users store stories, data, images and more.
Gets data from user and stores in a db. Provides ui to query and lookup fishng trips
The query is handled via a form atthe moment.
The users should have a endpoint instead, so they could query directly form their own code.
#Deploying to Heroku
Storing and retrieving images has also not been implemented.
The credentials key used to access the firestore database is stored on heroku, and was configured in the remote dashboard there.
#What went wrong/fine
There was lots of issues with feeding the right paths in the code, such that it would work proper on deployment
The implementation using Golang went fine, and the coding was pretty straight forward.
Most issues and problems with the project had its roots in deploying to Heroku and using correct paths. There was also some issues regarding getting Firestore connected, and getting credentials file to work.
Getting the cred file to work remotely on Heroku took some research and trial/errors.
The creation of a object that holds the credentials file is done in the db package, db.go file.
Here the some code must be omitted/outcommented before deploying to Heroku.
THe path to the template files and the cred file, must be written without any prepaths in order to work on Heroku.
At the end I realize I should perhaps have two versions of the project, one locally and one for remote deployment, because there was some different configuration for the project to work locally. This was because of ifferent filename paths etc.
THe tests will not work with the same paths to these mentioned files. Tests need to have full path to the templatefiles and cred file to work.
The credentials key was finally uploaded to Heroku, so that alø users may read and write to the db. This is not optimal, and I would rather like to have the user login before writing to db. It was done this way to assure that teachers/assistants would have access to the deployed app.
To get the tests to work, the paths to the templatefiles for rendering html, and the the path to cred file need to be changed.
The hardest part of this project was getting the app deployed to Heroku, without it crashing. It was time consuming to try figure out what was the source of the errors.
#Lesson learned
I learned especially the importance of beeing thourough with the paths to filenames, and the importance of good and valid file structure when programming in golang. I also learned more about mapping(finally), json, how to use third party services like Firebase and Zapier. I also learnes that its hard work when working on a project alone.
I have become more effective in using logs for troubleshooting errors. Before I didn't care much for writing tests for my code, and this has improved a bit, an I try to keep testing in the back of my head.
#Total work hours
I spend in the span of 25 - 30 hours on this project.
Most of the time was spendt on research and troubleshooting deployment errors to Heroku.