Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/serverless-components/tencent-fullstack
Full stack application template using multiple components
https://github.com/serverless-components/tencent-fullstack
Last synced: about 4 hours ago
JSON representation
Full stack application template using multiple components
- Host: GitHub
- URL: https://github.com/serverless-components/tencent-fullstack
- Owner: serverless-components
- License: mit
- Created: 2020-04-15T09:57:55.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-07T06:51:18.000Z (about 4 years ago)
- Last Synced: 2024-12-22T10:13:34.980Z (about 2 months ago)
- Language: Vue
- Size: 2.93 MB
- Stars: 16
- Watchers: 7
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.en.md
- License: LICENSE
Awesome Lists containing this project
- awesome-serverless-framework - tencent-fullstack - (开发模板)
README
!!!This project had been moved to https://github.com/serverless-components/tencent-examples/tree/master/fullstack
# fullstack-serverless-db
This is a template of serverless fullstack application. 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 using
postgresql.This template includes:
- **Serverless RESTful API**: Using
[@serverless/tencent-express](https://github.com/serverless-components/tencent-express/tree/v2)
component, it contains a Servelress Cloud Function and a single API Gateway
endpoint.- **Serverless website using Vue.js**:
[@serverless/tencent-website](https://github.com/serverless-components/tencent-website/tree/v2),
it deploys all static files to Cloud Object Storage.- **Serverless Postgresql**:
[@serverless/tencent-postgresql](https://github.com/serverless-components/tencent-postgresql/tree/v2),
it auto create a postgresql database for backend using.
1. [Prepare](#Prepare)
2. [Download](#Download)
3. [Bootstrap](#Bootstrap)
4. [Deploy](#Deploy)
5. [Development](#Development)
### Prepare
Before all below steps, you should install
[Serverless Framework](https://www.github.com/serverless/serverless) globally:```bash
$ npm i serverless -g
```### Download
Severless cli is very convenient, it can download templates in any github
project which should contain `serverless.yml` file.```bash
$ serverless create --template-url https://github.com/serverless-components/tencent-fullstack
```### Bootstrap
Copy `.env.example` file to `.env` in project root:
Add the access keys of a
[Tencent CAM Role](https://console.cloud.tencent.com/cam/capi) with
`AdministratorAccess` in the `.env` file, like below:```dotenv
# .env
TENCENT_SECRET_ID=xxx
TENCENT_SECRET_KEY=xxx# change to your requirement
REGION=ap-guangzhou
ZONE=ap-guangzhou-2
VPC_ID=vpc-xxx
SUBNET_ID=subnet-xxx
```Install the NPM dependencies:
```bash
$ npm run bootstrap
```### Support commands
Deploy:
```bash
$ sls deploy --allserverless ⚡ framework
serverlessVpc:
region: ap-guangzhou
zone: ap-guangzhou-2
vpcId: vpc-xxx
vpcName: serverless
subnetId: subnet-xxx
subnetName: serverlessfullstackDB:
region: ap-guangzhou
zone: ap-guangzhou-2
vpcConfig:
subnetId: subnet-100000
vpcId: vpc-1000000
dBInstanceName: fullstackDB
dBInstanceId: postgres-100000
private:
connectionString: postgresql://[email protected]:5432/tencentdb_1000000
host: 172.16.250.15
port: 5432
user: tencentdb_100000
password: xxxxxxxx
dbname: tencentdb_100000fullstack-api:
region: ap-guangzhou
apigw:
serviceId: service-100000
subDomain: service-100000-123456789.gz.apigw.tencentcs.com
environment: release
url: https://service-100000-123456789.gz.apigw.tencentcs.com/release/
scf:
functionName: fullstack-api
runtime: Nodejs10.15
namespace: defaultfullstack-frontend:
website: https://fullstack-serverless-db-123456789.cos-website.ap-guangzhou.myqcloud.com50s › tencent-fullstack › Success
```Get deploy info:
```bash
$ npm run info
> [email protected] info /root/tencent-fullstack
> npm run info:vpc && npm run info:db && npm run info:api && npm run info:frontend> [email protected] info:vpc /Users/yugasun/Desktop/Develop/@yugasun/tencent-fullstack
> sls info --target=./vpcserverless ⚡ framework
Status: active
Last Action: deploy (5 minutes ago)
Deployments: 1region: ap-guangzhou
zone: ap-guangzhou-2
vpcId: vpc-xxx
vpcName: serverless
subnetId: subnet-xxx
subnetName: serverlessserverlessVpc › Info successfully loaded
> [email protected] info:db /root/tencent-fullstack
> sls info --target=./dbserverless ⚡ framework
Status: active
Last Action: deploy (3 minutes ago)
Deployments: 18region: ap-guangzhou
zone: ap-guangzhou-2
vpcConfig:
subnetId: subnet-100000
vpcId: vpc-1000000
dBInstanceName: fullstackDB
dBInstanceId: postgres-100000
private:
connectionString: postgresql://[email protected]:5432/tencentdb_100000
host: 172.16.250.15
port: 5432
user: tencentdb_1000000
password: xxxxxxxxx
dbname: tencentdb_1000000fullstackDB › Info successfully loaded
> [email protected] info:api /root/tencent-fullstack
> sls info --target=./apiserverless ⚡ framework
Status: active
Last Action: deploy (2 minutes ago)
Deployments: 10region: ap-guangzhou
apigw:
serviceId: service-1000000
subDomain: service-1000000-123456789.gz.apigw.tencentcs.com
environment: release
url: https://service-100000-123456789.gz.apigw.tencentcs.com/release/
scf:
functionName: fullstack-api
runtime: Nodejs10.15
namespace: defaultfullstack-api › Info successfully loaded
> [email protected] info:frontend /root/tencent-fullstack
> sls info --target=./frontendserverless ⚡ framework
Status: active
Last Action: deploy (2 minutes ago)
Deployments: 9website: https://fullstack-serverless-db-123456789.cos-website.ap-guangzhou.myqcloud.com
fullstack-frontend › Info successfully loaded
```Remove:
```bash
$ sls remove --allserverless ⚡ framework
38s › tencent-fullstack › Success
```### License
MIT
```
```