Skip to content

Portfolio: serve portfolios on subdomains #49

Open

Description

@procoder-ji

Part of #40. Starts after Phase 1.

Owner decision first

Use <username>.procoderji.com, or a separate domain for student pages, as GitHub uses github.io. A separate domain protects the main site's reputation if a page is abused.

Scope

  • DNS: wildcard domains on Vercel need Vercel nameservers, or delegating _acme-challenge to Vercel. See why nameservers are needed and the alternative.
  • src/proxy.ts (Next.js 16 Proxy, formerly Middleware) reads the host and rewrites <username>.<domain> to /u/<username>. No DNS record per student, and students never receive DNS or hosting credentials.
  • Reserved names from Portfolio: shared field rules, username rules and reserved names #42 never resolve. Unknown names return 404.
  • Choose one canonical address (subdomain or path) and redirect the other.
  • Keep session cookies host-only. procoderji.session currently has no Domain and uses Path=/api/platform; add a test so a future change cannot set Domain=.procoderji.com.

Done when

Tests cover host rewriting, reserved names and the canonical redirect, and docs/deployment.md documents the DNS steps.

Activity

  1. added this to the Portfolio Phase 2 milestone on Nov 10, 2026
  2. Coding-Professional commented on Nov 10, 2026

    @Coding-Professional
    Collaborator

    Hey @procoder-ji,

    Before I pick up the proxy work here, can you check what our DNS setup allows? ADR 0002 lists two options for the wildcard cert on Vercel: moving the nameservers to Vercel, or delegating _acme-challenge to Vercel DNS while keeping the current nameservers. The domain is at Hostinger, and I'm not sure their DNS editor supports NS records on a subdomain.

    Whichever route works, it would help to have it noted here so the deployment doc for this issue can describe the real steps.

  3. procoder-ji commented on Nov 10, 2026

    @procoder-ji
    ContributorAuthor

    Checked it today. The delegation route does not work on Hostinger. Their DNS editor only allows A, AAAA, ALIAS, CNAME, MX, TXT, SRV and CAA records, so it rejects an NS record on _acme-challenge. Not a mistake on our side, the option is just not there.

    So I moved the nameservers to Vercel instead. Before switching, I checked the old zone: it only had the A and CNAME records for Vercel, no MX or TXT, so there was nothing to move. Vercel DNS was already answering for the apex and www, then I changed the nameservers at Hostinger to ns1/ns2.vercel-dns.com. Propagation was still in progress when I checked, and www kept working the whole time.

    @Coding-Professional once dig NS procoderji.com shows vercel-dns, the only DNS step left is adding *.procoderji.com under the project's Domains settings. Please do not add it until the /u/[username] route and the proxy rewrite are in place, otherwise every subdomain will return 404. The deployment doc can say: nameservers on Vercel, then add the wildcard domain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestportfolioStudent portfolio feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions