Alv-no / alv-website

Nettsiden for Alv.no
https://alv.no/
10 stars 7 forks source link
alv-felles alvno

Alv websites

This is the code repo for development of the new websites for Alv.no and Alvb.no

Development setup

Install Git, Node and Yarn, and whatever code editor you prefer.

As of writing this readme the newest version of node and yarn is as follows:

$ node --version
 v16.17.0
$ yarn --version
 3.2.3

Once ready to develop the website run:

yarn
yarn workspace website run dev

Creating .env-files

Ask devs for .env-files for packages/website and packages/website-alvb those thypically contains access-tokens.

For packages/cms and packages-cms-alvb i recomend adding the following piece of code to a .env.development-file

SANITY_STUDIO_API_DATASET=development
SANITY_AUTH_TOKEN=some token here with access to publish schmea chages

Workaround for Apple m1

brew install vips
yarn rebuild sharp
yarn set resolution sharp@npm:0.28.2

Docker

For production we use Docker, you can build and test the Docker images locally. You can either build and start all services by using docker-compose:

make build-website build-cms build-mail-api
docker-compose up -d

And then browse it using a web browser at localhost:8080, website.localhost/ and cms.localhost/.

Or build and start individual service as following:

docker build -f website.Dockerfile -t website .
docker run -it -p 8080:80 website

And then browse it using a web browser at localhost:8080.

Deploy to k8s locally

az login

./run deploy <test | prod> <package> <build-id>

Packages

Package Description
website Gatsby-powered website: Alv.no
website-alvb Gatsby-powered website: AlvB.no
cms Sanity CMS: Alv.no
cms-alvb Sanity CMS: AlvB.no
mail-api Mail API backend for contact form
shared-components Component library to share components between different gatsby sites