---
title: "Deploy secure-energy"
description: "Monitor BOCHK appointment availability with a dashboard and email alerts."
category: "Automation"
url: https://railway.com/deploy/secure-energy
---

# Deploy secure-energy

Monitor BOCHK appointment availability with a dashboard and email alerts.

**[Deploy secure-energy on Railway](https://railway.com/template/secure-energy)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/secure-energy/manifest.json

- **Creator:** Bu Junjie's Projects
- **Category:** Automation

## Template content

### web

- **Source:** https://github.com/wsbjj/bochk_monitor_web
- **Start command:** `gunicorn -w 1 -b 0.0.0.0:$PORT web:app`
- **Public domain:** Yes

## Documentation

# Deploy and Host a BOCHK Appointment Monitor on Railway

[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/secure-energy?utm_medium=integration&utm_source=template&utm_campaign=generic)

Deploy a Flask dashboard that checks the Bank of China (Hong Kong) appointment
system for available dates, records each check, and sends an email notification
when a configured date becomes available.

## About Hosting the BOCHK Monitor

This template runs the web dashboard and background monitor from one Railway
service. The dashboard uses HTTP Basic Authentication, displays the latest result
and history, and allows monitoring settings to be saved from the web interface.

A Railway Volume is mounted at `/app/data`. It stores `config.json` and daily logs,
so settings and history survive normal redeployments. Email can be sent through
SMTP with optional Resend API fallback.

## Why Deploy the Monitor on Railway

- Keep the checker and dashboard online without maintaining a server.
- Persist configuration and daily logs on a Railway Volume.
- Manage email credentials and monitoring intervals through Railway Variables.
- Review service output and HTTP errors in Railway logs.

## Common Use Cases

- Monitor a small set of preferred appointment dates.
- Track which dates are available while receiving email only for selected dates.
- Review historical checks from the dashboard and daily log files.
- Use SMTP, an email provider, or Resend for notifications.

## Dependencies for BOCHK Monitor Hosting

### Deployment Dependencies

- SMTP credentials, or a Resend API key for email delivery.
- A sender address and at least one receiver address.
- A Railway Volume mounted at `/app/data`.
- A strong dashboard password and Flask session secret.

## Required Variables

```env
ADMIN_USERNAME=admin
ADMIN_PASSWORD=replace-with-a-strong-password
FLASK_SECRET_KEY=replace-with-a-random-secret

MAIL_HOST=smtp.example.com
MAIL_PORT=465
MAIL_USER=your-email@example.com
MAIL_PASS=your-smtp-password-or-app-code
SENDER=your-email@example.com
RECEIVERS=receiver1@example.com,receiver2@example.com
```

Optional monitoring and fallback settings:

```env
RESEND_API_KEY=re_your_resend_key
MONITOR_CHECK_DATES=20260213,20260214
MONITOR_INTERVAL_SECONDS=120
MONITOR_NOTIFY_ON_AVAILABLE=true
MONITOR_ALL_DATES=false
TZ=Asia/Hong_Kong
```

## After Deployment

1. Open the Railway domain and sign in with `ADMIN_USERNAME` and `ADMIN_PASSWORD`.
2. Confirm the SMTP settings and send a test notification if the dashboard provides one.
3. Set the dates to monitor and the check interval.
4. Confirm that `/app/data` is attached to persistent storage.
5. Add Railway health monitoring and review logs after the first scheduled check.

The monitor only reports availability. It does not reserve or book appointments.
Use it in accordance with the bank's terms and do not send excessive requests.

## Source

https://github.com/wsbjj/bochk_monitor_web


## Similar templates

- [N8N Main + Worker](https://railway.com/deploy/n8n-main-worker) — Deploy and Host N8N with Inactive worker.
- [Evolution API with n8n](https://railway.com/deploy/evolution-api-with-n8n) — Automate WhatsApp workflows with Evolution API, n8n, and Postgres.
- [Postgres Backup](https://railway.com/deploy/postgres-s3-backups) — Cron-based PostgreSQL backup to bucket storage

Open this page in a browser: https://railway.com/deploy/secure-energy
