All Projects → Fen747 → meteor-boilerplate

Fen747 / meteor-boilerplate

Licence: other
A Meteor ready-to-use app for Blaze + FlowRouter, with a bunch a handy functions, objects, packages, etc

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to meteor-boilerplate

MeteorCandy-meteor-admin-dashboard-devtool
The Fast, Secure and Scalable Admin Panel / Dashboard for Meteor.js
Stars: ✭ 50 (+257.14%)
Mutual labels:  meteor
Web
The default DAPNET Web-frontend.
Stars: ✭ 18 (+28.57%)
Mutual labels:  web-app
esp8266-rfid-banco-de-dados
Projeto com objetivo de autenticar/autorizar usuários a partir de Tags RFID utilizando Banco de Dados
Stars: ✭ 85 (+507.14%)
Mutual labels:  web-app
browser-push
Complete workout and guidelines to add web push notifications support for your webapp without third-party notification provider
Stars: ✭ 67 (+378.57%)
Mutual labels:  web-app
Grow-IoT
Software packages for smart growing environments.
Stars: ✭ 24 (+71.43%)
Mutual labels:  meteor
Client-Storage
🗄 Bulletproof persistent Client storage, works with disabled Cookies and/or localStorage
Stars: ✭ 15 (+7.14%)
Mutual labels:  meteor
Meteor-Cookies
🍪 Isomorphic bulletproof cookie functions for client and server
Stars: ✭ 41 (+192.86%)
Mutual labels:  meteor
meteor-two-factor
🔐 Two factor authentication package for accounts-password
Stars: ✭ 80 (+471.43%)
Mutual labels:  meteor
AQMissionHelper
Route to the next Onyx - A mission helper tool for Niantic Ingress - Learn more at http://imaq.cn/mh/
Stars: ✭ 12 (-14.29%)
Mutual labels:  web-app
unity3d-ddp-client
Lightweight DDP client for Unity3D
Stars: ✭ 18 (+28.57%)
Mutual labels:  meteor
hradla
Logic network simulator that runs in your browser
Stars: ✭ 22 (+57.14%)
Mutual labels:  web-app
meteor-subscription-scope
Scope queries on collections to subscriptions
Stars: ✭ 20 (+42.86%)
Mutual labels:  meteor
meteorpp
Meteor DDP & Minimongo implementation in C++.
Stars: ✭ 22 (+57.14%)
Mutual labels:  meteor
software-systems-architecture
A collection of descriptions of the architecture that various systems use.
Stars: ✭ 24 (+71.43%)
Mutual labels:  web-app
todo
A simple and minimalistic ToDo list manager
Stars: ✭ 18 (+28.57%)
Mutual labels:  web-app
csgo-league-web
League web panel
Stars: ✭ 42 (+200%)
Mutual labels:  web-app
twittter
Twittter - A tutorial of how to clone some features of Twitter using Ruby on Rails
Stars: ✭ 44 (+214.29%)
Mutual labels:  web-app
synthesis
🔥 Synthesis is Meteor + Polymer
Stars: ✭ 28 (+100%)
Mutual labels:  meteor
Meteor-logger-file
🔖 Meteor Logging: Store application log messages into file (FS)
Stars: ✭ 24 (+71.43%)
Mutual labels:  meteor
awesome-vulcan
🗒 A list of resources to learn awesome VulcanJS 🖖
Stars: ✭ 15 (+7.14%)
Mutual labels:  meteor

Meteor Boilerplate

A Meteor ready-to-use app for Blaze + FlowRouter with a bunch of useful functions, writen in ES6

GitHub repository : https://github.com/Fen747/meteor-boilerplate

by David Panart aka. Fen747

version 1.1.3

See version changes

Feel free to fork this repository.
Don't forget to star it too if you find it cool!

Public projects using this boilerplate :


Installation


Doc

Packages ( /.meteor/packages )

  • A bunch of very useful packages are either pre-installed or just need to be uncommented to be installed in your app

Changes to globals ( /both/_globals.js )

Lodash

  • This app already has erasaur:lodash package installed and aliased to '_' instead of underscore
  • Lodash is known to have the same API as UndescoreJs, but with better performances, and more features

Meteor.user()

  • I optimized the Meteor.user() function
  • It can now be used with a string as parameter to alias a findOne on a specific user
  • In addition, you can pass an array of string to automatically filter the fields you need in order to reduce the number of useless re-renders / autorun invalidation
  • Indeeds, the default Meteor.user() function return the whole user document, which means that any reactive computation would be invalidated if any field of the doc change, which can be very bad for debugging and performances, specially on mobiles
  • Use it like this :
    • Meteor.user() // return the whole current user doc
    • Meteor.user( "aUserIdString" ) // return the whole specified user doc
    • Meteor.user( [ 'field1', 'field2', ... ] ) // return the filtered current user doc
    • Meteor.user( "aUserIdString", [ 'field1', 'field2', ... ] ) // return the filtered specified user doc

API ( /imports/api )

Routes ( /imports/api/routes )

  • config.js - Set your routes hierachy and triggers here. Use updateView instead of BlazeLayout.Render to handle your transition animations
  • triggers.js - Define the triggers here
  • routes.js - Define your routes here

Collections ( /imports/api/collections )

  • Store your global collections at /imports/api/collections
  • Store your client only minimongo instances in ./client
  • Store your private collections in ./server

Methods ( /imports/api/methods )

  • Store your optimistic methods at /imports/api/collections
  • Store your server only methods at ./server

Library ( /imports/library )

App context ( /imports/library/appContext )

  • Using Session or any globally defined variable is not a good thing. You should rather use the appContext as a reactiveDict instead of Session

App utilities ( /imports/library/appUtilities.js )

  • getEmailfromUid( userId ) - use this to get the first mail from a user
  • secure( collection ) - use this to automatically deny all writing permissions for the user in production
  • endLoadingScreen - great to remove loading screen you could have injected via Arunoda's initial inject package
  • playAnimation( animationName, elementId, animationTime = 1000 ) - play an animation on an element by adding it a class and removing it automatically after 'animationTime' ms

Blaze helpers ( /imports/library/blazeHelpers.js )

  • userConnected - use this handlebar helper to check if a userId exists
  • lineBreakText - Automatically tranform \n of a string as br elements in the dom. Use with triple braces
  • urlify( str ) - make a string valid as a url. Great for passing post titles in the url for example
  • mobileViewSize - check if the window width is lesser than 601 (based on materializecss standard media queries)
  • getUserName( uid ) - get a user's name based on his uid
  • equals( a, b ) - return true is both arguments are equals
  • nequals( a, b ) - return true is both arguments are not equals
  • logContext( context = this ) - log the passed context or this
  • getEmailfromUid( userId ) - use this to get the first mail from a user
  • isCordova - return true if is on a cordova device

Context utilities ( /imports/library/contextUtilities.js )

  • A bunch of functions returning a meteor flag and taking an optionnal callback to execute if the flag is set to true
  • isClient, isServer, isCordova, isDevelopment, isProduction

DOM Manipulation

  • createDOMElement({ tag, classList, id, dataset, innerHTML }) - Use this passing as parameter an object containing the attributes you want to assign to the created element (please, read the function signature for details)

Functional Programming ( /imports/library/funcProg.js )

  • A bunch of ES6 functions and aliases for functional programming
  • Really useful in order to keep a DRY, easy to read and easy to debug code

Utilities ( /imports/library/utilities.js )

  • mobileViewSize - check if the window width is lesser than 601 (based on materializecss standard media queries)
  • urlify( str ) - make a string valid as a url. Great for passing post titles in the url for example
  • tryReach( object, 'nestedAttribute1', 'nestedAttribute2', ... ) - a very useful function to naviguate in nested objects without throwing errors if an attribute is called on a non-object value
  • buildRegExp( str ) - a simple regexp builder
  • benchmark( callback ) - a basic functions to check performances of a callback
  • unblock( ddp connection ) - an alias to ddp's this.unblock that do not throw an error when the method doesn't exists
  • isValidImageUrl( url ) - check if a url points to an image

Modules ( /imports/modules )

Reactive Window

  • window.size - a Reactive dict to make resizing the window reactive
  • Imported to client by default

DDP Logging

  • Use the DDPLogging global object to toggle on and off the listening of DDP messages on the client
  • Imported to client by default

Smart disconnect ( /imports/modules/smartDisconnect.js )

  • Maintaining sessions alive in meteor is quite costly. Use SmartDisconnect.start() to set Meteor.status().status to `offline` when a user is inactive for a certain time (default to 300s)
  • SmartDisconnect.start() takes two optional parameters :
  • First, an object like this : { timeBeforeDisconnect = 300, activateOnCordova = true }
  • Second, a callback called just before a deconnection occurs
  • Credits to mixmaxhq

Startup ( /imports/startup )

Client ( /imports/startup/client.js )

  • Add a removeElement (by id) method to the document variable
  • Add a log function to the global scope. Useful to log and return a variable without adding new lines to your files when debugging
  • The startup callback has a lot of handful features to handle injected loading screens on cordova, defering the router init after roles are loaded, and following the connection state in the appContext

User Interface ( /imports/ui )

Components ( /imports/ui/components )

  • Add your re-used components here

Layouts ( /imports/ui/layouts )

  • Add your layouts templates here

Modals ( /imports/ui/modals )

  • Add your modals templates here

Pages ( /imports/ui/pages )

  • Add your pages templates here

Stylesheets ( /imports/ui/stylesheets )

  • Add your CSS / SCSS / SASS / LESS files here
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].