Här finns källkoden för dataportalens webbklient https://www.dataportal.se
Den svenska dataportalen är starkt integrerad med produktsviten EntryScape från MetaSolutions AB, https://entryscape.com/sv/. EntryScape Registry är en lösning för att hantera ett register över datakataloger och relaterad information.
Utvecklarportalen hämtar innehåll via 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/dataportal.log
PORT=3000
HOST=http://localhost:$PORT
APOLLO_URL=http://localhost:1301 #server apollo client
REACT_APP_APOLLO_URL=http://localhost:1301 #browser apollo client
IMAGE_DOMAIN=localhost
REACT_APP_MEDIA_BASE_URL=http://localhost:1337
REACT_APP_RUNTIME_ENV=dev
HTTP_PROXY=http://proxy.digg.se:8080
HTTP_PROXY_USER=secretuser
HTTP_PROXY_PASS=secretpass
HEALTHCHECK_SECRET=123
yarn
yarn dev
Gå till http://localhost:3000 i din webbläsare.
För att testa applikationen kör följande:
yarn
yarn build
yarn start
Besök http://localhost:3000 i din webbläsare.
Bygg för produktion genom att köra följande:
yarn build
Detta kommer generera applikationen som statiska filer under .next-mappen.
#bygg image
docker build . -t nextjs-dataportal
#skapa container
docker run -p 3002:3002 -e PORT=3002 -e HOST=http://localhost:3002 -e REACT_APP_APOLLO_URL=http://localhost:1400 -e REACT_APP_RUNTIME_ENV=prod -e IMAGE_DOMAIN=host.docker.internal -e REACT_APP_MEDIA_BASE_URL="http://host.docker.internal:1400/assets/dataportal" --add-host=host.docker.internal:host-gateway nextjs-dataportal
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"}
- 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.