From 35011945683e66e75a4078e13657beb50d54e87b Mon Sep 17 00:00:00 2001 From: Simen Date: Sun, 19 Mar 2023 20:07:46 +0100 Subject: [PATCH] Updated README with better setup instrucions --- README.md | 85 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 68 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 3a13f07..8b3c37b 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,76 @@ -# Devops +# PhoenixLAN Fullstack utvikling -Docker-setup for å utvikle Phoenix-nettsiden fullstack fra pcen din +Docker-setup for å sette opp ett lokalt fullstack environment for å utvikle de ulike Phoenix tjenestene fra pcen din. -## Oppstart +# Oppstarts-Krav -### Krav +- [Git](https://git-scm.com/download/win) +- [GitHub CLI](https://cli.github.com/) (for å lett sette opp git ssh) +- Du trenger Docker og tilhørende docker verktøyer -Last ned Docker: -**UDATERT** + - Last ned [Docker Desktop](https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe) +- Last ned [node](https://nodejs.org/en) og [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#debian-stable) - * Windows: [Docker Desktop](https://hub.docker.com/editions/community/docker-ce-desktop-windows) - - You need virtualization enabled on your system - - You need 64-bit Windows 10 Pro, Enterprise, or Educational - - Enable linux containers. You should be asked about this during setup. - - Enable beta features - - _For more information about Windows requirements, see [https://docs.docker.com/docker-for-windows/install/](https://docs.docker.com/docker-for-windows/install/)_ - * Macos: [Docker Dekstop](https://hub.docker.com/editions/community/docker-ce-desktop-mac/) - * Linux: Depends on distribution - look up what the Docker package is called in your package manager. Usually `docker`. +### Oppsett -You also need docker-compose. On Windows and Macos, this should be bundled with Docker Desktop. On linux, you have to find out what the package name is yourself. It is usually something like `docker-compose` +- (Mye av denne prosessen vil forhåpentligvis automatiseres i fremtiden) +- Lag en prosjektmappe (her kalt phoenixbackend) +- Git clone følgende repoer (med ssh) inne i denne mappen -### Running the application + - git@github.com:phoenixlan/fullstack.git + - git@github.com:phoenixlan/phoenixapi-v1.git + - git@github.com:phoenixlan/phoenixcheckin-v1.git + - git@github.com:phoenixlan/phoenixcrew-v1.git + - git@github.com:phoenixlan/phoenixinfo-v1.git + - git@github.com:phoenixlan/phoenixjs.git + - git@github.com:phoenixlan/phoenixmain-v1.git + - git@github.com:phoenixlan/phoenixparticipate-v1.git +- Du skal da ende opp med denne filstrukturen: -`cd` into the `development` folder and run `docker-compose up` \ No newline at end of file + ``` + +---phoenixbackend + | +---fullstack + | +---phoenixapi-v1 + | +---phoenixcheckin-v1 + | +---phoenixcrew-v1 + | +---phoenixinfo-v1 + | +---phoenixjs + | +---phoenixmain-v1 + | +---phoenixparticipate-v1 + ``` +- Legg til følgende filer i `fullstack/phoenix-development` mappen: + + ``` + // .env + JWT_SECRET="test123!" + + VIPPS_CLIENT_ID= + VIPPS_CLIENT_SECRET== + VIPPS_SUBSCRIPTION_KEY= + VIPPS_CALLBACK_URL=https://api.test.phoenix.no/hooks/vipps + VIPPS_MERCHANT_SERIAL_NUMBER= + + STRIPE_API_KEY= + STRIPE_ENDPOINT_SECRET= + + ``` + ``` + // .db_env + POSTGRES_PASSWORD=example + POSTGRES_USER=phoenix + DB_HOST=db + + ``` + ``` + // .mailgun_env + MAILGUN_DOMAIN= + MAILGUN_API= + MAILGUN_API_KEY= + MAILGUN_FROM_EMAIL= + + ``` +- Kjør `yarn` i alle node repoene for å installere de nødvendige node modulene. + + - (I phoenixjs må du også kjøre `yarn build`) +- Gå til `/fullstack/phoenix-development` og kjør `docker-compose up` for å starte docker containerne. +- Fullstack development enviornment skal da være oppe og du kan så gå til f.eks. [http://dev.phoenixlan.no:3000/]()