Skip to content
Branch: master
Find file History

Latest commit

Latest commit 83b082e Feb 14, 2020

Files

Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
backend
frontend
scripts
.env.example feat: add admin system Feb 14, 2020
README.md
package.json
serverless.yml

README.md

Admin System

Demo

This is a serverless fullstack application, using Express.js + Vue.js. It aims to be the simplest possible way to build a serverless fullstack application, including a Vue.js application on the front-end bundled with Parcel and back-end API.

This template includes:

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 which should contain serverless.yml file.

$ serverless create --template-url https://github.com/yugasun/tencent-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
TENCENT_APP_ID=xxx

Install the NPM dependencies:

$ npm run bootstrap

Deploy

Deploy via the serverless command:

$ serverless

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

$ serverless --debug

Notice: After deploy success, please copy the postgressql private url to api/.env file.

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 integrated cloud db connection, you should create a mysql instance on tencent cloud, please refer to official docs:

中文

After you create a mysql instance, you should create a .env file in api folder, and set all required parameters like .env.example.

License

MIT

You can’t perform that action at this time.