Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
KotaHusky committed Mar 27, 2024
1 parent f88650a commit 498718f
Showing 1 changed file with 54 additions and 24 deletions.
78 changes: 54 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,68 @@
# MyWorkspace
# MSAL-React Demo

<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
## Summary

**This workspace has been generated by [Nx, Smart Monorepos · Fast CI.](https://nx.dev)**
This is a demo project that shows how to use the Microsoft Authentication Library for React (MSAL-React).

## Integrate with editors
## 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)

## Setup

### Azure Web App

Setup your Azure Web App and register your app with Azure Active Directory. You will need to create a new app registration in Azure Active Directory and configure/note the following:

- Redirect URIs
- Client ID
- Tenant ID

### GitHub Actions

You will need to configure the following secrets:

`AZURE_APPSERVICE_PUBLISHPROFILE` - The publish profile for your Azure Web App. You can download this from Azure Web Apps > Deployment Center.
`DOCKERHUB_USERNAME` - Your DockerHub username (lowercase).
`DOCKERHUB_TOKEN` - Your DockerHub token. Do not use your password.
`DOCKERHUB_REPO` - Your DockerHub repository.

Environment variables are set in the `env` section of the GitHub Actions workflow file, and should be set accordingly for your app.

## Project Structure

This project is an integrated workspace powered by Nx. It contains the following:

- `apps/msal-react-demo` - The NextJS application that uses MSAL-React.
- `libs/lib-msal-react` - A library that wraps MSAL-React and provides a hook to use in the NextJS app.

Separating the MSAL-React logic into a library allows for easier reuse across multiple applications.

## Additional Resources

### Nx

#### Integrate with editors

Enhance your Nx experience by installing [Nx Console](https://nx.dev/nx-console) for your favorite editor. Nx Console
provides an interactive UI to view your projects, run tasks, generate code, and more! Available for VSCode, IntelliJ and
comes with a LSP for Vim users.

## Start the application
#### Start the application

Run `npx nx dev my-app` to start the development server. Happy coding!
Run `npx nx dev msal-react-demo` to start the development server. Happy coding!

## Build for production
#### Build for production

Run `npx nx build my-app` to build the application. The build artifacts are stored in the output directory (e.g. `dist/` or `build/`), ready to be deployed.
Run `npx nx build msal-react-demo` to build the application. The build artifacts are stored in the output directory (e.g. `.next`), ready to be deployed.

## Running tasks
#### Running tasks

To execute tasks with Nx use the following syntax:

Expand All @@ -40,23 +84,9 @@ npx nx run-many -t <target1> <target2> -p <proj1> <proj2>

Targets can be defined in the `package.json` or `projects.json`. Learn more [in the docs](https://nx.dev/features/run-tasks).

## Set up CI!

Nx comes with local caching already built-in (check your `nx.json`). On CI you might want to go a step further.

- [Set up remote caching](https://nx.dev/features/share-your-cache)
- [Set up task distribution across multiple machines](https://nx.dev/nx-cloud/features/distribute-task-execution)
- [Learn more how to setup CI](https://nx.dev/recipes/ci)

## Explore the project graph
#### Explore the project graph

Run `npx nx graph` to show the graph of the workspace.
It will show tasks that you can run with Nx.

- [Learn more about Exploring the Project Graph](https://nx.dev/core-features/explore-graph)

## Connect with us!

- [Join the community](https://nx.dev/community)
- [Subscribe to the Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- [Follow us on Twitter](https://twitter.com/nxdevtools)

0 comments on commit 498718f

Please sign in to comment.