---
sidebar_position: 1
title: Getting Started
---

import LiteYouTubeEmbed from 'react-lite-youtube-embed';
import 'react-lite-youtube-embed/dist/LiteYouTubeEmbed.css'

# Getting Started

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

 <LiteYouTubeEmbed
        id="UNJBo8q4I4o"
        title="Janush - video tutorial"
        poster="sddefault"
    />


## Set up project

1. Install Janush CLI
```sh
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:

```shell
npm install
npm run build
npm link
```

2. Run Janush CLI
```sh
janush
```

3. Choose application name
```sh
Application name? (janush-app) Awesome App
```

4. Choose application type
```sh
Which application type would you like to use? (Press <space> to select, <a> to toggle all, <i> to invert selection)
❯◉ Cloud
 ◉ Web
```

5. Choose features
```sh
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
```

6. Source code is generated automatically. The generated files should appear in terminal.

7. 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
```bash
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`
```bash
npm run cdk deploy
```
5. After deploying the terminal should show following variables
```bash
<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
```bash
npm start
```
to run app

The web application should display immediately in browser