Skip to main content

Getting Started

First we advise to checkout our video tutorial on how to use Janush!

Set up project

  1. 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
  1. Run Janush CLI
janush
  1. Choose application name
Application name? (janush-app) Awesome App
  1. 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
  1. 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
  1. Source code is generated automatically. The generated files should appear in terminal.

  2. Use it as a starting point to develop your application

Running Cloud infrastructure in generated project

  1. Go to cloud directory and fill credentials in .env file. Required environmental variables are listed in .env.example
  2. When the project will be generated, go to the cloud directory. The command npm run schema:merge will merge all .graphql files into lib/api/schema.graphql
  3. 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
  1. 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

  1. Use the variables that appeared after deploy. If you lost it, please find them in AWS Management Console
  2. Use the command
npm start

to run app

The web application should display immediately in browser