Split app dev environment question


#1

Noob Question: I have an app which has different logic scopes. Say an admin section, and a user section. Why do i write them in the same app?

I know that people are deploying multiple meteor apps hooked up to the same mongo db. Various other ingenius solutions are used to fix scaling issues. Or maybe I have heard that to improve performance on meteor apps, it is possible to split the app into instances which work on the same mongo db. Not sure…

Is this possible? Because in that case what would a dev environment look like? Run the two apps on different ports, but turn off meteor’s build cycle for the mongo db part, and host the mongo db seperately? Becuse if this is possible, why not have the admin and user sections as different apps?

I’m being completely serious. i’m quite new at CS in general, i don’t understand why this would not work. If someone can clarify my understanding of this, it would be most appreciated.

tat


#2

This is how I do it:

project
|- app
|- admin
|- packages

project is the overall git repo.
packages contains code shared by app and admin (shared code is in packages in the packages folder)
app is a meteor app that uses the shared packages (via a symlink) along with its own code
admin is a separate meteor app that uses the shared packages (via a symlink) along with its own code

To start the app:

cd project/app
meteor

To start the admin app: (in a separate terminal)

cd project/admin
export MONGO_URL='mongodb://localhost:3001/meteor'
meteor -p 4000

app is available on localhost:3000 using its own little mongodb instance
admin is available on localhost:4000 using app's mongodb instance rather than its own

So both the app and an admin app are running using shared code and a shared database (on port 3001).


#3

If this works like i think it does - why have i not been doing this all along… fml…

I’m going to go away and understand this. Thank you so much.