cookbook
Web app to create, store and manage recipes, shopping lists and meal planner
Getting Started
The backend server has the following dependencies:
- PostgreSQL database
- S3 compatible storage for images
- OIDC IDP (Auth0 is supported currently)
- ENV variables for configuration
The following ENV variables are required:
env key |
type |
example |
cbb_debug |
bool |
true |
cbb_auth0_domain |
string |
https://example..eu.auth0.com/ |
cbb_auth0_clientid |
string |
example |
cbb_auth0_audience |
string |
example_audience |
cbb_database_host |
string |
cookbook-database.example.com |
cbb_database_port |
int |
5432 |
cbb_database_database |
string |
cookbook |
cbb_database_username |
string |
|
cbb_database_password |
string |
|
cbb_database_sslmode |
string |
require |
cbb_database_timezone |
string |
Europe/Amsterdam |
cbb_s3_endpoint |
string |
https://s3.provider.com |
cbb_s3_key |
string |
|
cbb_s3_secret |
string |
|
cbb_s3_bucket |
string |
cookbook |
Development
The code can be run locally by providing environment variables locally. There is no requirement for working S3 or OIDC credentials. A local database can be created with Docker.
foo@bar:~/cookbook$ docker run -d --name cookbook_db \
-e POSTGRES_DB=<databasename> \
-e POSTGRES_USER=<username> \
-e POSTGRES_PASSWORD=<password> \
-p 5432:5432 \
postgres
API docs are provided as Swagger docs. These are generated from endpoint annotations. To update the docs, make sure swag is installed:
foo@bar:~/cookbook$ go install github.com/swaggo/swag/cmd/swag@latest
update the docs with the swag init command:
foo@bar:~/cookbook$ swag init --parseDependency -g main.go