Giter Club home page Giter Club logo

jonathanloos / cove Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 5.16 MB

Cove brings all critical information into one location for ease of access when experiencing a suicidal crisis. This digital version of a safety plan is accessible online and offline, leveraging Angular for its front-end and a serverless AWS Amplify backend.

License: MIT License

JavaScript 2.23% TypeScript 74.21% HTML 20.80% SCSS 2.75%
angular aws aws-amplify ionic typescript mental-health suicide-prevention mental-health-app mental-health-awareness

cove's Introduction

Welcome to Cove ๐Ÿ‘‹

License GitHub pull requests GitHub issues Issues Closed

Angular TypeScript HTML5 CSS AWS Javascript

๐Ÿ About the initiative

We're a team of recent University of Waterloo graduates who found a passion for helping others who may be struggling with mental health. With cove, users can build their personalized, digital safety plan and access it anytime, anywhere, on any platform and uner any network conditions.

To learn more about our venture, reach out to us at trycove.ca.

๐Ÿ” First, a note on mental health

First and foremost, we recognize mental health affects us all in different ways. We encourage anyone who feels like they are struggling or have a friend who is struggling to reach out, seek help and support others whenever possible.

๐Ÿค– About the project

Cove is an Angular app built using Ionic UI components and tooling. The app's serverless backend is built using AWS Amplify including storage, auth, api, offline(datastore) and database(dynamo) resources. The app was originally meant to be a hybrid app for ios/android but was eventually converted to a PWA.

๐Ÿš€ Setup

1. Clone the repository and install all dependencies

git clone https://github.com/jonathanloos/cove.git

cd cove

yarn install

2. Initialize Amplify Project

  1. Create an AWS Account
  2. Configure the Amplify Cli as outlined here.
  3. Deploy the project

Setup Amplify

amplify init

? Enter a name for the environment: dev (or whatever you would like to call this env)
? Choose your default editor: <YOUR_EDITOR_OF_CHOICE>
? Do you want to use an AWS profile? Y

Create the api

We already have the GraphQL code generated for this project, so generating it here is not necessary.

amplify add api

? Please select from one of the below mentioned services: GraphQL
? Provide API name: $API_NAME
? Choose the default authorization type for the API API key
? Enter a description for the API key: $API_KEY_DESCRIPTION
? After how many days from now the API key should expire (1-365): $CUSTOM_DAYS_HERE
? Do you want to configure advanced settings for the GraphQL API Yes, I want to make some additional changes.
? Configure additional auth types? No
? Configure conflict detection? No
? Do you have an annotated GraphQL schema? Yes
? Provide your schema file path: schema.graphql

amplify add codegen

Add Auth

amplify add auth

Using service: Cognito, provided by: awscloudformation
 
The current configured provider is Amazon Cognito. 
 
Do you want to use the default authentication and security configuration? Default configuration
Warning: you will not be able to edit these selections. 
How do you want users to be able to sign in? $SELECT_METHOD (we use email)
Do you want to configure advanced settings? No, I am done.
Successfully added auth resource locally

Add Storage

amplify add storage

? Please select from one of the below mentioned services: Content (Images, audio, video, etc.)
? Please provide a friendly name for your resource that will be used to label this category in the project: $FRIENDLY_NAME
? Please provide bucket name: $BUCKET_NAME
? Who should have access: $CUSTOM
? What kind of access do you want for Authenticated users? $CUSTOM
? Do you want to add a Lambda Trigger for your S3 Bucket? $CUSTOM
Successfully added resource locally

Status Check: Running amplify status should return the following table

amplify status

Current Environment: dev

| Category | Resource name   | Operation | Provider plugin   |
| -------- | --------------- | --------- | ----------------- |
| Api      | $API_NAME       | Create    | awscloudformation |
| Auth     | $AUTH_NAME      | Create    | awscloudformation |
| Storage  | $STORAGE_NAME   | Create    | awscloudformation |

Add hosting

amplify add hosting

? Select the plugin module to execute Hosting with Amplify Console (Managed hosting with custom domains, Continuous deployment)
? Choose a type Manual deployment

๐Ÿš€ Deploy!

amplify publish       
โœ” Successfully pulled backend environment dev from the cloud.

Current Environment: dev

| Category | Resource name   | Operation | Provider plugin   |
| -------- | --------------- | --------- | ----------------- |
| Api      | coveapp         | Create    | awscloudformation |
| Auth     | coveapp70e2d7ed | Create    | awscloudformation |
| Storage  | coveAppStorage  | Create    | awscloudformation |
| Hosting  | amplifyhosting  | Create    | awscloudformation |
? Are you sure you want to continue? Yes

3. Configure GCP Key

Cove uses Google Maps to search and display location data. To enable it, follow these steps:

  1. Create a GCP API Key as seen here
  2. Ensure the following APIs are enabled for the API key: Geocoding API, Maps Javascript API, Maps Static API and Places API.
  3. Create a .env file in the root directory with: GCP_MAPS_API_KEY=INSERT_GCP_KEY_HERE and replace INSERT_GCP_KEY_HERE with the newly generated key.
  4. Create the GCP_MAPS_API_KEY environment variable in the AWS Amplify Console

4. Start the App (Once backend is finished deploying)

ng start

Note: npm start will first set the environment vairables in .env then start the app.

๐ŸŽ‰ Usage

Create Help Resources

  1. Sign up in the app after following the previous steps

  2. Open the AppSync console:

amplify console api
  1. Click on Queries to open the GraphiQL Editor. Login with your username and use the aws_user_pools_web_client_id located in aws-exports.js for the ClientId.

  2. Create help resources manually to be able to select them within the app. This list is universal and will be accessible to all users. Make sure to provide resources that you or others using the app have access to.

mutation createHelpResource {
    createHelpResource(input: {
        description: "", 
        live_chat: false, 
        phone: {
            hoursOfOperation: "", 
            number: ""
        }, 
        sms: {
            hoursOfOperation: "", 
            number: ""
        }, 
        title: "", 
        url: ""
    }) {
        id title description live_chat phone { number hoursOfOperation } sms { number hoursOfOperation } url
    }
}

We need your help

Cove is looking for contributors / maintainers! Think you could support the platform? Maybe contribute something awesome and meaningful to the mental health community? This is your chance! Drop us a lin on our website trycove.ca or create an issue/PR.

cove's People

Contributors

jonathanloos avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.