Giter VIP home page Giter VIP logo

chatninja's Introduction

Fixtures:

Password: user12345
To run locally:
$ meteor run

Mantra BoilerPlate 2

Topics

Installing Mantra CLI

npm install -g mantra-cli


Creating a mantra project via Mantra CLI

mantra create <project name>


Running Mantra using Bash

  • bash ./meteor.sh run.
  • This will allow you to run multiple projects in different ports and mongo by updating the meteor.sh file.

Creating a module in Mantra CLI

  • mantra g module modulename
  • module name should be Pascal case Example: mantra g module PostAddd

Creating a file inside container, actions and compontents in a modules in mantra CLI

  • mantra g <folder inside module> <module name>: filename
  • Example: mantra g container core:PostAdd.
  • Example: mantra g container Favorites:FavoritesAdd.
  • NOTE: When you create a file inside container this will create the same file inside components automatically.
  • NOTE: You have to create the files inside actions manually by typing: mantra g actions Favorites:FavoritesAdd.

Naming Convention

  • Names such as route names, modules and filenames should be plural

  • Filename Example: PostsAdd, PostsView, FavoritesList, InterestsAdd, MessagesView and so on.

  • Route Example:

    • /posts/list,
    • /posts/view/id,
    • /favorites/list,
    • /interests/delete/data,
    • /interests/add,
    • /messages/view/data

    and soon...

  • In creating a module it should be all lower case. Example:* "products". (folder would be products).

  • In creating an action it should be all lower case. Example: "products". (file would be products.js).

  • In creating a container and component it should be Pascal case. Example: "ProductsList" files would be (containers/products_list.js) and (components/products_list.jsx).


Data Subscription Non-Global


Filaname Prefix and Suffix

  • The filename prefix should be the module name and the suffix should be event name.
  • Example: If the module name is Favorites and the event is to add favorite users, the filename should be FavoritesAdd.
  • Example: If the module name is Interests and the event is to view users you added in your interest list, then the filename should be InterestsView.

Event Names to be used

  • Add
  • View
  • Update
  • List
  • Delete

Adding a custom CSS file

  • it should be added inside the assets folder inside the client. Example: /client/assets/stylesheets/style.css.

Naming convention for Function names, Subscription names, and Publication names

  • they should all be in Pascal Case

Adding a 3rd party scripts/codes such as Boostrap, JS, Fonts and CSS

  • these files should be in Public
  • it should be added in the head tag
  • Please refer to the topic below Adding content inside the tag using NPM React-Helmet

Adding Routes

  • Each module should have its own routes.jsx.

Adding a schema


Adding User Authentication


Using StoryBook


Adding content inside the <head></head> tag using NPM React-Helmet

  • The Kadirah DocHead needs to be added inside the app loader /client/main.js.
  • Just import the package inside the file import {DocHead} from 'meteor/kadira:dochead';.
  • Then use it, here are the syntax:
//Site Title
var title = 'Sample DocHead';
DocHead.setTitle(title);

// Loading Javascript
var gaScript = 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js';
DocHead.loadScript(gaScript);

// Loadintg CSS
var cssLink = {rel: "stylesheet", href: 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'};
DocHead.addLink(cssLink);

// Loading Meta tag
var metaInfo = {name: "description", content: "FlowRouter SSR is Awesome"};
DocHead.addMeta(metaInfo);

ESLint Rules

  • There should be a space after if condition and before parentheses. Example: if< space >(condition){arguments}.
  • If Else should be avoided

Wrong way

if(err) {
return throw new Meteor.Error(e);
} else {
return 'Success';
}

Right way

if(err) {
return throw new Meteor.Error(e);
}
return 'success';
  • import should be relative meaning to say import path should not point to root directory like /client/path/and/so/on.jsx instead you have to use ../path/to/the/exact/file.jsx.

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.