Recipe book is a simple MVC using go(lang). The Gin Webframe work was used as a server to create RESTful API endpoints. Go's httpClient was used to create requests and a simple command line interface was used as the view. This code could easily be used as the back end to a web application by replacing the current view file with a front end.
- go
- Gin
- httpClient
Follow the steps below to navigate and use the Recipe Book application:
- Ensure you have go installed on your machine.
- download all files into your favorite editor (VS Code was used in this production)
- In the main package type go build into the command line.
- Execute the executable file by running ./recipies.exe in the command line. Follow the prompts on the screen.
- The application has the option of uploading a json file of Recipies on startup of the file using a command line flag. To do this: run the executable with the flag -file Example: ./recipies.exe -file=example.json. Ensure that the json file is within the same main directory as the executable file.
- For creating the json file, follow the following recipe struct { "title":"your title", "author":"author", "ingredients":["a", "list", "of", "ingredients"], "steps" : ["a", "list", "of", "steps"], "baketime" : 120, "rating": 5 }
- Currently the application is set up so that if a recipe is created with a title that already exists, the new recipe will override the current recipe.