npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

express-semantic-ui

v1.0.2

Published

Node.js Express app boilerplate for a web frontend utilising Semantic UI

Downloads

14

Readme

express-semantic-ui

Node.js Express app boilerplate for a web frontend utilising Semantic UI

Build Status

About

This is a Node.js Express app boilerplate that uses Gulp for build task running, Swig for templating and Semantic UI for design bootstrapping. The aim of this boilerplate is to get you off the ground very quickly with a full stack application.

Caveats are that to avoid writing in dependencies on databases or other external services, sessions are stored on the filesystem and there is no authentication (if you want that npm install passport).

The only exception to this is that the Gulp tasks include a CloudFront publisher to serve static assets from CDN instead of locally, if configured.

Install

Requires Node.js, recommended 6.3.0 or greater

npm install

So simple, right?

Usage

views/index.html and views/dashboard.html are provided by default as examples of a Semantic UI theme to get you started, along with associated server-side Express routes in routes/index.js.

Override or add CSS in src/css/theme.css and add your own Semantic UI JS calls to src/js/semantic-ui.js, or feel free to add additional javascript/CSS files as necessary, just be sure to add them to the bundle.config.js file Gulp Bundle uses.

To get started, copy the config/example.config.js file to config/config.js and fill in the values appropriately for this new file, most are self-explanatory:

	requestLogging: false           // Logs all requests using Morgan
	session: {
		secret: 'defaultSecret',    // You should change this
		name: 'session'             // You should change this
	},
	gulpBuildMaps: false,           // Instructs Gulp Bundle to compile source maps
	frontend: {
		useCDN: false               // Will use API credentials from `cloudFrontS3` to publish to CDN
	}

Do not commit your API credentials in config.js to a repository - this is bad juju - either symlink to this file and deploy manually, use environment variables or modify and come up with your own secure mechanism for deployment.

Gulp tasks are configured for Semantic UI builds:

gulp watch      # watch for Semantic UI source changes
gulp clean      # Wipe the built dist/ folder
gulp build      # Build assets to dist/

To make these builds smaller, you can move components listed in semantic.json into the disabled section and they will not be incorporated in the build.

You should only need to run gulp build once unless you are making changes to the Semantic UI site theme, otherwise, run the following:

gulp wipe       # Wipe the public/ folder of assets
gulp compile    # Minify/concatenate source js/css from src/ into public/
gulp optimise   # Optimise/compress images from src/images/ into public/

If you are only making frequent javascript and CSS changes outside of Semantic UI, run gulp compile.

The following commands are combined tasks to build Semantic UI and your own assets:

gulp refresh    # Cleans and wipes (like a good 'un)
gulp bundle     # Builds and compiles
gulp publish    # Publishes to CDN

The default Gulp action is to refresh, bundle and optimise. Publishing is left as a separate action so you can incorporate it into your deployment process; build and/or publish together you can using the associated scripts:

npm run cdn     # gulp publish
npm run gulp    # gulp && gulp publish

This is enough to get you off the ground running, for full documentation please refer back to Express, Semantic-UI and Gulp documentation separately.

Test

There is a basic series of tests provided using Mocha, Chai and Should. There is a breaking test to ensure you have a valid configuration file, anything else is down to you as a developer.

npm test

Enjoy! Feel free to fork and use for your own applications as the license permits.

License

The MIT License (MIT)

Copyright (c) 2016 clocked0ne

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.