yugasun / serverless-ran

:zap: serverless-ran! Serverless . React . GraphQL . Next.js Toolkit :zap: - SEO-Ready, Production-Ready, SSR, Hot-Reload, CSS-in-JS, Caching, CLI commands and more...

Home Page:https://service-74whi6qw-1251556596.gz.apigw.tencentcs.com/release/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RAN

serverless-ran

Fork by ran, and integrated with Serverless Framework.

Features

  • Integrated with Serverless Framework

  • Hot-Reload Ready for Dev

  • Next Generation JavaScript (ES6)

  • Offline Ready (Experimental!)

  • Next Generation CSS (CSS-in-JS)

  • Create New Page in a Second (with CLI)

  • SEO-Ready

  • Performance-first

  • Production Deployment Ready for Now, Digital Ocean, Heroku, and AWS

  • Prettier and ESLint integrated

How to use

  • Firstly, clone the repo with this command.
git clone --depth=1 https://github.com/yugasun/serverless-ran.git serverless-ran
cd serverless-ran
yarn
  • If you are not using Yarn, just run npm install instead of yarn
  • After everything is finished, run yarn dev (or npm run dev)

And that's all!

Deploy to Tencent Cloud

This project using serverless component tencnet-nextjs to deploy.

Install Serverless

Install the Serverless Framework globally:

$ npm install -g serverless

Create .env file (optional)

In project root, create the following simple boilerplate:

$ touch .env           # your Tencent api keys

Add the access keys of a Tencent CAM Role with AdministratorAccess in the .env file, using this format:

# .env
TENCENT_SECRET_ID=XXX
TENCENT_SECRET_KEY=XXX

If you don't have a Tencent Cloud account, you could sign up first

Configure serverless.yml

# serverless.yml
ServerlessRan:
  component: '@serverless/tencent-nextjs'
  inputs:
    functionName: serverless-ran
    region: ap-guangzhou
    code: ./
    functionConf:
      timeout: 30
      memorySize: 256
    environment:
      variables:
        NODE_ENV: production
    apigatewayConf:
      protocols:
        - http
        - https
      environment: release

Run Deploy

$ sls --debug

Notice: sls is short for serverless command.

Remove

$ sls remove --debug

Clean Setup (without example pages & components)

git clone --depth=1 https://github.com/yugasun/serverless-ran.git RAN
cd RAN
yarn && yarn setup:clean

Example

Click here to see example project to understand how RAN! works on production. I used graph.cool service for GraphQL and now for hosting in the example.

Commands

Best feature of RAN! is CL commands. You can just run one command to create page with route! Click here to see details how It works on RAN!.

YAY YAYY

Documentation

Click here to see all details of RAN!

FAQ

Click here for FAQ of RAN! If it doesn't solve your problem, feel free to open an issue on GitHub!

License

Copyright (c) 2020 Yuga Sun

About

:zap: serverless-ran! Serverless . React . GraphQL . Next.js Toolkit :zap: - SEO-Ready, Production-Ready, SSR, Hot-Reload, CSS-in-JS, Caching, CLI commands and more...

https://service-74whi6qw-1251556596.gz.apigw.tencentcs.com/release/

License:Other


Languages

Language:JavaScript 96.3%Language:HTML 3.2%Language:Shell 0.5%