A fast & fun way to build portable cloud-native applications
This sample project create a survey (questionnaire) using zod and auth0 passwordless to handle login. Users can save and resume their survey before submitting.
Follow the steps in the installation guide
Note: If you don't want to use Auth, you can use the ui-noauth version of the UI. Without Auth0, there is no user session, and therefore save and resume functionality is disabled. Skip to step 4 and use the ui-noauth solution for all steps involving the UI project.
- Create an Auth0 account.
- Create a regular web application
- Disable all existing connections
- In Authentication -> Passwordless enable email
- Now head back to connections in your existing connections and enable passwordless -> email.
Create a copy of the env.local file in the ui project and update the value from your Auth0 profile.
AUTH0_SECRET=******** AUTH0_BASE_URL=http://localhost:3000 AUTH0_ISSUER_BASE_URL=****** AUTH0_CLIENT_ID=****** AUTH0_CLIENT_SECRET=*********
Then add the API BASE URL - this is defaulted, but may change if you have multiple APIs in play.
NEXT_PUBLIC_API_BASE_URL=http://localhost:4001
cd src
yarn install
nitric start
cd ui
yarn install
yarn dev
Navigate to http://localhost:3000 with your favourite browser.
Nitric is a framework for rapid development of cloud-native and serverless applications. Define your apps in terms of the resources they need, then write the code for serverless function based APIs, event subscribers and scheduled jobs.
Apps built with Nitric can be deployed to AWS, Azure or Google Cloud all from the same code base so you can focus on your products, not your cloud provider.
Nitric makes it easy to:
- Create smart serverless functions and APIs
- Build reliable distributed apps that use events and/or queues
- Securely store and retrieve secrets
- Read and write files from buckets
The full documentation is available at nitric.io/docs.
We're completely open-source and encourage code contributions.
-
Ask questions in GitHub discussions
-
Find us on Twitter
-
Send us an email
-
Jump into our Discord server