Skip to content

Modus-Logo-Long-BlackCreated with Sketch.

  • What we do
  • Who we are
    Our story

    Learn about our values, vision, and commitment to client success

    Open source

    Discover how we contribute to and benefit from the global open source ecosystem

    Careers

    Join our dynamic team and shape the future of digital transformation

    How we built our unique culture
  • Who we serve
    Life Sciences

    Advancing health with smarter technologies

    Financial Services

    Building trust through secure, digital solutions

    Automotive

    Driving innovation in mobility and manufacturing

    Retail

    Enhancing customer experiences across every channel

    industries-menu-cta
  • Our work
  • Our blog
  • Resources
  • Get in touch
  • EN
  • FR

Ionic 2 Project Structure

Published on May 24, 2016
Last Updated on April 8, 2021
Application Development

This is the first part in a series of introductory posts on Ionic 2.

If you’re not familiar with Ionic 2, it’s the latest incarnation of Ionic – “the world’s most popular cross-platform mobile development technology.” This latest version has been updated with a whole host of new features. The biggest and most obvious change is support for Angular 2.

The ionic.io site has this to say: “With Ionic 2, we’ve gone back to square one and completely rethought how a mobile toolkit should work. We’ve dramatically improved performance, reduced the complexity of the code you need to write, and made it possible to build completely bespoke apps that compete with the best apps in the world.”

Where Do We Start?

I always like to get a big picture view of an app before diving in. For me, that usually includes an understanding of what the critical files are and where everything is. How do I configure this thing? How do I bootstrap it? Where do I put my all of my shit application files? So, with that in mind, let’s take a look at how this project is structured.

Overview

Ionic 2 Project Structure

For the sake of brevity, I’m going to pick the most interesting parts and not mention some of the more boring/obvious ones. I’m looking at you node_modules.

Folders

./app

Starting with folders, we can see that the bulk of our app lives here: pages, services, etc.

./hooks

These scripts run as part of the Cordova build process. If you need to customize that in any way, then do it here.

./platforms

Contains your platform targets like iOs or Android.

./www

This is where your index.html file lives. However, don’t be fooled into thinking this is where your app should live. Put all of your application scripts in the ./app folder.

./www/index.html

This is obviously where you should update your meta tags and add in any required scripts (cordova, polyfills, vendor build, app build, etc.).

./ionic.config.json

These are your project-specific settings. Primarily it’s just the app name and id along with any proxies you may need for your app.

./package.json

If you are familiar with npm, you will recognize this immediately. If not, then this file describes your app’s production and development dependencies.

./webpack.config.js

(optional) If you are using webpack for builds then you certainly will need this for adjusting your webpack build settings. If you are not using webpack then, please move on… nothing to see here.

./gulpfile.js

Here you find hooks for modifying the Ionic gulp tasks. Use these to modify the Ionic build. There are a number of custom hooks you can take advantage of. You most likely will not need to modify this file.

./app/app.js or app.ts

Finally some code! This is where we bootstrap our application and where you will find your app’s @App decorator. There are a handful of global settings you’ll want to pass in. Most importantly, you’ll want to pass your app’s root template, config and list of providers.

Summary

I hope you found this quick Ionic post helpful. As always, don’t let your quest for knowledge end here. Head on over to the Ionic 2 Documentation and read up on this great framework. If you have any comments or wisdom to share with me in return, leave them below or look me up on Twitter!

Posted in Application Development
Share this

Timothy Eagan

Timothy Eagan was a Senior Engineer at Modus Create, and is an accomplished software developer with over 20 years of experience in creating customized business solutions. He can be found in Providence, RI. Tim is also an OIF veteran, former paperboy and part-time comedian.
Follow

Related Posts

  • Building Better Ionic Apps with Ionic Pro
    Building Better Ionic Apps with Ionic Pro, Part 3

    In our previous post, we demonstrated how to easily run an Ionic app on devices…

  • Building Better Ionic Apps with Ionic Pro
    Building Better Ionic Apps with Ionic Pro, Part 2

    In Part 1 of this series, we created a rapid prototype using Ionic Creator. In…

Want more insights to fuel your innovation efforts?

Sign up to receive our monthly newsletter and exclusive content about digital transformation and product development.

What we do

Our services
AI and data
Product development
Design and UX
Modernization
Platform and MLOps
Developer experience
Security

Our partners
Atlassian
AWS
GitHub
Other partners

Who we are

Our story
Careers
Open source

Our work

Our case studies

Our resources

Blog
Innovation podcast
Guides & playbooks

Connect with us

Get monthly insights on AI adoption

© 2025 Modus Create, LLC

Privacy PolicySitemap
Scroll To Top
  • What we do
  • Who we are
    • Our story
    • Careers
    • Open source
  • Who we serve
    • Life Sciences
    • Automotive
    • Financial Services
  • Our work
  • Our blog
  • Resources
  • Get in touch
  • EN
  • FR