# Fansifter-serverless

Fansifter-serverless is a project of [serverless.com](https://serverless.com) framework. Which consists of lambda functions, AppSyncSchema, settings for cognito, appsync, dynamodb and s3.

## Installation

Please visit [Get Started serverless](https://serverless.com/framework/docs/getting-started/) for initial setup.

## Requirements
Before being able to deploy, you have to have AWS configure in your local machine. Install `aws cli`,
and run `aws configure` (or follow those instructions - https://serverless.com/framework/docs/providers/aws/guide/credentials/)

Be careful if you already have configured default credentials. While we can set up custom profile, it means 
all developers need to set it up in the same manner. Right now it's more convenient for all if it's default.
 

## Deploy

Run this command to deploy
```bash
sls deploy
```

## Project structure
* `appsyncschema` folder consists of AppSync schema, in `schema.graphql` file.
* `functions` folder consists of all `js` lambda functions we are using.
* `mapping-templates` folder is for appsync request/response template for lambda functions. Each for each lambda function.
* `resources` folder consists of all the settings, `appsync`, `cognito`, `dynamodb` table properties and `s3-bucket` properties.
* `serverless.yml` file is main settings file for the whole project. Visit [serverless.yml](https://serverless.com/framework/docs/providers/aws/guide/serverless.yml/) for complete understanding of the serverless structure.

