1

I want to use the same folder of my MEAN app with Ionic. I've made a copy of my front end folder and made some changes to work with Ionic on it. Then, tested and exported a fully functional Ionic apk. So, now I want to have only one front end folder, but I'm very confused about it.

First, I've used ionic start APP_NAME blank to get a empty project. From that, I've inserted my front end code and adapted it.

Second, looking the folders content of Ionic, can I delete the lib folder, rescuing only the ionic_bundle.js? I know that plataforms and plugins are on the .gitignore, so they won't go to my repository.

Third, about merging, I'm completely frozen about how to do it.

This is my folder structure on MEAN repository without gitignored files:

¬ models
¬ www
  ¬ partials
  ¬ app.js
  ¬ index.html 
¬ routes
¬ server
¬ .gitignore
¬ package.json
¬ server.js

I want my Ionic project folder to fit together without any incompatibility.

This is my folder structure on Ionic project:

¬ hooks
¬ resources
¬ scss
¬ www
  ¬ partials
  ¬ app.js
  ¬ index.html
¬ .bowerrrc
¬ .editorconfig
¬ .gitignore
¬ bower.json
¬ config.xml
¬ gulpfile.js
¬ ionic.project
¬ package.json

Fourth, To unify the front end, I just need to merge www with www, but what happens with the other files? Should I create a folder called SERVER and IONIC on the root to separate them? Would this work? Would be bad to have only one package.json or this kind of approach would only bring more garbage?

How can I merge them without any problems?

Rodmentou
  • 1,610
  • 3
  • 21
  • 39

1 Answers1

0

Well, I've tried 3 approaches:

First, creating a SERVER and IONIC folder

The separation of folders did not work so well, because the public/www folder was still on the IONIC folder, while SERVER need to access.

A big problem of this approach was the package.json file. On test machines, it was possible to just use npm install on SERVER and on IONIC. The problem is that, if I needed to host on Heroku or do only one npm install, I would need postinstall instructions to another npm install

Second, only one folder, merged .gitignore and package.json

The second approach is very simple. Same folder and that's it. Works like a charm but bringing some problems. The hosted code will be very larger than it needed to be, because it will contain all Ionic related stuff. Also, Ionic packages should be addressed as dev dependencies. Some other adjust must be made too.

Third, two branches, Node and Ionic.

I haven't tried the third approach, because I don't know how. All the front-end/Ionic work would be done on the Ionic branch, while the Node branch would receive merges from it, but receiving only some files and folders. For example, the Node branch would serve the same www folder from the Ionic branch, but will not contain specific Ionic related files.

Rodmentou
  • 1,610
  • 3
  • 21
  • 39