This project is my sample serverless application using AWS with lambda functions (chalice based), cognito and storage services . One exeption is RMDB database ,due to aurora is not really serverless (and not free :v) , i use supabase for
-
infrastructure : aws with
cdk
for IaC , handle everything except for SQL db which is supabase (totally free for now). -
runtime (
backend
): powered byaws chalice
for both restful api and event-driven : endpoint : https://zr0fxh86b0.execute-api.ap-southeast-1.amazonaws.com/apidocs : https://zr0fxh86b0.execute-api.ap-southeast-1.amazonaws.com/api/docs
-
kycoui (
frontend
): reactjs (with nextjs), currently only export to static site and hosted on s3 endpoint : https://dl4uq37pbr4d2.cloudfront.net/ (WIP)
- Install httpie for http request (it is more human friendly than curl):
pip install httpie
- Replace
tranthanhbao_tester@gmail.com
with your test email
- Register without/with password:
a. Without password
http POST https://zr0fxh86b0.execute-api.ap-southeast-1.amazonaws.com/api/auth/login email=tranthanhbao_tester@gmail.com
b. With password
http POST https://zr0fxh86b0.execute-api.ap-southeast-1.amazonaws.com/api/auth/login email=tranthanhbao_tester@gmail.com password=Abc123!@#
- Verify email:
http POST https://zr0fxh86b0.execute-api.ap-southeast-1.amazonaws.com/api/auth/verify_email email=tranthanhbao_tester@gmail.com confirmation_code=282484
- Resend confirmation code:
http POST https://zr0fxh86b0.execute-api.ap-southeast-1.amazonaws.com/api/auth/resend_confirmation email=tranthanhbao_tester@gmail.com
Note:
- email must be verified before login (cognito requirement)
- Reponse: tokens
a.Login withn password:
http POST https://zr0fxh86b0.execute-api.ap-southeast-1.amazonaws.com/api/auth/login email=tranthanhbao_tester@gmail.com password=Abc123!@#
b.Login without password (via otp code)
- Request otp
http POST https://zr0fxh86b0.execute-api.ap-southeast-1.amazonaws.com/api/auth/init_challenge email=tranthanhbao_tester@gmail.com
- Login with otp (otp code received from email and session_id = response from api
init_challenge
):
http POST https://zr0fxh86b0.execute-api.ap-southeast-1.amazonaws.com/api/auth/login_with_challenge email=tranthanhbao_tester@gmail.com challenge_answer=<otp_via_email> challenge_session_id=<response from init_challenge>