Getting Started
First we advise to checkout our video tutorial on how to use Janush!
Set up project
- Install Janush CLI
npm install -g @codeandpepper/janush
The command above will download library from npm
. If you want to use local version please, use the following commands:
npm install
npm run build
npm link
- Run Janush CLI
janush
- Choose application name
Application name? (janush-app) Awesome App
- Choose application type
Which application type would you like to use? (Press <space> to select, <a> to toggle all, <i> to invert selection)
❯◉ Cloud
◉ Web
- Choose features
Which modules would you like to use? You can add this later. (Press <space> to select, <a> to toggle all, <i> to invert selection)
❯◉ Authentication
Do you want add an auth emails template? (Y/n) y
Do you want add more identity providers? (each provider requires an active developer account).
❯◉ Facebook
◉ Google
◉ Apple
Source code is generated automatically. The generated files should appear in terminal.
Use it as a starting point to develop your application
Running Cloud infrastructure in generated project
- Go to
cloud
directory and fill credentials in.env
file. Required environmental variables are listed in.env.example
- When the project will be generated, go to the
cloud
directory. The commandnpm run schema:merge
will merge all.graphql
files intolib/api/schema.graphql
- The following command will bootstrap application in cloud
npm run cdk bootstrap
It will translate TypeScript code to CloudFormation syntax understandable by AWS
4. Use the command below to deploy app to the cloud. Please, make sure that
you have configured secrets in ~/.aws/credentials
npm run cdk deploy
- After deploying the terminal should show following variables
<app name>.deveAppSyncApideveGraphQLUrlExport<some hash code>
<app name>.deveCognitoUserPoolCognitoIdentityPoolExport<some hash code>
<app name>.deveCognitoUserPoolCognitoUserPoolClientIdExport<some hash code>
<app name>.deveCognitoUserPoolCognitoUserPoolIdExport<some hash code>
Please, use these values in order to run web app (see the paragraph below)
Running generated web app locally
The web application has been created in React. In order to run it, please create
.env
file from .env.example
by copy it
- Use the variables that appeared after deploy. If you lost it, please find them in AWS Management Console
- Use the command
npm start
to run app
The web application should display immediately in browser