Skip to content

An Electron app build with Ionic. It demonstrates all the CRUD operations of a simple REST API built in NodeJS https://github.com/skounis/nodejs-rest-contacts

Notifications You must be signed in to change notification settings

skounis/ionic-contacts

Repository files navigation

Ionic Contacts

Play with Ionic, Unit Tests and Electron.

A client front-end app for:

Test the LIVE DEMO or download the Electron version of the app (currently available for MacOS)

Prerequisites / Before we start

Backend

This applications needs a RESTful backend API to communication with. You have the following option

  1. Use the service deployed on Heroku:
  2. Install the nodejs-rest-contacts project and run it on your local box

Note: If you choose to go with the local installation you should set the MASTER_KEY and JWT_SECRET in .env file.

Dependencies

Go into the project folder and run npm install

API

Edit src/config.ts and set the base URL for the API and the MASTER_TOKEN. A test backend is deployed on Heroku:

If you use the deployed service on Heroku the MASTER_TOKEN is already in place.

If you run the nodejs-rest-contacts backend on your box, check the IP address and the port the Express server is listening for connections. (it should be 0.0.0.0:9000 or {your-local-ip}:9000)

Development

Run ionic serve and test the application in your browser.

Tests

Run npm run test and have all the unit tests executed. Currently the app.component.ts and data.service.ts are covered.

Electron

Run npm run dev and start the Electron app in development with all auto reload and everything as if you were developing ionic application in browser.

Note: You may need to reload the app the first time (ctrl + R)

Build Electron

Run npm run ebuild. This will create all the Electron redistributable files. Then check the ./dist folder for the generated binaries.

References

Bonus

Avatars are not part of the model. They are generated on the fly by utilizing the online service of Pravatar (eg: http://i.pravatar.cc/64?u=5b3f70010fcdd40014155032)

Technologies

Technologies used:

Troubleshooting

If running the tests fail try to install a latest version of webpack npm i webpack.

About

An Electron app build with Ionic. It demonstrates all the CRUD operations of a simple REST API built in NodeJS https://github.com/skounis/nodejs-rest-contacts

Resources

Stars

Watchers

Forks

Packages

No packages published