Här finns källkoden för utvecklarportalens webbklient https://dev.dataportal.se
Utvecklarportalen hämtar innehåll via en Apollo Gateway. Sätts via env
Skapa en .env.local
LOGSTASH_MODE=tcp
LOGSTASH_HOST=localhost
LOGSTASH_PORT=5000
LOGGING_LEVELS=warn,error,info
LOGFILE_PATH=/app/devportal.log
PORT=3000
HOST=http://localhost:$PORT
APOLLO_URL=http://localhost:1301
IMAGE_DOMAIN=localhost
REACT_APP_MEDIA_BASE_URL=http://localhost:1337
REACT_APP_RUNTIME_ENV=dev
HEALTHCHECK_SECRET=123yarn
yarn devGå till http://localhost:3000 i din webbläsare.
För att testa applikationen kör följande:
yarn
yarn build
yarn startBesök http://localhost:3000 i din webbläsare.
Bygg för produktion genom att köra följande:
yarn buildDetta kommer generera applikationen som statiska filer under .next/.
NextJs svarar på http://localhost:1300/api/healthcheck?secret=[HEALTHCHECK_SECRET från env] Cacheas inte, gör en request till contentbackend med startsidans fråga.
{"status":"fail"}{"status":"pass"}#bygg image
docker build . -t nextjs-devportal
#skapa container
docker run -p 3000:3000 -e PORT=3000 -e HOST=http://localhost:3000 -e APOLLO_URL=http://host.docker.internal:1301 -e REACT_APP_RUNTIME_ENV=dev -e IMAGE_DOMAIN=localhost -e REACT_APP_MEDIA_BASE_URL="http://host.docker.internal:1337" -e HEALTHCHECK_SECRET=123 --add-host=host.docker.internal:host-gateway nextjs-devportal- Nextjs JS framework
- TypeScript typad JS
- React för UI
- Emotion för styling
- Apollo Client för datahämtning
Projektet har ett beroende till Diggs designsystemspaket @digg/design-system.
I skrivande stund är källkoden till detta paket inte publicerad på Github eller NPM.