Skip to content

awesomemarcus/chatninja

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Team Project (Meteor+React+Mantra)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published