This Developer Guide provides instructions on setting up the project pre-requisites manually in your developer environment.
Please make sure to go through the Quickstart guide first to familiarize yourself with the application and codebase. The Quickstart Guide walks through setting up a demo environment (5 minutes) with a tutorial of key app flows (30 minutes). This lab is self-contained and cleans up after itself by un-deploying all auto-generated AWS resources.
Spacefinder uses a Serverless API built using Amazon API Gateway, Lambda, DynamoDB, and CloudFormation. The API has the following REST methods, and some methods can only be called by users with "Admin" privileges.
For full visibility into how everything works, you're able to setup the backend API in a fully automated way in your personal AWS account, which will then allow you to tweak settings and better understand the key interactions.
The framework relies on Node.js and npm.
# install the latest Gulp CLI tools globally (you will need a newer version of Gulp CLI which supports Gulp v4)
npm install gulpjs/gulp-cli -g
# Checkout the git repo
git clone https://github.com/awslabs/aws-serverless-auth-reference-app.git
# install the Node modules for the bootstrapping process
cd aws-serverless-auth-reference-app/api
npm install
# install the Node modules for the Lambda run-time
cd ./lambda
npm install
# Optional: Update the API config file if you'd like to use a specific non-default AWS profile or different region than us-east-1 to install to.
# vi aws-serverless-auth-reference-app/api/config.js
# Run the API automated bootstrapping process to deploy all AWS resources to your account
# gulp commands need to be run from 'api' directory
cd ..
gulp deploy
# Bootstrap your application with Sample data
gulp bootstrap
The mobile app is a hybrid mobile app, and is built on the Ionic2 framework, which relies on Angular 2 and TypeScript 2.0. The hybrid mobile app can run on Android devices and iOS devices, as well as a modern web browser.
The application framework relies on Node.js and npm. It also uses Apache Cordova plugins to support certain native functionality on mobile devices.
# install Ionic2 CLI, Cordova, and Bower tools
npm install -g ionic cordova bower
# install the Node modules
cd aws-serverless-auth-reference-app/app
npm install
# install Cordova platform components if you would like to build the app for mobile
cordova platform add android
cordova platform add ios
As a hybrid mobile app, SpaceFinder can run in web browser, on Android devices, and on Apple iOS devices.
This useful for development purposes. If prompted for address/port to bind to, choose 'localhost'
ionic serve
You can run the app in an actual Android mobile device, or in an Android emulator. The following command generates an Android APK file, and run it in an Android emulator. Note that this requires previous installation of the Android SDK and existence of the ANDROID_HOME environmental variable.
ionic cordova run android
Alternatively, to generate just the Android APK file, which can then be loaded onto an Android device:
ionic cordova build android
Remote debug live content on an Android device from your Windows, Mac, or Linux computer,
using Chrome's remote debugger tool, and visiting chrome:https://inspect
in your Chrome browser.
There are also third-party tools such as Vysor which can allow you to view your mobile device screen on your computer.
ionic cordova run ios
Sample users and location/resource data are created as part of the bootstrapping process, to make it easy for you to try out the user flows. Use the following users to login to the application. You may additionally create your own personal accounts.
-
Standard user
- Username:
user1
- Password:
Test123!
- Can browse resources, make bookings, and upload profile picture
- Username:
-
Admin user
- Username:
admin1
- Password:
Test123!
- Can additionally create and delete locations and resources
- Username:
Enable the browser developer console (or remote debugging for Android) to view all of the log messages.
The log messages will show you all tokens retrieved as part of the sign-in process, as well as all API calls made and the corresponding authorization for each call.
When you're through testing and using the application, you may run the following command to delete any previously created backend resources that are hosted in your AWS account.
cd aws-serverless-auth-reference-app/api
gulp undeploy