Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Feat custom domain #9436

Merged
merged 37 commits into from
Nov 8, 2023
Merged

Feat custom domain #9436

merged 37 commits into from
Nov 8, 2023

Conversation

eddiejaoude
Copy link
Member

@eddiejaoude eddiejaoude commented Oct 10, 2023

Fixes Issue

This feature, will allow the user to set a custom domain for their Profile, for example with the custom domainbiodrop.local:3000 (for local testing add to host file /etc/hosts) will display the web page from localhost:3000/eddiejaoude.

This is achieved by using NextJS middleware which will check Profiles in the DB for any match and return the profile on the custom domain without the appended /eddiejaoude

note: currently the rewrite rule (I left an inline comment) is super slow, commenting this out it is fine local issue only

  • display profile on custom domain
  • form for user to add custom domain
  • test on Preview - manually adding custom domain
  • add custom domain to Vercel when adding domain to profile via premium form
    • add / remove
    • direct to project
    • ssl
  • documentation for user to add custom domain + update their DNS
  • deploy to preview
    • test domain
    • test sub domain
  • deploy to prod
    • manage custom domain delete button (clear form field and submit)
    • middleware catch all and redirect on path for custom domain (for example: custom-domain/search -> biodrop.io/search) hide header/footer
    • search does not work due to CORS issue - not sure why this is effect by the custom domain in the middleware because we used promote preview
    • display domain status from vercel on BioDrop
    • sub domain error [BUG] can't use subdomain with custom domains #9737

Changes proposed

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Screenshots

Screenshot 2023-11-06 at 18 40 00

Note to reviewers

middleware.js Outdated Show resolved Hide resolved
@github-actions github-actions bot added the CI/CD label Oct 12, 2023
@eddiejaoude eddiejaoude marked this pull request as ready for review November 3, 2023 18:45
@github-actions github-actions bot added the 📖 docs Documentation pages label Nov 4, 2023
@eddiejaoude
Copy link
Member Author

Screenshot for docs

Screenshot 2023-11-04 at 16 04 42

@eddiejaoude
Copy link
Member Author

Domain issue...

Screenshot 2023-11-04 at 17 01 19

@kkrishguptaa
Copy link
Member

No Eddie that is not an issue @eddiejaoude; This also happens with hashnode: https://support.hashnode.com/en/articles/5755351-how-to-use-my-domain-on-both-vercel-and-hashnode

We have to display them this table like hashnode does; I believe

@eddiejaoude
Copy link
Member Author

No Eddie that is not an issue eddiejaoude; This also happens with hashnode: https://support.hashnode.com/en/articles/5755351-how-to-use-my-domain-on-both-vercel-and-hashnode

We have to display them this table like hashnode does; I believe

Ok, thank you 👍 great example 💯

@eddiejaoude
Copy link
Member Author

eddiejaoude commented Nov 6, 2023

Documentation screenshots

Screenshot 2023-11-06 at 11 27 03 Screenshot 2023-11-06 at 11 31 32 Screenshot 2023-11-06 at 11 37 45 280520631-9c11302b-1117-428b-ab37-28dbe1030e65

@eddiejaoude eddiejaoude merged commit 5418e2b into main Nov 8, 2023
15 checks passed
@eddiejaoude eddiejaoude deleted the feat-custom-domain branch November 8, 2023 07:42
malay44 pushed a commit to malay44/BioDrop that referenced this pull request Nov 9, 2023
* feat: use custom domain

* feat: custom domain

* fix: profile model domain property

* feat: allow user to set custom domain

* fix: efficiency improvements to middleware

* fix: domain not used

* fix: default value for domain

* fix: deploy custom domain to preview

* fix: hardcoded middleware domain

* fix: debug code for middleware

* fix: hostname and domain in middleware

* fix: hostname replace all

* fix: domain api search

* fix: debugging domain api search

* fix: manage premium page form

* wip: add custom domain to vercel

* feat: premium domain add to vercel

* feat: custom domain to team + project

* fix: remove custom url protocols

* fix: extra custom domain check

* fix: custom domain ignore www

* feat: hide nav+footer if custom domain

* fix: custom domain vercel error handling

* docs: improve premium docs for dns

* fix: extra debugging for custom domain

* fix: more debugging for custom domain

* fix: even more debugging for custom domain

* fix: middleware rewrite condition

* fix: www in custom base domain

* docs: custom domain setup

* feat: custom domain vercel status

* fix: logging when there are errors

* docs: changelog feeature
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CI/CD 📖 docs Documentation pages models
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants