Urgent.News

What's breaking now, across thousands of outlets.

Tech

Building FoxyInvoice — Chapter 6: Accounts, hosting, DNS, email — from zero to a domain

This series is written in the open, from a real production system. This chapter is the step-by-step shopping list for turning code on a laptop into a URL someone else can type. [All chapters and diagrams live in the public repo.] This is the chapter people skip and then suffer: the accounts, the names, the records that turn code on your laptop into a URL someone else can type. It's step-by-step…

This chapter provides a detailed step-by-step guide to turning code on a laptop into a functional URL for the FoxyInvoice system. The process begins with buying a domain and setting up DNS records to point the domain at a VPS (Virtual Private Server) that will host the system. The author emphasizes the importance of ordering these steps correctly, as several depend on earlier ones being completed.

Next, the chapter discusses setting up an email sending service using Amazon SES (Simple Email Service) SMTP and configuring DNS records to handle incoming mail. It also covers the use of object storage (S3-compatible) for storing PDF invoices and feedback attachments. The chapter then moves on to setting up Stripe for payments, both for single transactions and subscriptions.

The author then explains the role of Docker Compose in running the entire system on the VPS, with each service (Postgres, API, Worker, and Caddy) being run as a separate container. The chapter highlights issues with environment files and immutable configuration files, providing tips to avoid common pitfalls. For example, the Caddy web server is configured to automatically obtain TLS certificates using Let's Encrypt/ZeroSSL, eliminating the need for manual configuration.

Email configuration is covered in detail, with the use of AWS SES via SMTP credentials to relay transaction emails. The chapter also discusses configuring feedback emails to route replies back to the original sender, ensuring better communication with users.

The chapter then delves into storing invoice PDFs and feedback attachments in object storage, as well as processing payments via Stripe. The author stresses the importance of keeping secrets generated and never committed to the repository, using a script called generate-secrets.sh to create random passwords and keys during setup.

Finally, the chapter provides a checklist for launching the system, covering all the necessary steps from domain registration to secret generation and Stripe webhook testing. The author concludes by encouraging readers to create their own domain and take advantage of a free upgrade offer for the first 6 months.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at dev.to →

More in Tech

More from Monday 21 September →