All Projects → boylegu → Saniccrud Vue

boylegu / Saniccrud Vue

Licence: other
A example demo base Sanic with vueJS2.x + webpack2.x as new python full stack web practice

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Saniccrud Vue

Cogear.js
Modern static websites generator (Node.JS/Webpack)
Stars: ✭ 315 (-5.97%)
Mutual labels:  webpack
Isomorphic React
A simple but powerful React application built on a standards-compliant back-end
Stars: ✭ 318 (-5.07%)
Mutual labels:  webpack
Phenomic
DEPRECATED. Please use Next.js instead.
Stars: ✭ 3,264 (+874.33%)
Mutual labels:  webpack
Wp Webpack Script
💥🔥📦👩‍💻 An easy to use, pre configured, hackable webpack setup & development server for WordPress themes and plugins.
Stars: ✭ 314 (-6.27%)
Mutual labels:  webpack
Web Webpack Plugin
alternative for html-webpack-plugin
Stars: ✭ 318 (-5.07%)
Mutual labels:  webpack
Noty
Autosaving sticky note with support for multiple notes without needing multiple windows.
Stars: ✭ 321 (-4.18%)
Mutual labels:  webpack
Nin
nin is ninjatool
Stars: ✭ 313 (-6.57%)
Mutual labels:  webpack
Typescript Plugin Styled Components
TypeScript transformer for improving the debugging experience of styled-components
Stars: ✭ 330 (-1.49%)
Mutual labels:  webpack
Skeleventy
A skeleton boilerplate built with Eleventy.
Stars: ✭ 318 (-5.07%)
Mutual labels:  webpack
Symfony React Sandbox
Example of integration with React and Webpack (Webpack Encore) for universal (isomorphic) React rendering, using Limenius/ReactBundle and Limenius/LiformBundle
Stars: ✭ 325 (-2.99%)
Mutual labels:  webpack
Instapy Gui
gui for instapy automation
Stars: ✭ 313 (-6.57%)
Mutual labels:  webpack
Element Admin
一个支持 vue-cli 的 Element UI 的后台模板
Stars: ✭ 318 (-5.07%)
Mutual labels:  webpack
React Rock Paper Scissors
Rock Paper Scissors game built with ReactJS
Stars: ✭ 324 (-3.28%)
Mutual labels:  webpack
Youtube Live Chat Flow
Chrome Extension for Flowing Chat Messages on YouTube Live
Stars: ✭ 309 (-7.76%)
Mutual labels:  webpack
Electron React Boilerplate
A Foundation for Scalable Cross-Platform Apps
Stars: ✭ 18,727 (+5490.15%)
Mutual labels:  webpack
Web
📚 从零开始学 Web 前端系列图文教程。从零基础开始,手把手教你进入前端开发的世界。公众号「前端队长」作者。
Stars: ✭ 313 (-6.57%)
Mutual labels:  webpack
Webpack Hot Server Middleware
🔥 Hot reload webpack bundles on the server
Stars: ✭ 319 (-4.78%)
Mutual labels:  webpack
Dive Into Webpack
全面的Webpack教程《深入浅出Webpack》电子书
Stars: ✭ 3,664 (+993.73%)
Mutual labels:  webpack
Personal Site
My personal website - built with React, React-Router, React-Snap for Static-Export, and GitHub Pages.
Stars: ✭ 324 (-3.28%)
Mutual labels:  webpack
Angular2 Aot Webpack
Angular AOT (Ahead Of Time) offline compilation example with Webpack
Stars: ✭ 325 (-2.99%)
Mutual labels:  webpack

pyversions vueversions es2015 ver MIT

sanic_vue

Convenient & efficient and better performance for new Python full stack.

Commemorate the 6 anniversary of enter the profession.

Give beginner as a present.

———————By Boyle Gu

Chinese README[中文]

overview

This‘s a CRUD demo example base Sanic with Vue2 + webpack2. I hope pass thought this project for express new Python full stack base web practice.

Why Sanic

After python3.4, Sanic is a Python web framework built on uvloop and designed for fast HTTP responses via asynchronous request handling. Compared with such as Django, Flask and so these web framwork is much faster,and it's close affinity to Flask.

what's uvloop?

uvloop is written in Cython and built on top of libuv. uvloop makes asyncio fast. In fact, it is at least 2x faster than nodejs, gevent, as well as any other Python asynchronous framework. The performance of uvloop-based asyncio is close to that of Go programs.

sanic_vue

Wow!What a striking similarity to Flask! Do you think?

Why MVVM

Although it seems similar to MVC (except with a "view model" object in place of the controller), there's one major difference — the view owns the view model. Unlike a controller, a view model has no knowledge of the specific view that's using it.

This seemingly minor change offers huge benefits:

  1. View models are testable. Since they don't need a view to do their work, presentation behavior can be tested without any UI automation or stubbing.

  2. View models can be used like models. If desired, view models can be copied or serialized just like a domain model. This can be used to quickly implement UI restoration and similar behaviors.

  3. View models are (mostly) platform-agnostic. Since the actual UI code lives in the view, well-designed view models can be used on the iPhone, iPad, and Mac, with only minor tweaking for each platform.

  4. Views and view controllers are simpler. Once the important logic is moved elsewhere, views and VCs become dumb UI objects. This makes them easier to understand and redesign. In short, replacing MVC with MVVM can lead to more versatile and rigorous UI code.

In short, replacing MVC with MVVM can lead to more versatile and rigorous UI code.

Why to choose Vue.js

Vue.js is relatively new and is gaining lot of traction among the community of developers. VueJs works with MVVM design paradigm and has a very simple API. Vue is inspired by AngularJS, ReactiveJs and updates model and view via two way data binding.

Components are one of the most powerful features of Vue. They help you extend basic HTML elements to encapsulate reusable code. At a high level, components are custom elements that Vue’s compiler attaches behavior to.

sanic_vue

What's Webpack

Webpack is a powerful tool that bundles your app source code efficiently and loads that code from a server into a browser. It‘s excellent solution in frontend automation project

What's Peewee

Sometimes a huge amount of write/reade as Database invite costly.So use orm is very importance. Such as Django-ORM、SQLAlchemy and so on. But I recommend that Peewee may be a better fit than others. Because some of the reasons:

  1. A small, expressive ORM
  2. Can be developed as reusable, encapsulated
  3. more friendly asynchronous support

Demo

This's a sample ShangHai people information system as example demo.

demo-image

The project structure

 |
 |—— tests                            // unit test
 |
 |—— sanic_crudvue                    // main project
 |      |
 |      |—— config                    // base config in backend
 |      |
 |      |—— crud                      // core app in backend 
 |      |
 |      |—— frontend          
 |      |       |__ build             //  build static resource and webpack config
 |      |       |__ dist              // build target directory
 |      |       |__ src               // source code in frontend
 |      |       |    |   
 |      |       |    |__ components   // a vast variety of component 
 |      |       |    |
 |      |       |    |__ App.vue      // main web page
 |      |       |    |
 |      |       |    |__ eventBus.js  //  a central event bus for non Parent-Child Communication
 |      |       |    |
 |      |       |    |__ main.js      // webpack entry

Feature (v0.1)

  • Sanic (Back-end)

    • How is start Sanic project and organization to base MVC layout with blueprint

    • Build RestFul-API on Sanic and base CRUD logic implementation

    • Handle CORS(Cross-origin resource sharing) and resolve pre-flight request problem in Sanic

    • Simple encapsulated interface on peewee

    • Unit test on Sanic

    • Support hot reload in Sanic

    • Add interface documents about it's rest-api

    • Pagination implementation of RestFul-API with peewee and sanic

  • VueJS & webpack (front-end)

    • Follow ECMAScript 6

    • What about coding by single file components in vueJS

    • Simple none parent-child communication and parent-child communication

    • Interworking is between data and back-end

    • How grace import third JS package in vue

    • Handle format datetime

    • Pagination implementation

    • Reusable components

      • DbHeader.vue
      • DbFooter.vue (sticky footer)
      • DbFilterinput.vue
      • DbModal.vue
      • DbSidebar.vue
      • DbTable.vue
    • Config front-end env on webpack2 (include in vue2, handle static file, build different environment...... with webpack2)

Main technology stack

  • python 3
  • sqlite (not recommend, only convenience example)
  • vueJS 2.x
  • webpack 2.x
  • element ui
  • axios

Preparation

  • Please must install Python 3.5, 3.6 or even higher version

  • Install nodejs / npm

  • Clone Repository

      git clone https://github.com/boylegu/SanicCRUD-vue.git
      
      cd SanicCRUD-vue
    

Installation

  • Build back-end environment

      make install
    
  • Build front-end environment

      cd sanic_crudvue/frontend
    
      npm install 
    

Usage

  • Run back-end server

      cd SanicCRUD-vue
    
      make dev
    
  • Run Front-end Web Page

      cd sanic_crudvue/frontend
    
      npm run dev
    
  • Unit test

      cd SanicCRUD-vue
    
      make test
    

You can also run cd sanic_crudvue/frontend;npm run build and it's with Nginx in the production environment

Future Plan

This project can be reference,study or teaching demonstration. After, I will update at every increme version in succession. In future,I have already some plan to below:

  1. User Authentication
  2. state manage with vuex
  3. use vue-route
  4. add docker deploy method
  5. support yarn ... ...

Support

  1. Github Issue

  2. To e-mail: [email protected]

  3. You can also join to QQ Group: 315308272

Related projects

My Final Thoughts


                     ▄▄▄▄▄
            ▀▀▀██████▄▄▄       _______________
          ▄▄▄▄▄  █████████▄  /                 \
         ▀▀▀▀█████▌ ▀▐▄ ▀▐█ | Gotta go fast!   |
       ▀▀█████▄▄ ▀██████▄██ | _________________/
       ▀▄▄▄▄▄  ▀▀█▄▀█════█▀ |/
            ▀▀▀▄  ▀▀███ ▀       ▄▄
         ▄███▀▀██▄████████▄ ▄▀▀▀▀▀▀█▌   ______________________________ 
       ██▀▄▄▄██▀▄███▀ ▀▀████      ▄██  █                              \\ 
    ▄▀▀▀▄██▄▀▀▌████▒▒▒▒▒▒███     ▌▄▄▀▀▀▀█_____________________________ //
    ▌    ▐▀████▐███▒▒▒▒▒▐██▌
    ▀▄▄▄▄▀   ▀▀████▒▒▒▒▄██▀
              ▀▀█████████▀
            ▄▄██▀██████▀█
          ▄██▀     ▀▀▀  █
         ▄█             ▐▌
     ▄▄▄▄█▌              ▀█▄▄▄▄▀▀▄
    ▌     ▐                ▀▀▄▄▄▀
     ▀▀▄▄▀     ██   
 \  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀ 
 \- ▌          SanicCRUD-vue              ▀ ▀      
  - ▌                            (o)          ▀ 
 /- ▌            Go Go Go !               ▀ ▀           
 /  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀       
               ██

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].