• Stars
    star
    295
  • Rank 140,902 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Quick start a web app for mobile.Automatically adjusts according to a device’s screen size without any extra work.

NPM

Note: This generator is supporting a very early stage app,things gonna change very frequently,so please do not fork it or do any pull request.

Readme

webappstarter generator will give you a Simple Mobile Web App Boilerplate and Structure!

The App will automatically adjusts according to a device’s screen size without any extra work.

Install

npm install -g generator-webappstarter

Prereqs and installation requirements

1.install node and Python.

2.install yeoman.

npm install -g yo

3.[optional]Clone this git repo to your local,and from the root of the repo,run

npm link

to developing the generator locally.

Generator commands

1.generate a new project,run

mkdir myProject
cd myProject
yo webappstarter

or run with --skip-install option to skip install dependencies

mkdir myProject
cd myProject
yo webappstarter --skip-install

install dependencies manually with npm install or just copy node_modules folder from another project which was generated by webappstarter.

2.generate a new module,run

//this command will do:
//add "html/include/view-modulename.html" and inlude it to "html/include/views.html"
//add "scss/_view-modulename.scss" and import it to "scss/_view.scss"
//add "src/app/view/ModuleNameView.js"
//add "src/app/controller/ModuleNameController.js" and require it in src/app/App.js

yo webappstarter:module ModuleName

3.generate a new model,run

//this command will do:
//add "src/app/model/ModelNameModel.js"

yo webappstarter:model ModelName

4.update your project's boilerplate and structure

//this command will update
//"./src/core" directory
//"./src/lib" directory
//"./src/util" directory
//"./src/widget" directory
//some files in "./src/app/" directory
//some files in "./scss/" directory
//some files in "./html/" directory

yo webappstarter:update

Warning: When you are asked before an overwrite can occur,please be careful.Default "Y" is overwrite,"n" is skip.

More configurations,please take a look at "project" property of "package.json" file after the generator is done. Run gulp to re-build project is required after change the "package.json" file.

Project commands

run this command before you get started.

npm install -g gulp

1.build project,watch change and start browserSync,run

gulp

or run with forever

forever ./node_modules/.bin/gulp

2.deploy to test server,run

gulp deploytest

Please update your ftp auth name and password in ".ftppass". View the page on test server http://office.mozat.com:8083/PROJECTNAME/. This command require openssl. For windows,you might needd to add openssl path to classpath.

3.deploy to offical server,run

gulp deploy

View the page on offical server http://m.deja.me/PROJECTNAME/. This command require rsync. For windows,unzip /tools/rsync.zip to a local path and add the path to classpath.

4.run this command to copy source images to project's resources/images/ path,then generate scss/_sprites.csss and resources/images/sprites.png for sourceSprites in package.json.

gulp copy

5.run this command to start jshint.

gulp jshint

6.run this command to start browserSync,Change browserSync options in package.json.

gulp serve

7.run this command to start pagespeed,Change pagespeed options in package.json.

gulp pagespeed

Structure

The structure is modular design,follow the DOOR-KEY rule you only take minutes to understand it:

  • The DOOR for javascript is in /src/app/App.js,and the KEY is require,see webpack and commonjs
  • The DOOR for stylesheets is in /scss/styles.scss,and the KEY is @import,see SASS
  • The DOOR for HTML is in /html/debug/index.html,and the KEY is @@include,see gulp-file-include

Git

Random git commit message

 git commit -m"`curl -s http://whatthecommit.com/index.txt`"

More Repositories

1

codelf

A search tool helps dev to solve the naming things problem.
JavaScript
14,066
star
2

react-native-train

I use this book to train my team, help them to know how to build React-native app in the right way.
420
star
3

snts

Say No to Suicide Public License
196
star
4

ddms

Data Drive Management System
JavaScript
183
star
5

Polymer-notes

Polymer 学习资源汇集
176
star
6

vscode-codelf

请不要在这加星🌟和提 issue,请移步主 repo 的 GitHub https://github.com/unbug/codelf
JavaScript
101
star
7

MIHTool

MIHTool helps Front-End Engineers to debug and optimize their webpages on iPad and iPhone
Objective-C
86
star
8

logproxy

set up a proxy to log http archives
JavaScript
82
star
9

DOMSnap

Offline web pages by persist DOM to IndexedDB/WebSQL
JavaScript
75
star
10

TodoRN

React Native+Redux TodoMVC App for React Native Training
JavaScript
74
star
11

js-middleware

Powerful Javascript Middleware Pattern Implementation, apply middleweares to any object.
JavaScript
53
star
12

slide-page

easy one page slide base on polymer
CSS
21
star
13

atom-codelf

请不要在这加星🌟和提 issue,请移步主 repo 的 GitHub https://github.com/unbug/codelf
CoffeeScript
16
star
14

sj

Swift and JavaScript comparison snippets
14
star
15

gitlab-pages-webhook

Set up your gitlab-pages server base on gitlab's web hook!
JavaScript
14
star
16

polymer-cn

Polymer 中文社区论坛
14
star
17

gdg14

12
star
18

social-reshare

在社交等 app 里 打开 web 页面后再使用 app 自带的分享功能进行二次分享时,指定分享格式。目前支持微信,易信,欢迎贡献其他平台。
JavaScript
7
star
19

unbug

5
star
20

against-my-will

Have you been forced to make code changes against your will? You're not alone!
JavaScript
3
star
21

0Algorithm

C
3
star
22

react-native-train-scripts

Some demo scripts for React Native Training
JavaScript
3
star
23

react-boilerplate

react boilerplate for react project
JavaScript
2
star
24

algo

Tree and Radial visualization tool
JavaScript
2
star
25

notelf

A notebook for me to write down something.
JavaScript
2
star
26

lets-write-xxx

Let's learn xxx by reinvent the wheel together.
1
star
27

mihtool.com

mihtool.com
HTML
1
star
28

swing-amd

AMD for swing - A swipeable cards interface. The swipe-left/swipe-right for yes/no input. As seen in apps like Jelly and Tinder.
JavaScript
1
star
29

react-router-decorator

Decorator routing for React base on react-router.
1
star
30

freecodecamp-algorithm

Solutions for FreeCodeCamp's algorithm challenges
JavaScript
1
star