Application to automate the selection of meals and creation of shopping lists.
To have a centralized location where multiple people can organize a meal plan.
Note: postgres is required. Either run it via docker-compose -f **docker-compose-dev.yml -d
or via the homebrew cask mac app.
NPM and uv are required for frontend and backend installation.
# create a .env with `DEBUG=1`. Note: you may need to update database URIs and related vars.
cp .env-example .env
echo "DEBUG=1" >> .env
cd frontend
npm install
s/dev
s/test
s/lint
cd -
cd backend
brew install postgres # necessary for binary pyscopg2
uv sync
# start postgres (DBngin.app is nice on Mac)
s/dev
s/test
s/lint
# use `npm` and `uv` to add and upgrade dependencies
npm add $FOO
uv add $BAR
- update the
postgresql.conf
to include have:
log_statement = 'all'
log_directory = 'pg_log'
log_filename = 'postgresql.log'
logging_collector = on
log_min_error_statement = error
log_rotation_size = 10MB
- tail the log file
tail -f "/Users/$USER/Library/Application Support/com.tinyapp.DBngin/Engines/postgresql/ED55F0A6-5CC7-49A4-B8D5-A5E819F1F1CB/pg_log/postgresql.log"
- setup ssh proxy
ssh -N -L 1111:127.0.0.1:5432 recipeyak
- update .env
DATABASE_URL=postgres://postgres@localhost:1111/recipeyak
-
Copy
.env-example
to.env
and add in the proper configuration variables -
Setup Ansible Inventory
--- all: hosts: recipeyak: ansible_host: 255.255.255.255 ansible_user: root
-
Run the playbook
ansible-playbook ./infrastructure/playbooks/deploy.yml
Enabling maintenance mode returns a 503 status code with a webpage explaining the site is down for maintenance.
ansible-playbook ./infrastructure/playbooks/maintenance_mode.yml
Environment variables are used for configuration. Unless otherwise stated, a value is required.
DJANGO_SECRET_KEY
β long, randomized string required for django- ex:
284urfljkdflsdf
- ex:
DATABASE_URL
β URL for Django's database- ex:
postgres://postgres@postgres:5432/postgres
- ex:
EMAIL_HOST
β SMTP hostname for sending email from Django- ex:
smtp.mailgun.org
- ex:
EMAIL_HOST_USER
β SMTP email for logging into server- ex:
server@example.com
- ex:
EMAIL_HOST_PASSWORD
βΒ SMTP password for authenticating- ex:
SomeUnguessablePassword
- ex:
SENTRY_DSN
β Sentry secret configuration for backend.- ex:
https://<key>:<secret>@sentry.io/<project>
- ex:
FRONTEND_SENTRY_DSN
β Sentry configuration for frontend.- ex:
https://<key>@sentry.io/<project>
- ex:
AWS_ACCESS_KEY_ID
β AWS access key for backups and image upload.- ex:
someAWSKey
- ex:
AWS_SECRET_ACCESS_KEY
β AWS secret key for backups and image upload.- ex:
someSecretKey
- ex:
STORAGE_BUCKET_NAME
β Bucket for image upload.- ex:
recipeyak-production
- ex:
STORAGE_HOSTNAME
β Hostname to use to access image bucket. An s3 hostname or cloudfront distribution hostname.- ex:
594f11c618d1.cloudfront.net
- ex:
-
Create an S3 bucket and configure a CORS policy that allows the website to upload resources.
[ { "AllowedHeaders": ["*"], "AllowedMethods": ["PUT", "POST"], "AllowedOrigins": ["http://localhost:*", "https://recipeyak.com"], "ExposeHeaders": [] } ]
-
Create an IAM policy to give your AWS ID access to
get_object
andput_object
for your bucket. -
Configure imgix to pull from the bucket.