This project is using the following technologies:
- Next.js
- React
- Typescript
- Azure Static Web Sites
- Azure Functions
- Azure Media Services
- Shaka player
-
In order to debug both client and API at the same time, open two separate instances of VS Code. This is because we need to run the web site on port 3000, and the functions app on port 7071. We will have a proxy to the API going through port 4280.
-
In one instance of VS Code bash terminal, open the root folder.
Run this command to launch the Next.js Website
npm run start-next
-
You should see next start up with a "ready" started server on http://localhost:3000
-
At this point, I like to rename the terminal to Next.js so I know what it is.
-
Open a second VS code bash terminal instance, change directory to the /api folder
Run the following command to launch the API functions application. This is an Azure Functions project.
npm run start
-
Rename this terminal window to be "API" or "Functions"
-
You should see Azure Functions app start up successfully and list the available functions in the console. Look for hello: [GET,POST] http://localhost:7071/api/hello for example. You can click this and see a response JSON message to make sure it is working.
-
You should now be able to navigate to http://localhost:3000, and the Functions app should be available on http://localhost:7071/api. You can test it by hitting the "hello" function on http://localhost:7071/api/hello
-
Finally, we will start up the Azure Static Web site emulator, which will create a proxy to the web site and API on port 4280. Open a 3rd Bash terminal, change to the root directory and start the proxy:
npm run start-swa
-
Rename this 3rd terminal window to be "SWA" or "Static Web App".
The Static Web Site emulator will launch and the Next.js application is now available on both port 3000 and on port 4280 (with a proxy to the API).
Now use port 4280 when you want to use the simulated Azure Static Web app hosted environment. This allows you to see both the API and the Next.js application on the same port similar to how it will be deployed to Azure Static Web Apps publicly. You can now debug and test your app and functions locally.
For detailed instructions and a complete How-to on building an Azure Static Web App with an API, see the article Build a new Static Web App on Azure with Node.js
This web site uses Azure Functions hosted in the Azure Static web apps environment to provide an API. For details on using Azure Functions as an API see the article:
Adding and API to Static Web Apps
In order to get data from an Azure Functions API in a React Component in this project, follow the details here:
Usage of the NextJS Material Kit in this site
This web site is using a fork of of the NextJS Material UI Kit.
NextJS Material Kit is a Free Material-UI Kit with a fresh, new design inspired by Google's material design and is was developed using NextJS, starting from this starter project by Material-UI and Material Kit React by Creative Tim. You asked for it, so we built it. It's a great pleasure to introduce to you the material concepts in an easy to use and beautiful set of components. Along with the restyling of the Material-UI elements, you will find three fully-coded example pages, to help you design your NextJS project.
NextJS Material Kit makes use of light, surface and movement. It uses a deliberate color choice, edge-to-edge imagery and large scale typography. The general layout resembles sheets of paper following multiple different layers, so that the depth and order is obvious. The navigation stays mainly on the left and the actions on the right.
NextJS Material Kit was built with the help of nextjs and it uses a framework built by our friends from Material-UI, who did an amazing job creating the backbone for the material effects, animations, ripples and transitions. Big thanks to this team for the effort and forward thinking they put into it.
- Download from Github.
- Download from Creative Tim.
- Clone the repo:
git clone https://github.com/creativetimofficial/nextjs-material-kit.git. npm i nextjs-material-kit- Install with Bower:
bower install nextjs-material-kit.
The documentation for the NextJS Material Kit is hosted at our website.
Within the site you'll find the following directories and files:
nextjs-web-site
.
├── CHANGELOG.md
├── ISSUE_TEMPLATE.md
├── LICENSE.md
├── README.md
├── next.config.js
├── package.json
├── Documentation
│ ├── assets
│ └── tutorial-components.html
├── assets
│ ├── css
│ ├── img
│ │ ├── examples
│ │ └── faces
│ ├── jss
│ │ ├── nextjs-material-kit
│ │ │ ├── components
│ │ │ └── pages
│ │ │ ├── componentsSections
│ │ │ └── landingPageSections
│ │ └── nextjs-material-kit.js
│ └── scss
│ ├── core
│ │ ├── mixins
│ │ └── variables
│ ├── plugins
│ └── nextjs-material-kit.scss
├── pages
│ ├── _app.js
│ ├── _document.js
│ ├── _error.js
│ ├── components.js
│ ├── index.js
│ ├── landingpage.js
│ ├── loginpage.js
│ └── profilepage.js
├── components
│ ├── Badge
│ │ └── Badge.js
│ ├── Card
│ │ ├── Card.js
│ │ ├── CardBody.js
│ │ ├── CardFooter.js
│ │ └── CardHeader.js
│ ├── Clearfix
│ │ └── Clearfix.js
│ ├── CustomButtons
│ │ └── Button.js
│ ├── CustomDropdown
│ │ └── CustomDropdown.js
│ ├── CustomInput
│ │ └── CustomInput.js
│ ├── CustomLinearProgress
│ │ └── CustomLinearProgress.js
│ ├── CustomTabs
│ │ └── CustomTabs.js
│ ├── Footer
│ │ └── Footer.js
│ ├── Grid
│ │ ├── GridContainer.js
│ │ └── GridItem.js
│ ├── Header
│ │ ├── Header.js
│ │ └── HeaderLinks.js
│ ├── InfoArea
│ │ └── InfoArea.js
│ ├── NavPills
│ │ └── NavPills.js
│ ├── PageChange
│ │ └── PageChange.js
│ ├── Pagination
│ │ └── Pagination.js
│ ├── Parallax
│ │ └── Parallax.js
│ ├── Snackbar
│ │ └── SnackbarContent.js
│ └── Typography
│ ├── Danger.js
│ ├── Info.js
│ ├── Muted.js
│ ├── Primary.js
│ ├── Quote.js
│ ├── Small.js
│ ├── Success.js
│ └── Warning.js
└── pages-sections
├── Components-Sections
│ ├── SectionBasics.js
│ ├── SectionCarousel.js
│ ├── SectionCompletedExamples.js
│ ├── SectionDownload.js
│ ├── SectionExamples.js
│ ├── SectionJavascript.js
│ ├── SectionLogin.js
│ ├── SectionNavbars.js
│ ├── SectionNotifications.js
│ ├── SectionPills.js
│ ├── SectionTabs.js
│ └── SectionTypography.js
└── LandingPage-Sections
├── ProductSection.js
├── TeamSection.js
└── WorkSection.js
- NextJS Material is Copyright 2021 Creative Tim (https://www.creative-tim.com/?ref=njsmk-readme)
- Licensed under MIT (https://github.com/creativetimofficial/nextjs-material-kit/blob/main/LICENSE.md)