Initial commit. Modified the Meteor todos app to create the Petit Teton data tracking app. Has working data for sales. Requires a Mongo database.

This commit is contained in:
Wynne Crisman
2017-01-15 11:33:37 -08:00
commit b757595cd6
104 changed files with 26824 additions and 0 deletions

26
imports/api/index.js Normal file
View File

@@ -0,0 +1,26 @@
//import Categories from "./Category.js";
//import Subcategories from "./Subcategory.js";
import Measures from "./Measure.js";
import Venues from "./Venue.js";
import Products from "./Product.js";
import ProductTags from "./ProductTag.js";
import Sales from "./Sale.js";
import Users from "./User.js";
import UserRoles from "./Roles.js";
Meteor.collections = {Measures, Venues, Products, ProductTags, Sales, Users, UserRoles};
if(Meteor.isServer) {
//Change this to find admin users, create a default admin user if none exists.
if(Users.find({}).count() == 0) {
try {
console.log("Creating a default admin user: admin/admin");
let id = Accounts.createUser({password: 'admin', username: 'admin'});
//Requires the alanning:roles package.
Roles.addUsersToRoles(id, [Meteor.UserRoles.ROLE_MANAGE, Meteor.UserRoles.ROLE_UPDATE]);
}
catch(err) {
console.log(err);
}
}
}