I archived this project as I don't plan to update it anymore. It should still work until the stripe API it relies on gets deprecated.
A wedding website with a full-featured wedding list using Stripe for payments.
Install docker and docker-compose.
Clone this repo and cd
into it.
For a debian-like host:
# Install dependencies
sudo apt install -y nodejs npm wget unzip
sudo npm install -g pug-cli sass
wget --no-clobber -P static/ \
https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js \
https://code.jquery.com/jquery-3.4.1.slim.min.js \
https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js
wget https://github.com/twbs/bootstrap/archive/v4.4.1.zip \
&& unzip v4.4.1.zip \
&& rm v4.4.1.zip
# Populate custom content
cp vars.example.pug vars.pug
cp templates/about-us-content.example.pug templates/about-us-content.pug
cp backend/db/wedding-list.example.csv backend/db/wedding-list.csv
cp static/img/about-us.example.jpg static/img/about-us.jpg
cp static/img/about-us/1.example.jpg static/img/about-us/1.jpg
cp secrets.example.env secrets.env
./dl_wl_imgs.py
Set your secrets in secrets.env
(use your test apikeys).
Also set STRIPE_PUBLIC_KEY
in vars.pug
.
Run the 3 following commands in 3 different shells.
docker-compose up
pug --pretty --watch templates --out static
sass --watch --no-source-map templates:static
Go to http://localhost:8080/
In order to check the stripe webhook (contributions progress bar), follow those steps:
- Install the stripe cli.
- Run
stripe listen --skip-verify --forward-to localhost:8080/api/stripe-webhook
in a terminal. - Set your
STRIPE_WEBHOOK_SECRET_KEY
insecrets.env
. - Reload the server (kill and re-run
docker-compose up
).
Simulate an event stripe trigger checkout.session.completed
, reload the weddinf list, check backend/db/contributions.json
.
You can also use the credit card 4242 4242 4242 4242, any future date and any 3 digit CVC.
Set general content is in vars.pug
.
Go to templates/wedding.scss
to change the main color.
Change images in static/img/
.
Images in about us must be named 1.jpg, 2.jpg, etc. and you must set the sum in vars.pug
.
Update the date in templates/components/countdown.js
for an accurate countdown.
Setup payment branding.
http://xxx.com/xxx.jpg
as much as possible.
Make your wedding list spreadsheet at backend/db/wedding-list.csv
. You can also download a Google Sheet.
It must follow the format of backend/db/wedding-list.example.csv
, the first line is ignored.
Download your wedding list images by running ./dl_wl_imgs.py
.
You can access contributor names, amount and associated messages in the payment tab of your stripe dashboard.
You can deploy on a bare server from any provider (OVH, Hetzner, scaleway, etc.) or deploy containers on fly.io directly (free and setup TLS for you).
If you feel adventurous you can also deploy on your home server. In any case, set your stripe webhook.
๐ก Advice: make regular backups the /db/
of API.
Update secrets.env
with your live keys.
On your server, copy backend/
and static/
.
Setup TLS (you can use Let's Encrypt cets) and https in nginx conf.
See docker-compose.prod.yml
for a prod-ready example.
- Create an account, launch 2 apps, one from the root, one from
backend/
. - Update
proxy_pass
for the API with your app name innginx.conf
. - In the backend app, avoid exposing the API directly by removing the
services.ports
sections in yourfly.toml
. - Add secrets to the fly app corresponding to the API
cat secrets.env | flyctl secrets import
. - Set custom envs for the API (see
docker-compose.yml
), updateWEBSITE_HOST
, addSKIP_WL_CHECK
(needed before we copy the wedding list on the volume in the next step). - Make a volume the
/db/
volume for the API, mount it and copywedding-list.csv
to it as necessary. - Remove
SKIP_WL_CHECK
and restart the API.
As the wedding list gets updated, don't forget to run./dl_wl_imgs.py
and tofly deploy
the nginx proxy.
wedding-list.csv
only as you may lose contributions.json
if you copy db/
entirely.