Skip to content

Files

Latest commit

b8259b4 · Aug 30, 2020

History

History

admin-system

Admin System

Demo

This is an admin system developed by Serverless Components.

This template includes:

  • Serverless RESTful API: Using @serverless/tencent-egg component, it contains a Servelress Cloud Function and a single API Gateway endpoint.

  • Serverless website using Vue.js: @serverless/tencent-website, it deploys all static files to Cloud Object Storage, and config CDN domain.

Notice: The frontend project is initialed by @vue/cli which is official standard tooling for Vue.js development.

Content

  1. Prepare
  2. Download
  3. Bootstrap
  4. Deploy
  5. Development

Prepare

Before all below steps, you should install Serverless Framework globally:

$ npm i serverless -g

Download

Severless cli is very convenient, it can download templates in any github project.

$ serverless create --template-url https://github.com/yugasun/serverless-demo/tree/master/admin-system

Bootstrap

Copy .env.example file to .env in project root:

Add the access keys of a Tencent CAM Role with AdministratorAccess in the .env file, like below:

# .env
TENCENT_SECRET_ID=xxx
TENCENT_SECRET_KEY=xxx

VPC_ID=xxx
SUBNET_ID=xxx

Install the NPM dependencies:

$ npm run bootstrap

Deploy

Deploy via the serverless command:

$ serverless deploy

Use the --debug flag if you'd like to learn what's happening behind the scenes:

$ serverless deploy --debug

Development

After your first deployment, you will be able to run the frontend locally and have it communicate to the live backend in the cloud.

$ yarn start

Notice

Because this project, you should create a MySQL and Redis on Tencent Cloud.

And you should create a .env file in backend folder, and set all required parameters like .env.example.

License

MIT