Skip to content

Brandon-Galloway/Flora

Repository files navigation

Flora API

Last Commit AWS CDK

Overview

The Flora API is an AWS CDK project deploying a suite of AWS resources to configure data storage, authentication, authorization, messaging, and a backend api for the purpose of collecting and monitoring houseplant data.

Future Enhancements
  • Automatic client registration
  • Data Analysis: event generation
  • Plant.id ML Integration
  • Generate plant recommendations
  • SMS Notifications
  • Mobile App Integration (Amplify)

Flora Client

Clients can be registered by completing the installations steps below followed by the client installation steps detailed here for each client.

Optional Configuration

Create a .env file at the project root

touch .env

Provide optional parameters

CUSTOM_URL='api.example.com'
CUSTOM_URL_CERTIFICATE_ARN=''
CALLBACK_URLS='https:www.google.com,https://api.example.com/callback'
LOGOUT_URLS='https://api.example.com/logout'

Installation

Clone Project

git clone https://github.com/Brandon-Galloway/Flora.git

Install Dependencies

npm install

Authenticate with AWS

Establish how the AWS CDK authenticates with AWS. (See AWS Documentation)

* Also see Authentication and Access

Configure Secrets

Login to your AWS account and navigate to AWS Secrets Manager. Configure two secrets:

Deployment

The following command will deploy all associated project resources to your AWS account's default region:

npm run deploy

* This command aliases cdk deploy -O ./cdk-exports.json

Additional configuration may be required for optional custom domains.
(See AWS Documentation)

Exports

Following deployment, cdk-exports.json will be created in your project root. This file contains helpful exports for utilizing your newly deployed application detailed below.
* This file should NOT be shared.

{
  "FloraStack": {
    # The ID of your user pool. You can add new users here
    "UserPoolId": "",
    # Your API Key. This is required to access API Signin
    "AppSyncAPIKey": "",
    # The ID of your Machine-To-Machine User Pool OAuth Client
    "UserPoolClientId": "", 
    # The URL of your deployed graphql api
    "GraphQLAPIURL": "",
    # The region your project was deployed to
    "ProjectRegion": ""
  }
}

Verification

Following these steps, your aws account should show a new CloudFormation Stack "FloraStack". A list of resources should be available under that stack detailing a comprehensive list of deployed resources. Navigating to "AWS Appsync" should show a new api "flora-api" available. Selecting "Queries" will open a web client where you can verify each endpoint is operating as expected.

Contributors

Brandon Galloway

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published