Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Include front end in ddev configuration #74

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

vauxia
Copy link
Collaborator

@vauxia vauxia commented Feb 7, 2025

A few of us are having some issues setting up locals, and this PR is an aim to get everything under one roof by using ddev to launch the front end.

TODO / SUPPORT NEEDED

  • I am not able to get past the basic auth requirements for the front end site using the user/pass we'd been sharing. What am I missing??
  • Testing beyond that blocker :}

Goals:

  • Make it consistent: the currently documented process suggests running npm run on DDEV's host system, which necessitates having node/npm on the host system, and introduces the possibility of running the front end with a different version or configuration than that of the app itself.
  • Make it repeatable: ultimately, it should be possible for anyone with code access to just run ddev start and get a configured, working site.
  • Get SSL, domain name for free. DDEV furnishes a performance.ddev.site domain and runs each service, with SSL, on a different port. Removing the complexity of communicating between http://localhost:3000 and https://performance.ddev.site/ will probably help with CORS, etc.
  • Consolidate logic and documentation. There were two places to set environment variables. This PR advocates for putting all development-related environment variables in .ddev/.env , where they are consolidated, documented, and automatically applied to the environment

Testing:

  • Back up env files:

    • rename .ddev/.env to .env-save
    • rename src/frontend/.env to src/frontend/.env
  • Stop running the front end site ( so that it's not listening on localhost:3000 )

  • Run ddev restart

  • if you have custom stuff in your .env files

    • The ddev restart you just ran, copies the sample env file to .ddev/.env , but won't preserve the things you had in the files you just backed up! (e.g. AIRTABLE KEY, etc.)
    • You will need to edit .ddev/.env to replace those values. Then runn ddev restart to apply the changes.
  • You should be able to see a 'Next.js front end' service running when you run ddev describe

  • You should be able to access the front end site at https://performance.ddev.site:3000

@vauxia vauxia requested review from dgading, acabouet and iris-i February 7, 2025 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant