diff --git a/README.md b/README.md index 1eff92e..d5895af 100644 --- a/README.md +++ b/README.md @@ -8,16 +8,54 @@ This is a demo project that shows how to use the Microsoft Authentication Librar ## Tech Stack -- [Azure Web Apps](https://azure.microsoft.com/en-us/services/app-service/web/) -- [Docker Hub](https://hub.docker.com) -- [GitHub Actions](https://github.com/features/actions) -- [MSAL-React](https://www.npmjs.com/package/@azure/msal-react) -- [NextJS](https://nextjs.org) -- [Nx](https://nx.dev) -- [TailwindCSS](https://tailwindcss.com) +- [Azure Web Apps](https://azure.microsoft.com/en-us/services/app-service/web/) - Cloud webapp hosting +- [Azure B2C](https://learn.microsoft.com/en-us/azure/active-directory-b2c/overview) - Identity and access management with local and social identity providers. +- [Docker Hub](https://hub.docker.com) - Docker container registry. +- [GitHub Actions](https://github.com/features/actions) - CI/CD pipeline. +- [GitHub CLI](https://cli.github.com) - Programmatic access to GitHub. +- [MSAL-React](https://www.npmjs.com/package/@azure/msal-react) - Microsoft Authentication Library for React. +- [NextJS](https://nextjs.org) - React framework for server-side rendering and static site generation. +- [Nx](https://nx.dev) - Extensible dev tools for monorepos. +- [TailwindCSS](https://tailwindcss.com) - Utility-first CSS framework for rapid UI development. ## Setup +### GitHub + +Setup the GitHub CLI: + +```bash +# Homebrew +brew install gh +``` + +```bash +# Windows +choco install gh +``` + +Login to GitHub: + +```bash +# GitHub CLI +gh auth login +``` + +Create a new repository using the template: + +```bash +# GitHub CLI +gh repo create msal-react --template KotaHusky/msal-react --private +``` + +Setup the repository secrets and variables using the template files: + +```bash +# GitHub CLI +gh secret set --env-file .env.template-gha-secrets +gh variable set --env-file .env.template-gha-variables +``` + ### Azure Web App Setup your Azure Web App ... diff --git a/apps/msal-react-demo/.env.template b/apps/msal-react-demo/.env.template index 0c5095c..74b6315 100644 --- a/apps/msal-react-demo/.env.template +++ b/apps/msal-react-demo/.env.template @@ -1,11 +1,9 @@ # https://nextjs.org/docs/app/building-your-application/configuring/environment-variables#bundling-environment-variables-for-the-browser NEXT_PUBLIC_AZURE_B2C_AUTHORITY= NEXT_PUBLIC_AZURE_B2C_CLIENT_ID= -NEXT_PUBLIC_AZURE_B2C_FLOW_EDIT_PROFILE -NEXT_PUBLIC_AZURE_B2C_FLOW_FORGOT_PASSWORD -NEXT_PUBLIC_AZURE_B2C_FLOW_SIGN_UP_SIGN_IN -NEXT_PUBLIC_AZURE_B2C_REDIRECT_URI=/auth +NEXT_PUBLIC_AZURE_B2C_FLOW_EDIT_PROFILE= +NEXT_PUBLIC_AZURE_B2C_FLOW_FORGOT_PASSWORD= +NEXT_PUBLIC_AZURE_B2C_FLOW_SIGN_UP_SIGN_IN= +NEXT_PUBLIC_AZURE_B2C_REDIRECT_URI= NEXT_PUBLIC_AZURE_B2C_TENANT_ID= -NODE_VERSION=20 - -NEXT_PUBLIC_ \ No newline at end of file +NODE_VERSION= \ No newline at end of file diff --git a/apps/msal-react-demo/.env.template-gha-secret b/apps/msal-react-demo/.env.template-gha-secret new file mode 100644 index 0000000..7ce97d5 --- /dev/null +++ b/apps/msal-react-demo/.env.template-gha-secret @@ -0,0 +1,5 @@ +# Template for creating GitHub Actions secrets +AZURE_APPSERVICE_PUBLISHPROFILE= +DOCKERHUB_REPO= +DOCKERHUB_TOKEN= +DOCKERHUB_USERNAME= \ No newline at end of file diff --git a/apps/msal-react-demo/.env.template-gha-variable b/apps/msal-react-demo/.env.template-gha-variable new file mode 100644 index 0000000..013c9dc --- /dev/null +++ b/apps/msal-react-demo/.env.template-gha-variable @@ -0,0 +1,10 @@ +# https://nextjs.org/docs/app/building-your-application/configuring/environment-variables#bundling-environment-variables-for-the-browser +# Template for creating GitHub Actions variables +NEXT_PUBLIC_AZURE_B2C_AUTHORITY= +NEXT_PUBLIC_AZURE_B2C_CLIENT_ID= +NEXT_PUBLIC_AZURE_B2C_FLOW_EDIT_PROFILE= +NEXT_PUBLIC_AZURE_B2C_FLOW_FORGOT_PASSWORD= +NEXT_PUBLIC_AZURE_B2C_FLOW_SIGN_UP_SIGN_IN= +NEXT_PUBLIC_AZURE_B2C_REDIRECT_URI= +NEXT_PUBLIC_AZURE_B2C_TENANT_ID= +NODE_VERSION= \ No newline at end of file