GithubHelp home page GithubHelp logo

pbeshai / beshai-web-quickstart-full Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 153 KB

Starting point for spinning up quick web-based prototypes using modern javascript, webpack, and tailwind css

Home Page: https://peterbeshai.com/beshai-web-quickstart-full/

JavaScript 94.20% HTML 3.96% CSS 1.84%

beshai-web-quickstart-full's Introduction

Beshai Web Quickstart - Full

Quickly spin up web-based prototypes using modern javascript, webpack, and tailwind.

Extends beshai-web-quickstart-basic by adding in Tailwind CSS and a few convenient webpack loaders.


Features

  • basic webpack configuration with HTML template and public files copied over
  • webpack-dev-server with easy configuration of hot module reloading
  • barebones eslint configuration that defers to prettier
  • prettier configured
  • jsconfig provided to integrate better with VS Code
  • optional absolute imports by prefixing with src. e.g. import bar from 'src/foo/bar'
  • css is extracted into its own file, autoprefixed, purged down to only what has been used
  • tailwindcss is set-up
  • css modules are supported by importing foo.module.css or similar
  • loaders for images, fonts, CSVs have been added so you can import them directly in the js

Installation

Download a zip of this repo then run npm install.

You can copy and paste the following to install. It will prompt you for a project name which sets the name of the directory created:

echo -n "Enter project name: " && read projectName
curl -Lk https://github.com/pbeshai/beshai-web-quickstart-full/archive/master.zip -o beshai-web-quickstart-full.zip && \
  unzip beshai-web-quickstart-full.zip && \
  rm beshai-web-quickstart-full.zip
mv beshai-web-quickstart-full-master $projectName
cd $projectName
npm install

Run the dev server

npm run start

Build for production

npm run build

You can then check out the production build by running a web server in the build directory. A simple way to do so is to use the provided start:prod script:

npm run start:prod

Deploying

There are many options to easily deploy your prototype including Surge and Netlify, but this repo comes configured for easy deploys to github pages. After pushing your repo to GitHub, just run

npm run deploy

Your app will be available at https://username.github.io/repo.

Linting and Code Formatting

Linting and code formatting is provided via the lint and prettier scripts. I have my editor configured to automatically run prettier on save, but if you want to run it manually you can run:

npm run prettier

You may also consider setting up a git hook with husky to make eslint and prettier run automatically on commits.

Remove Tailwind CSS

If you'd prefer not to use Tailwind, you can remove it by:

  1. npm uninstall tailwindcss --save
  2. Delete tailwind.config.js
  3. Remove @tailwind lines from src/index.css
  4. Remove require('tailwindcss') from postcss.config.js

License

Copyright 2019 Peter Beshai

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

beshai-web-quickstart-full's People

Contributors

pbeshai avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.