####### HOW TO RUN vutilo_client locally ########
- start elasticsearch -
./elasticsearch
- start apollo
cd vutilo_apollo npm start
- DO NOT set local environment variables MONGO_URL and MONGO_OPLOG_URL
- meteor --settings settings-dev-liang.json
5a) Add data through admin app
cd vutilo_admin meteor --settings settings-di-liang.json --port 3500
5b) Or import data from files mongoimport -h 127.0.0.1:3001 -d meteor -c items < items.json mongoimport -h 127.0.0.1:3001 -d meteor -c stores < stores.json mongoimport -h 127.0.0.1:3001 -d meteor -c prices < prices.json
############################################################################################################################################################################
Update settings-default.json file with appropriate information "keys, urls, etc."
meteor --settings settings-default.json --port 3000
To debug on server side:
meteor --settings settings-default.json --port 3000 debug
Please note: by default, settings are available on server only. Settings values that will be used in client code must go inside the "public" block of your settings.json and can be accessed via Meteor.settings.public.KEY_NAME See: http://stackoverflow.com/questions/15559743/meteor-client-side-settings
Start the app locally as described above, and verify that you can access it via localhost.
Then, open a terminal window and create a tunnel using ngrok:
./ngrok http 3000
The output from this command will consist of 2 URLs that forward requests to your local server, over HTTP and HTTPS. Works even if your local box is behind a firewall.
This package contains:
- TypeScript support and Angular 2 compilers for Meteor
- Angular2-Meteor
- Angular2 (core, common, compiler, platform)
- Angular2 Material, SASS support
- Apollo GraphQL client side (requires Apollo Server)
- Testing framework with Mocha and Chai
- Meteor packages:
meteor list
- NPM Packages:
npm list
- ....
The folder structure is a mix between Angular 2 recommendation and Meteor recommendation.
The client
folder contains single TypeScript (.ts
) file which is the main file (/client/app.component.ts
), and bootstrap's the Angular 2 application.
The main component uses HTML template and SASS file.
The index.html
file is the main HTML which loads the application by using the main component selector (<app>
).
All the other client files are under client/imports
and organized by the context of the components.
The server
folder contain single TypeScript (.ts
) file which is the main file (/server/main.ts
), and creates the main server instance, and the starts it.
All other server files should be located under /server/imports
.
Example for common files in our app, is the MongoDB collection we create - it located under /both
and it can be imported from both client and server code.
Contents in private directory is only accessible to server code
Contents in public directory is accessible to client
The testing environment in this boilerplate based on Meteor recommendation, and uses Mocha as testing framework along with Chai for assertion.
There is a main test file that initialize Angular 2 tests library, it located under /client/init.test.ts
.
All other test files are located near the component/service it tests, with the .test.ts
extension.
Add following to package.json in agm/core: "main": "core.umd.js"