Serverless TODO Web Application using Hexaville. This is used as demo app in my session at builderscon tokyo 2017
This example application requires GitHub OAuth App. Before installation, you had better to create it.
The callbak url should be http://your-host.com/auth/github/callbak
- Xcode 9(Swift 4)
- AWS DynamoDBLocal
There are two ways to install DynamoDBLocal
In any case, You need to keep it start while local development.
Export dynamodb endpoint and GitHub OAuth Application credential as Environment variables.
export DYNAMODB_ENDPOINT=http://localhost:8000
export GITHUB_APP_ID=xxxxxxxxxxxxxxxxxxx
export GITHUB_APP_SECRET=xxxxxxxxxxxxxxxxxxx
$ git clone https://github.com/noppoMan/HexavilleTODOExample.git
$ cd HexavilleTODOExample
$ make install
make install
do following steps.
swift build
- DynamoDB migration for creating tables that are used in app.
$ ./.build/debug/hexaville-todo-example serve
Access http://localhost:3000/
from your browser and then, You'll see Welcome to Hexaville!
That's it!
You can open and edit HexavilleTODOExample project with Xcode to follow following steps.
$ swift package generate-xcodeproj
$ open HexavilleTODOExample.xcodeproj
$ git clone https://github.com/noppoMan/HexavilleTODOExample.git
$ cd HexavilleTODOExample
replace xxxxxxxxxxxxxxxxxx
for credential
, region
and bucket
with your environment in Hexavillefile.yml.
If you don't give role
(ARN) for Lambda, The IAM user that use in credential
need to have AdministratorAccess
.
name: HexavilleTODOExample
service: aws
aws:
credential:
access_key_id: xxxxxxxxxxxxxxxxxx # change here
secret_access_key: xxxxxxxxxxxxxxxxxx # change here
region: ap-northeast-1 # change here if needed
lambda:
bucket: xxxxxxxxxxxxxxxxxx # change here
# role: xxxxxxxxxxxxxxxxxx # change here if needed
build:
nocache: false
swift:
version: "4.0"
build:
configuration: release
GITHUB_APP_ID
and GITHUB_APP_SECRET
can get from your Oauth Application page on GitHub.
.env
GITHUB_APP_ID=xxxxxxxxxxxxxxxxxxx
GITHUB_APP_SECRET=xxxxxxxxxxxxxxxxxxx
HEXAVILLE_ENV=production
$ cd HexavilleTODOExample
$ make deploy
make deploy
do following steps.
- DynamoDB migration for creating tables that are used in app.
- hexaville deploy
After deploying, You can get endpoint information from standard output.