/flask-lambda-frontend

Frontend template by VueJS for Serverless

Primary LanguageVue

VueJS + Webpack Frontend for Content API by Serverless

Instration

Preparation

You need below

  • nodeJS >= v14.15.X

Setup about TinyMCE Editor

Set enviroment variables

  • Access to https://github.com/{your-account}/{repository-name}/settings/secrets/actions
  • Push "New repository secret"
  • Add Below
    • Common
      • AWS_ACCESS_KEY_ID : your-aws-access_key
      • AWS_SECRET_ACCESS_KEY : your-aws-secret_key
    • For Production
      • CLOUDFRONT_DISTRIBUTION : your cloudfront distribution created by terraform for production
      • S3_CONFIG_BUCKET: "frontend-configs/content-api-config-prd" for production
      • S3_RESOURCE_BUCKET: "your-domain-static-site.example.com" for production
    • For Develop
      • CLOUDFRONT_DISTRIBUTION_DEV : your cloudfront distribution created by terraform for develop
      • S3_CONFIG_BUCKET_DEV: "frontend-configs/content-api-config-dev" for develop
      • S3_RESOURCE_BUCKET_DEV: "your-domain-static-site-dev.example.com" for develop

Upload config file for frontend app

Edit config file

Basic config

cd (project_root_dir)
cp src/client/js/config/config.json.sample src/client/js/config/config.json
vi src/client/js/config/config.json
{
  "domain": "your-api-domain.example.com",
  "port": null,
  "baseUrl": "/",
  "isSSL": true,
  "siteName": "Sample Site",
  "adminAuthHeader": "Authorization",
  "adminAuthHeaderTokenPrefix": "Bearer",
  "tinyMCEApiKey": "Set TinyMCE API-Key of your account"
}

AWS Cognito config (If use admin functions)

cp src/client/js/config/cognito-client-config.json.sample src/client/js/config/cognito-client-config.json
vi src/client/js/config/cognito-client-config.json
{
  "Region": "ap-northeast-1",
  "UserPoolId": "ap-northeast-1_xxxxxxxxx",
  "ClientId": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
  "IdentityPoolId": "ap-northeast-1:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Upload S3 Bucket named "content-api-config-hoge"

Deploy continually on pushed to git