"Forking" (?) an app for different niche content apps?


#1

Hi everyone

Finally, I have an idea for an app!

Its a niche market kinda app with links to affiliate offers etc, and I have successfully been able to read and use the Meteor.settings.public.niche entry from settings.json and load all the records from my MongoDB using the niche setting:

{
	"public" : {
		"niche" : "ABC123"
	},
	"private" : {
	}
}

and then:

Meteor.startup(function() {
    Session.set("niche",Meteor.settings.public.niche);
    console.log("niche is: " + Session.get("niche"));
});

and then:

entries.find({"niche":Session.get("niche")});

Given this, and that I plan to use the same base code for multiple apps targetting particular niches, what is the best way to put the code into version control with Git. Do I:

  1. Fork it
  2. Create a branch
  3. Something else

I’ve read the Git docs but am having a hard time deciding just how to go about this.

I can see that forking an existing project and syncing the fork with an upstream repository (ie: the original app - the one I have at the moment) would be really beneficial as it would allow me to maintain the “original” app, and all changes would update all the forked copies. Do I have that right? I just want to maintain one set of code, and for each “app” to read its own Meteor.settings.public.niche variable (and maybe some CSS and images etc)

The current app is 22MB (android platform installed, but will also be targetting iOS as well soon) so want to understand how best to proceed from here before start making a complete mess of things. :smile:

So basically, I’d like to do something like this:

cd ~/meteor-apps/original-niche-app-1

And edit the main JS and CSS etc and settings.json for the main app that all the others will get updated from.

Then:

cd ~/meteor-apps/niche-app-2

And edit the CSS etc and settings.json for that app, where niche-app-2 is a fork of original-niche-app-1.

And then of course:

cd ~/meteor-apps/niche-app-3

And edit the CSS etc and settings.json for that app, where niche-app-3 is also a fork of original-niche-app-1.

Would that be the way to go?

And just a thought, how would it be best to not have to create multiple 22mb folders for each app, since really I’d be changing only one or two files maybe in each subsequent niche app? I know .gitignore lists the .meteor folder, but as soon as I change to that niche folder and run meteor, it will download everything it needs and consume disk space. I’m thinking of maybe publishing 200-300 apps to Android app stores (each a separate niche market product app) so would like a way to maybe avoid that disk space usage (I have a 500GB drive and can attach more if need be though)

I have already deployed this main app to an EC2 instance and my Android device shows the niche images and text, so that part is all done - I plan on using just that one instance and one database to hold all entries in each niche, so all each subsequent app needs is an edit to settings.json to read the niche code and maybe have slightly different myapp.css, so thinking more about it, perhaps all I need to do is to create a project that has just those two files in it, and maintain them there, and then simply copy them to the main app folder when wanting to deploy say niche-app-2, niche-app-3, niche-app-4 etc etc.

Then again, what if one particular niche app needs some tweaks to its JS or other core templates etc? Argh! I just thought about splash images and icons etc - I’m over-thinking this … sorry.

I use Ubuntu 14.04 LTS and have Git installed. I have not yet created a repository etc, but do have a Github account.

I have Atom and Microsoft Visual Studio Code installed, each of which has Git integration.

EDIT: I just watched: https://www.eventedmind.com/feed/meteor-organizing-environment-variables-and-settings
That gives me some ideas…

Any suggestions would be very welcome.

My abject apologies for the long rambling post.

Thank you.

EDIT: Since I use Ubuntu to create these Android apps (and I have a iMac so *nix based and would work the same?) I think I can create a symbolic link of a folder in the main app folder structure to a folder stored elsewhere that has the next niche app settings - so all I’d need to do is recreate that symbolic link in the main app folder structure each time I wanted to create a new app (because the rest of the app stays exactly the same, code wise - just the niche code and CSS perhaps would change for each niche app) I think this will be the way to go… must test! Got this idea from looking at Meteor packages installed on my local machine (specifically raix:push) and can see that there is a folder (under Ubuntu) with an arrow on it that points to a different folder …so searched for symbolic link on Ubuntu and found this: http://askubuntu.com/questions/214643/help-with-creating-symbolic-link - see the very last comment. So I think this will work for my app idea. Thanks for reading and again apologies for doing a brain dump here. :smile: Just excited I guess.