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)
Clients can be registered by completing the installations steps below followed by the client installation steps detailed here for each client.
Create a .env file at the project root
touch .envProvide 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'git clone https://github.com/Brandon-Galloway/Flora.gitnpm installEstablish how the AWS CDK authenticates with AWS. (See AWS Documentation)
* Also see Authentication and Access
Login to your AWS account and navigate to AWS Secrets Manager. Configure two secrets:
- ACCUWEATHER_API_KEY: Your Accuweather API Key
- PERENUAL_API_KEY: Your Perenual API Key
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)
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": ""
}
}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.
Brandon Galloway