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.
Before all below steps, you should install Serverless Framework globally:
$ npm i serverless -g
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
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 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
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
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
.
MIT