This blog application is a mega-app that is built using a micro-app architecture. Each page (post, photo, profile) is a micro-app that uses expressjs, browserify, handlebars & sass. These micro-apps share other micro-apps like header. Each micro-app is published as a npm module at npmjs.com from where it is installed into the mega app.
The modular architecture is inspired from See-Eat-Sleep/AppUp and Condé Nast Traveler.
-
Clone the blog repo:
git clone [email protected]:gautamarora/blog.git
-
Install dependencies:
cd blog npm install
-
Run the app:
npm start
Now go to localhost:3000 to see the sample blog app
For development, its easiest to softlink all the dependencies to local folders for the microapp dependencies, here is how:
-
Clone all the microapp dependency repos:
git clone [email protected]:gautamarora/core.git git clone [email protected]:gautamarora/header.git git clone [email protected]:gautamarora/homepage.git git clone [email protected]:gautamarora/post.git git clone [email protected]:gautamarora/photo.git git clone [email protected]:gautamarora/profile.git
-
Install dependencies for all the above repos by running this command in each of them:
npm install
-
Create softlinks for all the dependencies by running this command in each of them:
npm link
-
Now go back to the blog repo and softlink it to the locally cloned repos:
npm link core npm link header npm link homepage npm link post npm link photo npm link profile
-
Now you can make edits to any microapp locally, and the changes will be reflected when you run the blog app:
npm start