An excellent general-purpose, middle and back-end front-end - vue-admin-beautiful

vue-admin-beautiful An excellent general-purpose, middle and back-end front-end framework based on vue+element-uiAn excellent general-purpose, middle and background front-end framework based on Vue + element UI

Demo address

๐Ÿš€ Demo address: vue-admin-beautiful (Seamless switching between horizontal and vertical layout)

๐Ÿš€ Demo address: vue-admin-beautiful (Seamless switching between horizontal and vertical layout)

๐Ÿš€ Domestic backup address: vue-admin-beautiful

๐Ÿš€ English backup address:vue-admin-beautiful

Cross-platform effect demonstration

๐Ÿš€ Demo address: vue-admin-beautiful

installation

# Cloning project
git clone https://github.com/chuzhixin/vue-admin-beautiful.git
# Into the project directory 
cd VUE-ADMIN-Beautiful
 # install dependencies
above sea level and
# Local development projects started 
npm run serve

install

# Clone project
git clone https://github.com/chuzhixin/vue-admin-beautiful.git
# Enter project directory
cd vue-admin-beautiful
# Installation dependency
above sea level and
# Start project
npm run serve

Links

uView document (awesome move across the end of the frame, the document detailed, easy to get started)

uView Open Source Address (uView UI, UI is an excellent framework for uni-app ecology, comprehensive set of components and convenient tools let you come in handy, like a duck)

the Element form design and the UI code generator (visual form designer, form a key generation element)

Luch-Request (based Promise developed uni-app cross-platform, project-level request library, which has a smaller size, easy to use api, convenient and simple customization capabilities)

PL-perfect solution to the Table element ten thousand tabular data rendering issues Caton

vue-admin-beautiful front-end discussion group-1 972435319

No matter you add it or not, you can enjoy the open source code. Thank you for your support and trust. The group provides the basic version of vue-admin-beautiful-template and detailed basic usage documents. It is suitable for the framework to get started quickly.

setting.js configuration

/** 
* @copyright chuzhixin 1204505056@qq.com 
* @description global variable configuration 
*/ 
module . exports  =  { 
  // URL 
  during development and deployment publicPath : "" , 
  // The directory name of the production environment build file 
  outputDir : " dist" , 
  // The directory (relative to outputDir) where the generated static resources (js, css, img, fonts) are placed. 
  assetsDir : "static" , 
  // Whether to output eslint compilation warning every time the development environment is saved 
  lintOnSave : true , 
  // compile dependencies 
  transpileDependencies : [ "vue-echarts" ,  "resize-detector",  "zx-layouts" ] , 
  // If the default interface address is vab-mock-server for development environment and production environment, of course you can also choose to configure your own interface address 
  baseURL :
     process . env . NODE_ENV  ===  "development"  ||  process . env . NODE_ENV  ===  "preview" 
      ? "vab-mock-server" 
      : "http://your.website.com" , 
  //Title (including the title page of the first loaded 
  Snowscreen Title browser title) title : "vue-admin-beautiful" , 
  // 
  abbreviation : "vab" , 
  //development environment port number 
  devPort :"80", 
  // version number 
  Version : Process . Env . VUE_APP_VERSION , 
  // please retain the package.json authors retain copyright information free of commercial 
  Copyright : Process . Env . VUE_APP_AUTHOR , 
  // whether to show the bottom of the page copyright information, it is recommended that you show, of course, your You can also choose not to display, whether you are a paid user or an unpaid user, you have the right to choose to display or not to display 
  footerCopyright : process . Env . NODE_ENV !== "development" ? True : false , 
  //Whether to display the upper right corner github Icon 
  githubCorner : process . Env . NODE_ENV!== "development" ? true : false , 
  //Whether to display the top progress bar 
  progressBar : true , 
  //Maximum number of cached routes 
  keepAliveMaxNum : 99 , 
  // Route mode, optional value is history or hash 
  routerMode : "hash" , 
  // 
  RoutesWhiteList without token verification : [ "/login" ,  "/register" ,  "/404" ,  "/401" ] , 
  //Display text when loading 
  loadingText : "Loading..." , 
  //token name 
  tokenName : "accessToken", 
  //The name of the key stored by the token in localStorage, sessionStorage, and cookie 
  tokenTableName : "vue-admin-beautiful" , 
  // 
  Token storage location localStorage sessionStorage cookie storage : "localStorage" , 
  //Whether the token is invalidated and returned to the login page Record this route 
  recordRoute : true , 
  //Whether to display the logo, set false when it is not displayed, fill in the remixIcon icon name when displaying it, temporarily only support remixIcon 
  logo : "vuejs-fill" , 
  //Whether the national header is fixed fixed NoFixed 
  header : "fixed" , 
  //horizontal vertical 
  layout : "vertical" , 
  //whether to enable the theme configuration button 
  themeBar : true, 
  //Whether to display the multi-tab page 
  tagsBar : true , 
  //Whether to display the skeleton screen 
  skeleton : false , 
  //With back-end data receiving method application/json;charset=UTF-8 or application/x-www-form-urlencoded ;charset=UTF-8 
  contentType : "application/json;charset=UTF-8" , 
  //The disappearing time of the message box 
  messageDuration : 3000 , 
  //The longest request time 
  requestTimeout : 5000 , 
  //Operation is normal code 
  successCode : 200 , 
  / /Login invalid code 
  invalidCode : 402 , 
  //No permission code 
  noPermissionCode : 401, 
  //Whether to display the highlight error on the page 
  errorLog : [ "development" ,  "test" ,  "production" ] , 
  //Whether to enable login interception 
  loginInterception : true , 
  //Whether to enable login RSA encryption 
  loginRSA : false , 
  // 
  Yes Generate webstorm HTTP Request request file httpRequestFile : false , 
  //intelligence and all 
  based on mock data . The former back-end permissions only control permissions and not the import of view files (front-end and back-end cooperation to reduce back-end workload), the all method is complete Handed over to the back-end front-end is only responsible for loading authentication : "intelligence" , 
  //Whether to keep only one sub-menu expanded 
  during the vertical layout uniqueOpened : true ,
  //The menu path that is expanded by default during vertical layout. It is recommended to expand only one 
  defaultOopeneds separated by a comma : [ "/vab" ] , 
  //The request to add a loading layer is required to prevent repeated submission of 
  debounce : [ "doEdit" ] , 
  // The module 
  providePlugin that needs to be automatically injected and loaded : {  maptalks : "maptalks" ,  "window.maptalks" : "maptalks"  } , 
  //Whether the 7z compressed package is automatically generated when npm run build 
  build7z : false , 
  //The code generator is generated in The name of the folder under view 
  templateFolder : "project" , 
} ;

variables.scss configuration

  • Note: Here you can modify the color scheme of your project, simple modification can achieve a big change in style.
  • Location: src/styles/variables.scss
  • Note: This may not be the latest code, you can check the latest variables.scss configuration on github
/* * 
* @copyright chuzhixin 1204505056@qq.com 
* @description Global theme variable configuration, the VIP document provides a variety of beautiful color schemes (ant-design style, layui style, iview style), please check the VIP document theme configuration article 
*/ /* stylelint-disable */ @charset " utf-8 " ;
 // Frame default theme color $base-color-default : #1890ff ;
 // Default level $base-z-index : 999 ;
 // Horizontal layout Menu background color in vertical layout $base-menu-background : #001529 ;
 // Menu text color $base-menu-color : hsla ( 0 , 0 % 

, 100 % , 0.95 );
 // Menu selected text color 
$base-menu-color-active : hsla ( 0 , 0 % , 100 % , 0.95 );
 // Menu selected background color 
$base-menu-background-active : $base-color-default ;
 // title color 
$base-title-color : #fff ;
 // font size configuration 
$base-font-size-small : 12 px ;
 $base-font-size-default : 14 px ;
$base-font-size-big: 16px;
$base-font-size-bigger: 18px;
$base-font-size-max: 22px;
$base-font-color: #606266;
$base-color-blue: $base-color-default;
$base-color-green: #13ce66;
$base-color-white: #fff;
$base-color-black: #000;
$base-color-yellow: #ffba00;
$base-color-orange: #ff6700;
$base-color-red : #ff4d4f ;
 $base-color-gray : rgba ( 0 , 0 , 0 , 0.65 );
 $base-main-width : 1279 px ;
 $base-border-radius : 2 px ;
 $base -border-color : #dcdfe6 ;
 // input box height 
$base-input-height : 32 px ;
 // default paddiing 
$base-padding : 20 px ;
 // default shadow 
$base-box-shadow :0  1 px  4 px  rgba ( 0 , 21 , 41 , 0.08 );
 // The height of top-bar, logo and first-level menu in horizontal layout 
$base-top-bar-height : 65 px ;
 // logo in vertical layout The height of 
$base-logo-height : 75 px ;
 // the height of the nav-bar at the top 
$base-nav-bar-height : 60 px ;
 // the height of the tags-bar of the top multi-tab page 
$base-tags-bar- height : 55 px ;
 // The height of each item in the tags-bar of the top multi-tab page 
$base-tag-item-height: 34 px ;
 // The height of the menu li label 
$base-menu-item-height : 50 px ;
 // The height of the app-main 
$base-app-main-height : calc (
  100vh - #{$base-nav-bar-height} - #{$base-tags-bar-height} -
    #{$base-padding} - #{$base-padding} - 55px - 30px
);
// The width of the left navigation when the left navigation is not collapsed in the vertical layout 
$base-left-menu-width : 230 px ;
 // The width of the right content when the left navigation is not collapsed in the vertical layout 
$base-right-content-width : calc ( 100 %  -  #{ $base-left-menu-width } );
 //The 
width when the left navigation is folded in vertical layout $base-left-menu-width-min : 65 px ;
 //In vertical layout The width of the right content when the left navigation is collapsed 
$base-right-content-width-min : calc ( 100 %  -  #{ $base-left-menu-width-min } );
 // default animation 
$base-transition: all  0.2 s ;
 // default animation duration 
$base-transition-time : 0.2 s ;

:export {
  // Export the 
  menu text color variable menu-color : $base-menu-color ;
   // Export the 
  menu selected text color variable menu-color-active : $base-menu-color-active ;
   // Export the menu background color variable 
  menu- background : $base-menu-background ;
   // Export the background color variable of the menu selected 
  menu-background-active : $base-menu-background-active ;
   // Export the background color variable of the multi-tab page 
  tag-background-active : $base -color-blue ;
   //The default button background color variable export 
  button-background : $base-color-blue ;
   // Paging selected background color variable export
  pagination-background-active: $base-color-blue;
}

element-ui component size configuration

  • Note: You can modify the size of your element-ui component here. The size of the element-ui component is divided into large, default, small, and mini. The project uses small by default.
  • Location: src/plugins/element.js
  • Sample code:
import Vue from "vue";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/display.css";

import "@/styles/element-variables.scss";

Vue . Use ( ElementUI ,  { 
  size : "small" ,  // The size of element-ui components is divided into large, default, small, mini 
} ) ;

Paid technical support, business cooperation

Contact: QQ 1204505056

Donate

img

GitHub Biaoxing growth statistics

Stargazers over time

Developer rating

chuzhixin's github stats

Statement on the framework

The framework is free for commercial use on the premise that the authorโ€™s copyright information is reserved. All the code of the framework includes the source code content in the npm package is free and open. If you are willing to support me or want to become your own copyright information, you need to pay 299 If you are willing to join the VIP group to study, you need to pay 100 yuan. This is all on your voluntary basis. If you feel that the framework is worthless, please skip it directly, raise your hands and let me go, donโ€™t maliciously write bad reviews. I hope that everyone who uses vue-admin-beautiful will have a happy ending no matter what the process is. Contact QQ 1204505056

vue-admin-beautiful front-end discussion group-2 1139183756

No matter you add it or not, you can enjoy the open source code. Thank you for your support and trust. The group provides the basic version of vue-admin-beautiful-template and detailed basic usage documents. It is suitable for the framework to get started quickly.

Download Details:

Author: chuzhixin

Live Demo: https://chu1204505056.gitee.io/vue-admin-beautiful/#/

GitHub: https://github.com/chuzhixin/vue-admin-beautiful

#vuejs #vue #vue-js #javascript

What is GEEK

Buddha Community

An excellent general-purpose, middle and back-end front-end - vue-admin-beautiful
Hermann  Frami

Hermann Frami

1651383480

A Simple Wrapper Around Amplify AppSync Simulator

This serverless plugin is a wrapper for amplify-appsync-simulator made for testing AppSync APIs built with serverless-appsync-plugin.

Install

npm install serverless-appsync-simulator
# or
yarn add serverless-appsync-simulator

Usage

This plugin relies on your serverless yml file and on the serverless-offline plugin.

plugins:
  - serverless-dynamodb-local # only if you need dynamodb resolvers and you don't have an external dynamodb
  - serverless-appsync-simulator
  - serverless-offline

Note: Order is important serverless-appsync-simulator must go before serverless-offline

To start the simulator, run the following command:

sls offline start

You should see in the logs something like:

...
Serverless: AppSync endpoint: http://localhost:20002/graphql
Serverless: GraphiQl: http://localhost:20002
...

Configuration

Put options under custom.appsync-simulator in your serverless.yml file

| option | default | description | | ------------------------ | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | | apiKey | 0123456789 | When using API_KEY as authentication type, the key to authenticate to the endpoint. | | port | 20002 | AppSync operations port; if using multiple APIs, the value of this option will be used as a starting point, and each other API will have a port of lastPort + 10 (e.g. 20002, 20012, 20022, etc.) | | wsPort | 20003 | AppSync subscriptions port; if using multiple APIs, the value of this option will be used as a starting point, and each other API will have a port of lastPort + 10 (e.g. 20003, 20013, 20023, etc.) | | location | . (base directory) | Location of the lambda functions handlers. | | refMap | {} | A mapping of resource resolutions for the Ref function | | getAttMap | {} | A mapping of resource resolutions for the GetAtt function | | importValueMap | {} | A mapping of resource resolutions for the ImportValue function | | functions | {} | A mapping of external functions for providing invoke url for external fucntions | | dynamoDb.endpoint | http://localhost:8000 | Dynamodb endpoint. Specify it if you're not using serverless-dynamodb-local. Otherwise, port is taken from dynamodb-local conf | | dynamoDb.region | localhost | Dynamodb region. Specify it if you're connecting to a remote Dynamodb intance. | | dynamoDb.accessKeyId | DEFAULT_ACCESS_KEY | AWS Access Key ID to access DynamoDB | | dynamoDb.secretAccessKey | DEFAULT_SECRET | AWS Secret Key to access DynamoDB | | dynamoDb.sessionToken | DEFAULT_ACCESS_TOKEEN | AWS Session Token to access DynamoDB, only if you have temporary security credentials configured on AWS | | dynamoDb.* | | You can add every configuration accepted by DynamoDB SDK | | rds.dbName | | Name of the database | | rds.dbHost | | Database host | | rds.dbDialect | | Database dialect. Possible values (mysql | postgres) | | rds.dbUsername | | Database username | | rds.dbPassword | | Database password | | rds.dbPort | | Database port | | watch | - *.graphql
- *.vtl | Array of glob patterns to watch for hot-reloading. |

Example:

custom:
  appsync-simulator:
    location: '.webpack/service' # use webpack build directory
    dynamoDb:
      endpoint: 'http://my-custom-dynamo:8000'

Hot-reloading

By default, the simulator will hot-relad when changes to *.graphql or *.vtl files are detected. Changes to *.yml files are not supported (yet? - this is a Serverless Framework limitation). You will need to restart the simulator each time you change yml files.

Hot-reloading relies on watchman. Make sure it is installed on your system.

You can change the files being watched with the watch option, which is then passed to watchman as the match expression.

e.g.

custom:
  appsync-simulator:
    watch:
      - ["match", "handlers/**/*.vtl", "wholename"] # => array is interpreted as the literal match expression
      - "*.graphql"                                 # => string like this is equivalent to `["match", "*.graphql"]`

Or you can opt-out by leaving an empty array or set the option to false

Note: Functions should not require hot-reloading, unless you are using a transpiler or a bundler (such as webpack, babel or typescript), un which case you should delegate hot-reloading to that instead.

Resource CloudFormation functions resolution

This plugin supports some resources resolution from the Ref, Fn::GetAtt and Fn::ImportValue functions in your yaml file. It also supports some other Cfn functions such as Fn::Join, Fb::Sub, etc.

Note: Under the hood, this features relies on the cfn-resolver-lib package. For more info on supported cfn functions, refer to the documentation

Basic usage

You can reference resources in your functions' environment variables (that will be accessible from your lambda functions) or datasource definitions. The plugin will automatically resolve them for you.

provider:
  environment:
    BUCKET_NAME:
      Ref: MyBucket # resolves to `my-bucket-name`

resources:
  Resources:
    MyDbTable:
      Type: AWS::DynamoDB::Table
      Properties:
        TableName: myTable
      ...
    MyBucket:
      Type: AWS::S3::Bucket
      Properties:
        BucketName: my-bucket-name
    ...

# in your appsync config
dataSources:
  - type: AMAZON_DYNAMODB
    name: dynamosource
    config:
      tableName:
        Ref: MyDbTable # resolves to `myTable`

Override (or mock) values

Sometimes, some references cannot be resolved, as they come from an Output from Cloudformation; or you might want to use mocked values in your local environment.

In those cases, you can define (or override) those values using the refMap, getAttMap and importValueMap options.

  • refMap takes a mapping of resource name to value pairs
  • getAttMap takes a mapping of resource name to attribute/values pairs
  • importValueMap takes a mapping of import name to values pairs

Example:

custom:
  appsync-simulator:
    refMap:
      # Override `MyDbTable` resolution from the previous example.
      MyDbTable: 'mock-myTable'
    getAttMap:
      # define ElasticSearchInstance DomainName
      ElasticSearchInstance:
        DomainEndpoint: 'localhost:9200'
    importValueMap:
      other-service-api-url: 'https://other.api.url.com/graphql'

# in your appsync config
dataSources:
  - type: AMAZON_ELASTICSEARCH
    name: elasticsource
    config:
      # endpoint resolves as 'http://localhost:9200'
      endpoint:
        Fn::Join:
          - ''
          - - https://
            - Fn::GetAtt:
                - ElasticSearchInstance
                - DomainEndpoint

Key-value mock notation

In some special cases you will need to use key-value mock nottation. Good example can be case when you need to include serverless stage value (${self:provider.stage}) in the import name.

This notation can be used with all mocks - refMap, getAttMap and importValueMap

provider:
  environment:
    FINISH_ACTIVITY_FUNCTION_ARN:
      Fn::ImportValue: other-service-api-${self:provider.stage}-url

custom:
  serverless-appsync-simulator:
    importValueMap:
      - key: other-service-api-${self:provider.stage}-url
        value: 'https://other.api.url.com/graphql'

Limitations

This plugin only tries to resolve the following parts of the yml tree:

  • provider.environment
  • functions[*].environment
  • custom.appSync

If you have the need of resolving others, feel free to open an issue and explain your use case.

For now, the supported resources to be automatically resovled by Ref: are:

  • DynamoDb tables
  • S3 Buckets

Feel free to open a PR or an issue to extend them as well.

External functions

When a function is not defined withing the current serverless file you can still call it by providing an invoke url which should point to a REST method. Make sure you specify "get" or "post" for the method. Default is "get", but you probably want "post".

custom:
  appsync-simulator:
    functions:
      addUser:
        url: http://localhost:3016/2015-03-31/functions/addUser/invocations
        method: post
      addPost:
        url: https://jsonplaceholder.typicode.com/posts
        method: post

Supported Resolver types

This plugin supports resolvers implemented by amplify-appsync-simulator, as well as custom resolvers.

From Aws Amplify:

  • NONE
  • AWS_LAMBDA
  • AMAZON_DYNAMODB
  • PIPELINE

Implemented by this plugin

  • AMAZON_ELASTIC_SEARCH
  • HTTP
  • RELATIONAL_DATABASE

Relational Database

Sample VTL for a create mutation

#set( $cols = [] )
#set( $vals = [] )
#foreach( $entry in $ctx.args.input.keySet() )
  #set( $regex = "([a-z])([A-Z]+)")
  #set( $replacement = "$1_$2")
  #set( $toSnake = $entry.replaceAll($regex, $replacement).toLowerCase() )
  #set( $discard = $cols.add("$toSnake") )
  #if( $util.isBoolean($ctx.args.input[$entry]) )
      #if( $ctx.args.input[$entry] )
        #set( $discard = $vals.add("1") )
      #else
        #set( $discard = $vals.add("0") )
      #end
  #else
      #set( $discard = $vals.add("'$ctx.args.input[$entry]'") )
  #end
#end
#set( $valStr = $vals.toString().replace("[","(").replace("]",")") )
#set( $colStr = $cols.toString().replace("[","(").replace("]",")") )
#if ( $valStr.substring(0, 1) != '(' )
  #set( $valStr = "($valStr)" )
#end
#if ( $colStr.substring(0, 1) != '(' )
  #set( $colStr = "($colStr)" )
#end
{
  "version": "2018-05-29",
  "statements":   ["INSERT INTO <name-of-table> $colStr VALUES $valStr", "SELECT * FROM    <name-of-table> ORDER BY id DESC LIMIT 1"]
}

Sample VTL for an update mutation

#set( $update = "" )
#set( $equals = "=" )
#foreach( $entry in $ctx.args.input.keySet() )
  #set( $cur = $ctx.args.input[$entry] )
  #set( $regex = "([a-z])([A-Z]+)")
  #set( $replacement = "$1_$2")
  #set( $toSnake = $entry.replaceAll($regex, $replacement).toLowerCase() )
  #if( $util.isBoolean($cur) )
      #if( $cur )
        #set ( $cur = "1" )
      #else
        #set ( $cur = "0" )
      #end
  #end
  #if ( $util.isNullOrEmpty($update) )
      #set($update = "$toSnake$equals'$cur'" )
  #else
      #set($update = "$update,$toSnake$equals'$cur'" )
  #end
#end
{
  "version": "2018-05-29",
  "statements":   ["UPDATE <name-of-table> SET $update WHERE id=$ctx.args.input.id", "SELECT * FROM <name-of-table> WHERE id=$ctx.args.input.id"]
}

Sample resolver for delete mutation

{
  "version": "2018-05-29",
  "statements":   ["UPDATE <name-of-table> set deleted_at=NOW() WHERE id=$ctx.args.id", "SELECT * FROM <name-of-table> WHERE id=$ctx.args.id"]
}

Sample mutation response VTL with support for handling AWSDateTime

#set ( $index = -1)
#set ( $result = $util.parseJson($ctx.result) )
#set ( $meta = $result.sqlStatementResults[1].columnMetadata)
#foreach ($column in $meta)
    #set ($index = $index + 1)
    #if ( $column["typeName"] == "timestamptz" )
        #set ($time = $result["sqlStatementResults"][1]["records"][0][$index]["stringValue"] )
        #set ( $nowEpochMillis = $util.time.parseFormattedToEpochMilliSeconds("$time.substring(0,19)+0000", "yyyy-MM-dd HH:mm:ssZ") )
        #set ( $isoDateTime = $util.time.epochMilliSecondsToISO8601($nowEpochMillis) )
        $util.qr( $result["sqlStatementResults"][1]["records"][0][$index].put("stringValue", "$isoDateTime") )
    #end
#end
#set ( $res = $util.parseJson($util.rds.toJsonString($util.toJson($result)))[1][0] )
#set ( $response = {} )
#foreach($mapKey in $res.keySet())
    #set ( $s = $mapKey.split("_") )
    #set ( $camelCase="" )
    #set ( $isFirst=true )
    #foreach($entry in $s)
        #if ( $isFirst )
          #set ( $first = $entry.substring(0,1) )
        #else
          #set ( $first = $entry.substring(0,1).toUpperCase() )
        #end
        #set ( $isFirst=false )
        #set ( $stringLength = $entry.length() )
        #set ( $remaining = $entry.substring(1, $stringLength) )
        #set ( $camelCase = "$camelCase$first$remaining" )
    #end
    $util.qr( $response.put("$camelCase", $res[$mapKey]) )
#end
$utils.toJson($response)

Using Variable Map

Variable map support is limited and does not differentiate numbers and strings data types, please inject them directly if needed.

Will be escaped properly: null, true, and false values.

{
  "version": "2018-05-29",
  "statements":   [
    "UPDATE <name-of-table> set deleted_at=NOW() WHERE id=:ID",
    "SELECT * FROM <name-of-table> WHERE id=:ID and unix_timestamp > $ctx.args.newerThan"
  ],
  variableMap: {
    ":ID": $ctx.args.id,
##    ":TIMESTAMP": $ctx.args.newerThan -- This will be handled as a string!!!
  }
}

Requires

Author: Serverless-appsync
Source Code: https://github.com/serverless-appsync/serverless-appsync-simulator 
License: MIT License

#serverless #sync #graphql 

Generis: Versatile Go Code Generator

Generis

Versatile Go code generator.

Description

Generis is a lightweight code preprocessor adding the following features to the Go language :

  • Generics.
  • Free-form macros.
  • Conditional compilation.
  • HTML templating.
  • Allman style conversion.

Sample

package main;

// -- IMPORTS

import (
    "html"
    "io"
    "log"
    "net/http"
    "net/url"
    "strconv"
    );

// -- DEFINITIONS

#define DebugMode
#as true

// ~~

#define HttpPort
#as 8080

// ~~

#define WriteLine( {{text}} )
#as log.Println( {{text}} )

// ~~

#define local {{variable}} : {{type}};
#as var {{variable}} {{type}};

// ~~

#define DeclareStack( {{type}}, {{name}} )
#as
    // -- TYPES

    type {{name}}Stack struct
    {
        ElementArray []{{type}};
    }

    // -- INQUIRIES

    func ( stack * {{name}}Stack ) IsEmpty(
        ) bool
    {
        return len( stack.ElementArray ) == 0;
    }

    // -- OPERATIONS

    func ( stack * {{name}}Stack ) Push(
        element {{type}}
        )
    {
        stack.ElementArray = append( stack.ElementArray, element );
    }

    // ~~

    func ( stack * {{name}}Stack ) Pop(
        ) {{type}}
    {
        local
            element : {{type}};

        element = stack.ElementArray[ len( stack.ElementArray ) - 1 ];

        stack.ElementArray = stack.ElementArray[ : len( stack.ElementArray ) - 1 ];

        return element;
    }
#end

// ~~

#define DeclareStack( {{type}} )
#as DeclareStack( {{type}}, {{type:PascalCase}} )

// -- TYPES

DeclareStack( string )
DeclareStack( int32 )

// -- FUNCTIONS

func HandleRootPage(
    response_writer http.ResponseWriter,
    request * http.Request
    )
{
    local
        boolean : bool;
    local
        natural : uint;
    local
        integer : int;
    local
        real : float64;
    local
        escaped_html_text,
        escaped_url_text,
        text : string;
    local
        integer_stack : Int32Stack;

    boolean = true;
    natural = 10;
    integer = 20;
    real = 30.0;
    text = "text";
    escaped_url_text = "&escaped text?";
    escaped_html_text = "<escaped text/>";

    integer_stack.Push( 10 );
    integer_stack.Push( 20 );
    integer_stack.Push( 30 );

    #write response_writer
        <!DOCTYPE html>
        <html lang="en">
            <head>
                <meta charset="utf-8">
                <title><%= request.URL.Path %></title>
            </head>
            <body>
                <% if ( boolean ) { %>
                    <%= "URL : " + request.URL.Path %>
                    <br/>
                    <%@ natural %>
                    <%# integer %>
                    <%& real %>
                    <br/>
                    <%~ text %>
                    <%^ escaped_url_text %>
                    <%= escaped_html_text %>
                    <%= "<%% ignored %%>" %>
                    <%% ignored %%>
                <% } %>
                <br/>
                Stack :
                <br/>
                <% for !integer_stack.IsEmpty() { %>
                    <%# integer_stack.Pop() %>
                <% } %>
            </body>
        </html>
    #end
}

// ~~

func main()
{
    http.HandleFunc( "/", HandleRootPage );

    #if DebugMode
        WriteLine( "Listening on http://localhost:HttpPort" );
    #end

    log.Fatal(
        http.ListenAndServe( ":HttpPort", nil )
        );
}

Syntax

#define directive

Constants and generic code can be defined with the following syntax :

#define old code
#as new code

#define old code
#as
    new
    code
#end

#define
    old
    code
#as new code

#define
    old
    code
#as
    new
    code
#end

#define parameter

The #define directive can contain one or several parameters :

{{variable name}} : hierarchical code (with properly matching brackets and parentheses)
{{variable name#}} : statement code (hierarchical code without semicolon)
{{variable name$}} : plain code
{{variable name:boolean expression}} : conditional hierarchical code
{{variable name#:boolean expression}} : conditional statement code
{{variable name$:boolean expression}} : conditional plain code

They can have a boolean expression to require they match specific conditions :

HasText text
HasPrefix prefix
HasSuffix suffix
HasIdentifier text
false
true
!expression
expression && expression
expression || expression
( expression )

The #define directive must not start or end with a parameter.

#as parameter

The #as directive can use the value of the #define parameters :

{{variable name}}
{{variable name:filter function}}
{{variable name:filter function:filter function:...}}

Their value can be changed through one or several filter functions :

LowerCase
UpperCase
MinorCase
MajorCase
SnakeCase
PascalCase
CamelCase
RemoveComments
RemoveBlanks
PackStrings
PackIdentifiers
ReplacePrefix old_prefix new_prefix
ReplaceSuffix old_suffix new_suffix
ReplaceText old_text new_text
ReplaceIdentifier old_identifier new_identifier
AddPrefix prefix
AddSuffix suffix
RemovePrefix prefix
RemoveSuffix suffix
RemoveText text
RemoveIdentifier identifier

#if directive

Conditional code can be defined with the following syntax :

#if boolean expression
    #if boolean expression
        ...
    #else
        ...
    #end
#else
    #if boolean expression
        ...
    #else
        ...
    #end
#end

The boolean expression can use the following operators :

false
true
!expression
expression && expression
expression || expression
( expression )

#write directive

Templated HTML code can be sent to a stream writer using the following syntax :

#write writer expression
    <% code %>
    <%@ natural expression %>
    <%# integer expression %>
    <%& real expression %>
    <%~ text expression %>
    <%= escaped text expression %>
    <%! removed content %>
    <%% ignored tags %%>
#end

Limitations

  • There is no operator precedence in boolean expressions.
  • The --join option requires to end the statements with a semicolon.
  • The #writer directive is only available for the Go language.

Installation

Install the DMD 2 compiler (using the MinGW setup option on Windows).

Build the executable with the following command line :

dmd -m64 generis.d

Command line

generis [options]

Options

--prefix # : set the command prefix
--parse INPUT_FOLDER/ : parse the definitions of the Generis files in the input folder
--process INPUT_FOLDER/ OUTPUT_FOLDER/ : reads the Generis files in the input folder and writes the processed files in the output folder
--trim : trim the HTML templates
--join : join the split statements
--create : create the output folders if needed
--watch : watch the Generis files for modifications
--pause 500 : time to wait before checking the Generis files again
--tabulation 4 : set the tabulation space count
--extension .go : generate files with this extension

Examples

generis --process GS/ GO/

Reads the Generis files in the GS/ folder and writes Go files in the GO/ folder.

generis --process GS/ GO/ --create

Reads the Generis files in the GS/ folder and writes Go files in the GO/ folder, creating the output folders if needed.

generis --process GS/ GO/ --create --watch

Reads the Generis files in the GS/ folder and writes Go files in the GO/ folder, creating the output folders if needed and watching the Generis files for modifications.

generis --process GS/ GO/ --trim --join --create --watch

Reads the Generis files in the GS/ folder and writes Go files in the GO/ folder, trimming the HTML templates, joining the split statements, creating the output folders if needed and watching the Generis files for modifications.

Version

2.0

Author: Senselogic
Source Code: https://github.com/senselogic/GENERIS 
License: View license

#go #golang #code 

Aarna Davis

Aarna Davis

1625055931

Hire Front-end Developer | Dedicated Front-end Programmers In India

Hire top Indian front end developers for mobile-first, pixel perfect, SEO friendly and highly optimized front end development. We are a 16+ years experienced company offering frontend development services including HTML / CSS development, theme development & headless front end development utilising JS technologies such as Angular, React & Vue.

All our front-end developers are the in-house staff. We donโ€™t let our work to freelancers or outsource to sub-contractors. Also, we have a stringent hiring mechanism to hire the top Indian frontend coders.

For more info visit: https://www.valuecoders.com/hire-developers/hire-front-end-developers

#front end developer #hire frontend developer #front end development company #front end app development #hire front-end programmers #front end application development

An excellent general-purpose, middle and back-end front-end - vue-admin-beautiful

vue-admin-beautiful An excellent general-purpose, middle and back-end front-end framework based on vue+element-uiAn excellent general-purpose, middle and background front-end framework based on Vue + element UI

Demo address

๐Ÿš€ Demo address: vue-admin-beautiful (Seamless switching between horizontal and vertical layout)

๐Ÿš€ Demo address: vue-admin-beautiful (Seamless switching between horizontal and vertical layout)

๐Ÿš€ Domestic backup address: vue-admin-beautiful

๐Ÿš€ English backup address:vue-admin-beautiful

Cross-platform effect demonstration

๐Ÿš€ Demo address: vue-admin-beautiful

installation

# Cloning project
git clone https://github.com/chuzhixin/vue-admin-beautiful.git
# Into the project directory 
cd VUE-ADMIN-Beautiful
 # install dependencies
above sea level and
# Local development projects started 
npm run serve

install

# Clone project
git clone https://github.com/chuzhixin/vue-admin-beautiful.git
# Enter project directory
cd vue-admin-beautiful
# Installation dependency
above sea level and
# Start project
npm run serve

Links

uView document (awesome move across the end of the frame, the document detailed, easy to get started)

uView Open Source Address (uView UI, UI is an excellent framework for uni-app ecology, comprehensive set of components and convenient tools let you come in handy, like a duck)

the Element form design and the UI code generator (visual form designer, form a key generation element)

Luch-Request (based Promise developed uni-app cross-platform, project-level request library, which has a smaller size, easy to use api, convenient and simple customization capabilities)

PL-perfect solution to the Table element ten thousand tabular data rendering issues Caton

vue-admin-beautiful front-end discussion group-1 972435319

No matter you add it or not, you can enjoy the open source code. Thank you for your support and trust. The group provides the basic version of vue-admin-beautiful-template and detailed basic usage documents. It is suitable for the framework to get started quickly.

setting.js configuration

/** 
* @copyright chuzhixin 1204505056@qq.com 
* @description global variable configuration 
*/ 
module . exports  =  { 
  // URL 
  during development and deployment publicPath : "" , 
  // The directory name of the production environment build file 
  outputDir : " dist" , 
  // The directory (relative to outputDir) where the generated static resources (js, css, img, fonts) are placed. 
  assetsDir : "static" , 
  // Whether to output eslint compilation warning every time the development environment is saved 
  lintOnSave : true , 
  // compile dependencies 
  transpileDependencies : [ "vue-echarts" ,  "resize-detector",  "zx-layouts" ] , 
  // If the default interface address is vab-mock-server for development environment and production environment, of course you can also choose to configure your own interface address 
  baseURL :
     process . env . NODE_ENV  ===  "development"  ||  process . env . NODE_ENV  ===  "preview" 
      ? "vab-mock-server" 
      : "http://your.website.com" , 
  //Title (including the title page of the first loaded 
  Snowscreen Title browser title) title : "vue-admin-beautiful" , 
  // 
  abbreviation : "vab" , 
  //development environment port number 
  devPort :"80", 
  // version number 
  Version : Process . Env . VUE_APP_VERSION , 
  // please retain the package.json authors retain copyright information free of commercial 
  Copyright : Process . Env . VUE_APP_AUTHOR , 
  // whether to show the bottom of the page copyright information, it is recommended that you show, of course, your You can also choose not to display, whether you are a paid user or an unpaid user, you have the right to choose to display or not to display 
  footerCopyright : process . Env . NODE_ENV !== "development" ? True : false , 
  //Whether to display the upper right corner github Icon 
  githubCorner : process . Env . NODE_ENV!== "development" ? true : false , 
  //Whether to display the top progress bar 
  progressBar : true , 
  //Maximum number of cached routes 
  keepAliveMaxNum : 99 , 
  // Route mode, optional value is history or hash 
  routerMode : "hash" , 
  // 
  RoutesWhiteList without token verification : [ "/login" ,  "/register" ,  "/404" ,  "/401" ] , 
  //Display text when loading 
  loadingText : "Loading..." , 
  //token name 
  tokenName : "accessToken", 
  //The name of the key stored by the token in localStorage, sessionStorage, and cookie 
  tokenTableName : "vue-admin-beautiful" , 
  // 
  Token storage location localStorage sessionStorage cookie storage : "localStorage" , 
  //Whether the token is invalidated and returned to the login page Record this route 
  recordRoute : true , 
  //Whether to display the logo, set false when it is not displayed, fill in the remixIcon icon name when displaying it, temporarily only support remixIcon 
  logo : "vuejs-fill" , 
  //Whether the national header is fixed fixed NoFixed 
  header : "fixed" , 
  //horizontal vertical 
  layout : "vertical" , 
  //whether to enable the theme configuration button 
  themeBar : true, 
  //Whether to display the multi-tab page 
  tagsBar : true , 
  //Whether to display the skeleton screen 
  skeleton : false , 
  //With back-end data receiving method application/json;charset=UTF-8 or application/x-www-form-urlencoded ;charset=UTF-8 
  contentType : "application/json;charset=UTF-8" , 
  //The disappearing time of the message box 
  messageDuration : 3000 , 
  //The longest request time 
  requestTimeout : 5000 , 
  //Operation is normal code 
  successCode : 200 , 
  / /Login invalid code 
  invalidCode : 402 , 
  //No permission code 
  noPermissionCode : 401, 
  //Whether to display the highlight error on the page 
  errorLog : [ "development" ,  "test" ,  "production" ] , 
  //Whether to enable login interception 
  loginInterception : true , 
  //Whether to enable login RSA encryption 
  loginRSA : false , 
  // 
  Yes Generate webstorm HTTP Request request file httpRequestFile : false , 
  //intelligence and all 
  based on mock data . The former back-end permissions only control permissions and not the import of view files (front-end and back-end cooperation to reduce back-end workload), the all method is complete Handed over to the back-end front-end is only responsible for loading authentication : "intelligence" , 
  //Whether to keep only one sub-menu expanded 
  during the vertical layout uniqueOpened : true ,
  //The menu path that is expanded by default during vertical layout. It is recommended to expand only one 
  defaultOopeneds separated by a comma : [ "/vab" ] , 
  //The request to add a loading layer is required to prevent repeated submission of 
  debounce : [ "doEdit" ] , 
  // The module 
  providePlugin that needs to be automatically injected and loaded : {  maptalks : "maptalks" ,  "window.maptalks" : "maptalks"  } , 
  //Whether the 7z compressed package is automatically generated when npm run build 
  build7z : false , 
  //The code generator is generated in The name of the folder under view 
  templateFolder : "project" , 
} ;

variables.scss configuration

  • Note: Here you can modify the color scheme of your project, simple modification can achieve a big change in style.
  • Location: src/styles/variables.scss
  • Note: This may not be the latest code, you can check the latest variables.scss configuration on github
/* * 
* @copyright chuzhixin 1204505056@qq.com 
* @description Global theme variable configuration, the VIP document provides a variety of beautiful color schemes (ant-design style, layui style, iview style), please check the VIP document theme configuration article 
*/ /* stylelint-disable */ @charset " utf-8 " ;
 // Frame default theme color $base-color-default : #1890ff ;
 // Default level $base-z-index : 999 ;
 // Horizontal layout Menu background color in vertical layout $base-menu-background : #001529 ;
 // Menu text color $base-menu-color : hsla ( 0 , 0 % 

, 100 % , 0.95 );
 // Menu selected text color 
$base-menu-color-active : hsla ( 0 , 0 % , 100 % , 0.95 );
 // Menu selected background color 
$base-menu-background-active : $base-color-default ;
 // title color 
$base-title-color : #fff ;
 // font size configuration 
$base-font-size-small : 12 px ;
 $base-font-size-default : 14 px ;
$base-font-size-big: 16px;
$base-font-size-bigger: 18px;
$base-font-size-max: 22px;
$base-font-color: #606266;
$base-color-blue: $base-color-default;
$base-color-green: #13ce66;
$base-color-white: #fff;
$base-color-black: #000;
$base-color-yellow: #ffba00;
$base-color-orange: #ff6700;
$base-color-red : #ff4d4f ;
 $base-color-gray : rgba ( 0 , 0 , 0 , 0.65 );
 $base-main-width : 1279 px ;
 $base-border-radius : 2 px ;
 $base -border-color : #dcdfe6 ;
 // input box height 
$base-input-height : 32 px ;
 // default paddiing 
$base-padding : 20 px ;
 // default shadow 
$base-box-shadow :0  1 px  4 px  rgba ( 0 , 21 , 41 , 0.08 );
 // The height of top-bar, logo and first-level menu in horizontal layout 
$base-top-bar-height : 65 px ;
 // logo in vertical layout The height of 
$base-logo-height : 75 px ;
 // the height of the nav-bar at the top 
$base-nav-bar-height : 60 px ;
 // the height of the tags-bar of the top multi-tab page 
$base-tags-bar- height : 55 px ;
 // The height of each item in the tags-bar of the top multi-tab page 
$base-tag-item-height: 34 px ;
 // The height of the menu li label 
$base-menu-item-height : 50 px ;
 // The height of the app-main 
$base-app-main-height : calc (
  100vh - #{$base-nav-bar-height} - #{$base-tags-bar-height} -
    #{$base-padding} - #{$base-padding} - 55px - 30px
);
// The width of the left navigation when the left navigation is not collapsed in the vertical layout 
$base-left-menu-width : 230 px ;
 // The width of the right content when the left navigation is not collapsed in the vertical layout 
$base-right-content-width : calc ( 100 %  -  #{ $base-left-menu-width } );
 //The 
width when the left navigation is folded in vertical layout $base-left-menu-width-min : 65 px ;
 //In vertical layout The width of the right content when the left navigation is collapsed 
$base-right-content-width-min : calc ( 100 %  -  #{ $base-left-menu-width-min } );
 // default animation 
$base-transition: all  0.2 s ;
 // default animation duration 
$base-transition-time : 0.2 s ;

:export {
  // Export the 
  menu text color variable menu-color : $base-menu-color ;
   // Export the 
  menu selected text color variable menu-color-active : $base-menu-color-active ;
   // Export the menu background color variable 
  menu- background : $base-menu-background ;
   // Export the background color variable of the menu selected 
  menu-background-active : $base-menu-background-active ;
   // Export the background color variable of the multi-tab page 
  tag-background-active : $base -color-blue ;
   //The default button background color variable export 
  button-background : $base-color-blue ;
   // Paging selected background color variable export
  pagination-background-active: $base-color-blue;
}

element-ui component size configuration

  • Note: You can modify the size of your element-ui component here. The size of the element-ui component is divided into large, default, small, and mini. The project uses small by default.
  • Location: src/plugins/element.js
  • Sample code:
import Vue from "vue";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/display.css";

import "@/styles/element-variables.scss";

Vue . Use ( ElementUI ,  { 
  size : "small" ,  // The size of element-ui components is divided into large, default, small, mini 
} ) ;

Paid technical support, business cooperation

Contact: QQ 1204505056

Donate

img

GitHub Biaoxing growth statistics

Stargazers over time

Developer rating

chuzhixin's github stats

Statement on the framework

The framework is free for commercial use on the premise that the authorโ€™s copyright information is reserved. All the code of the framework includes the source code content in the npm package is free and open. If you are willing to support me or want to become your own copyright information, you need to pay 299 If you are willing to join the VIP group to study, you need to pay 100 yuan. This is all on your voluntary basis. If you feel that the framework is worthless, please skip it directly, raise your hands and let me go, donโ€™t maliciously write bad reviews. I hope that everyone who uses vue-admin-beautiful will have a happy ending no matter what the process is. Contact QQ 1204505056

vue-admin-beautiful front-end discussion group-2 1139183756

No matter you add it or not, you can enjoy the open source code. Thank you for your support and trust. The group provides the basic version of vue-admin-beautiful-template and detailed basic usage documents. It is suitable for the framework to get started quickly.

Download Details:

Author: chuzhixin

Live Demo: https://chu1204505056.gitee.io/vue-admin-beautiful/#/

GitHub: https://github.com/chuzhixin/vue-admin-beautiful

#vuejs #vue #vue-js #javascript

Front End Development Best Practices To Follow

This is image title
As someone from a non-tech background, you might not understand the complexities of front-end development. What we see on our mobile screens or PCs is a mere fragment of intricately woven code. But if you are looking forward to developing an application, you would have to dive in and know the scopes found in front-end development with the advent of new technologies, tools, and frameworks.

In this blog, we will help you understand the best practices of Front-end development and the burgeoning trends that would help you ensure the quality development of your digital products. Learn about the future of web development is here.

GUI Development Best Practices: UX And UI

Before you start the development work, it is essential to discuss the user experience and user interface of your product. The front-end of any software is the only thing that interacts with your users. Moreover, it is important that you make incredible contact with your users. It is not just about the smoothness; also about navigation; you have to make things as simple as possible for your users to interact with your product.

User Experience Vs. User Interface

Most people confuse user experience and user interface to be one and the same thing. But they cannot be more wrong. User experience and user interface work together; they are different components of your productโ€™s front end? Here are a few things which they share and that differentiate them.

  1. User Experience
    Starting with UX, it is a term coined by Don Norman, and when he did that, he did not contextualize it to any kind of software product. It was used for multiple disciplines, including marketing, graphical & industrial design, interface, and engineering.
    This is image title
    In software development, it focuses on building user-centric processes that optimize the user interaction with the product. The best practices of delivering a great user experience include; researching customer behavior, understanding the context in which the audience takes action, and creating a systematic vision for the target audience to reach its goal.Use your newfound knowledge to develop an actual graphic design. It needs to be analytical and action-provoking. A good UX designer would always understand the way a user interacts with your product.

  2. User Interface
    User experience helps you define the user interface design. It would include the components that make up the entire experience of the product. Additionally, it includes toggle, background, fonts, animation, and other graphical elements.
    This is image title
    If the user experience is about how the user interacts with your products, the user interface is about giving them the channels to interact with your product. So, the best practices of creating a rewarding user interface are; following brand style guidelines, intuitive design, support for various screen sizes, and effective implementation.

Front-End Development Best Practices: Design To Development

Once you are done with the design part, it is time to dive into development. The process includes turning the graphical assets into a functioning product. There are various approaches that the software community uses, but the most rewarding one is object-driven design and development as it improves the user experience tenfold.

The object-driven approach allows you to design graphical assets that follow the same design and pattern. Also, it allows you to translate the components for faster delivery and a cohesive UX and UI experience across products and platforms.

The design to development process allows you to build interfaces that include layouts, colors, typography, spacing, and more. Front-end development teams are required to work according to the guidelines of the target platform, and they must focus on the UI and UX peculiarities of product development. It is likely that you may face some temporary technical challenges during development and implementation.

It is a trend to automate the front-end development of software with Zeplin or Avocode. The tools ensure access to the updated design, accurate specs and automatically generate the code snippet that allows faster delivery. Learn about the right process of web development here.

  1. Frontend CSS Frameworks
    Depending on the project specification, a software development company would suggest you the right toolsets. The most popular front-end CSS frameworks are Bootstrap, Foundation, Material Design; they are known for increasing the speed of development and come with ready-to-use components that make it easy to replace the manual code and comply with responsive web design standards.

Here is a list of popular front-end development technologies

  • React
  • Angular
  • Vue.JS
  • Knockout and Backbone

Continue Reading

#front end web development #how to learn front end development #how to master front end development #how to practice front end development #is front end development easy