Skip to content

Onboarding

AdrKacz edited this page Feb 6, 2023 · 23 revisions

Get started

Welcome to Awa 🪐 Here are the first steps to prepare to add new features, correct bugs, and much more (is there more?).

Prerequisite

  • Add your GitHub account to the Collaborators of the project (ask @AdrKacz)
  • Install Flutter
    • Follow these instructions on Medium if you have troubles with Flutter installation guide.
    • Set up your environment for iOS, Android, or both
  • Open your AWS Account and get your AWS credentials for the command line
  • Install the AWS CLI
  • Install Node
    • Set up your environment for npm and yarn
  • Install the SAM CLI

Useful resources

Setup your environment

  1. Clone the repository to your local machine
git clone https://github.com/AdrKacz/super-duper-guacamole.git
cd super-duper-guacamole
  1. Deploy your development environment in AWS in Paris (eu-west-3)

For simplicity, please replace name-of-your-development-environment and name-of-your-stack with dev-[your-name]

cd chat-backend
yarn install:all
yarn deploy:force dev-<YOUR NAME> --guided
yarn run deploy --config-env name-of-your-development-environment --guided
# ...
        Stack Name [sam-app]: dev-<YOUR NAME>
        AWS Region [us-east-1]: eu-west-3
# ... 

You can edit your configuration in samconfig.toml under dev-<YOUR NAME> or with --guided in the command line.

  1. Open .vscode/launch.json and create your development build configuration. You will use this configuration to build your application on an emulator or on your device.
// ...
  "configurations": [
    // ...
    {
            "name": "awachat (dev-<YOUR NAME>)",
            "cwd": "chat-application",
            "request": "launch",
            "type": "dart",
            "program": "lib/main.dart",
            "toolArgs": [
                "--dart-define",
                "WEBSOCKET_ENDPOINT=<YOUR WEBSOCKET URI>",
                "--dart-define",
                "HTTP_ENDPOINT=your=<YOUR HTTP URI>"
            ]
        },
  ]
// ...
  1. Open a device to run your application (you can skip this step if you plug your physical device into your computer and plan to use it for debugging)

  2. Open Flutter: Select Device 1. With the UI on the top-right corner of VSCode, 2. Or enter Ctrl/Command + Shift + P and type Flutter: Select Device.

  3. Select a device from the list (you can emulate multiple devices)

  4. Open the Run and Debug panel (Ctrl/Command + Shift + D), select your build (it should be "awachat (dev-)") from the dropdown menu, and to start the build

You should now be able to use the app on the emulator or your device and see the logs in real-time in the Debug Console tab (Ctrl/Command + Shift + Y) 🎉

I forgot to note my WebSocketURI and my HttpURI

No worries 😉

  1. Connect to the AWS console

  2. Go to Stacks in CloudFormation.

Don't forget to select the correct region on the top right corner of your screen

  1. Select your stack. It should have the value of the parameter Stack Name.

  2. Go to the Outputs tabs. You should see the missing URI's.

I'm done! How do I delete everything I created?

sam delete --stack-name name-of-your-stack
        Are you sure you want to delete the stack dev-<YOUR NAME> in the region eu-west-3 ? [y/N]: y
        Are you sure you want to delete the folder dev-<YOUR NAME> in S3 which contains the artifacts? [y/N]: y
# ...

A tour of the codebase

Contains the code for the mobile application.

Contains the code for the HTTP API and the WebSocket integration.

Security

  1. Don't share the link to connect to the AWS Console
  2. Don't use a simple password for your user
  3. Activate MFA for your user
  4. Go to IAM
  5. Select Add MFA and follow the instruction
  6. If you think you leak your credentials at any point, don't wait and ask for help to revoke them.
[Outdated] Architecture overview