Code Monkey home page Code Monkey logo

adventure-map-mobile's Introduction

CircleCI

Adventure Map Mobile (Ionic 1.x)

AdventureMap Mobile application - Ionic v1 😞

Install

Fork and clone the repo to your localhost. Intall dependencies:

$ npm install && bower install

You should be ready to go. Fire app ionic serve to load the application in your browser. (See below for more info)

Running tests

Features

This project uses Protractor and CucumberJS for acceptance tests Feature files are placed in tests/features folder. Step definitions are placed in tests/features/step_definitions

Dependencies

Install protractor and update the webdriver

$ npm install -g protractor
$ webdriver-manager update

This line may be necessary:

$ node_modules/protractor/bin/webdriver-manager update
Running the tests

In order to run features, an instance of the application must be running:

$ ionic serve

(See below for more options)

Then open another tab on your terminal and to run the test you must run the following command:

$ npm run cucumber

In order to run a specific scenario you can run protractor with a --specs flag:

protractor tests/protractor.conf.js --specs tests/features/feature_file_.feature 

"possible EventEmitter memory leak detected." warning

If you get this warning please run this command to install

$ sudo npm install -g npm@next

Running the App

You can choose to run the app on your phone or in an emulator.

iOs Simulator

Run the following commands

$ gulp sass # May not be necessary - This will compile the stylesheets
$ ionic platform remove ios (optional)
$ ionic platform add ios
$ ionic state restore --plugins
$ ionic emulate ios

Running the emulator with live reload. As we move forward with more Cordova plugins,we can no longer emulate the app running $ ionic serve Running the simulator with live reload is a much better option.

$ ionic cordova emulate ios -l -c

This command will give you a console output in the terminal as well as reload the application on every update.

Logging in with Facebook

We have test users added to the AdventureMapDevelop Facebook application. If you want to log in using facebook please use:

Clear files from Simulator

You probably want to clear the simulator data after a while o

$ xcrun simctl erase all

Browser

You can run the app in your browser by starting the Ionic server with:

$ gulp watch sass # Run this in a separate terminal
$ ionic serve

You can access the application by navigalign to:

http://localhost:8100/

If you prefer to view a simulator of iOS and Android side by side, you can choose to do that by navigating to:

http://localhost:8100/ionic-lab

You can also choose to run the Ionic server in the background by using screen Execute the following command:

$ screen -d -m -L ionic serve --address localhost -p 8100 --nolivereload --nogulp --nobrowser &

Remember to terminate the process when you no longer need to run the process:

Find out the PID (numeric value) for the process

ps aux | grep ionic

That will return a list of processes that runs Ionic

Terminate the process with the kill command

$ kill 11111 #whatever number your process has (PID)

If you revisit http://localhost:8100/ you should no longer be able to access the application.

How to upload files to S3

Make use of the S3FileUpload service to upload files to an S3 bucket. This service makes a request to the API to get a presigned (encrypted) url that it then uses to upload the file to the bucket. This way we don't have to expose all AWS secret credentials on the client. This service can be used to upload any type of files from the client app.

Example: Upload an image

In order to upload an image, just inject S3FileUpload in the controller responsible for handling the file upload. Then call the upload function of the service that takes 02 arguments, the file type (images in this case) and the file to upload

resp = S3FileUpload.upload('images', $scope.file);

If the file is uploaded successfully, the upload function returns the following object:

{
  message: 'File was successfully uploaded!',
  public_url: 'https://bucket_name.s3-region.amazonaws.com/images/file_name.png',
  success: true
}

In case of failure, we get the following response:

{
  message: 'An error occurred while attaching your file',
  success: false
}

Development Server Credentials

adventure-map-mobile's People

Contributors

amberwilkie avatar aniansson avatar diraulo avatar pigmentgit avatar sigu avatar tochman avatar

Watchers

 avatar  avatar  avatar

Forkers

isabella232

adventure-map-mobile's Issues

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.