A cross-platform blog for iOS, Android and web. Content powered by Cosmic JS.
CSS JavaScript HTML Objective-C Other
Latest commit acc027f Dec 22, 2016 @tonyspiro tonyspiro committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
native 🚀 Sep 22, 2016
web Delete npm-debug.log Nov 2, 2016
.gitignore 🚀 Sep 22, 2016
README.md Update README.md Dec 23, 2016
bucket.json 🚀 Sep 22, 2016

README.md

Cross-Platform Blog

alt tag This repo is an example of how to build cross-platform apps with content powered by Cosmic JS. The iOS and Android apps in this repo are built using React Native and the web app runs on a light Node.js web server, all with content served from the Cosmic JS CMS API. Create your content once, deliver everywhere.

Features

  1. Native iOS and Android apps share the same React Native codebase. Learn once, write anywhereTM.
  2. Web is fully responsive down to mobile w/ Bootstrap frontend.
  3. Images are easily manipulated for different device / browser requirements via the Cosmic JS provided Imgix integration.

Sign up for Cosmic JS to install the app, add / edit content and deploy the web app.

** Before trying to run any of the examples, make sure you are connecting to the example bucket cross-platform-blog or have imported the bucket.json in the root of this repo to your own bucket in Cosmic JS.

Web

View the web demo here

Get started with web

git clone https://github.com/cosmicjs/cross-platform-blog
cd cross-platform-blog/web
npm install

Run web in development

npm run development

Go to http://localhost:5000.

Run web in production

COSMIC_BUCKET=your-bucket-slug npm start

Go to http://localhost:3000.

Native

If you are new to React Native, make sure you check out the React Native docs to make sure you have everything set up properly.

Get started with native

cd cross-platform-blog/native
npm install

Config

Edit native/config.js to point to your bucket slug on Cosmic JS.

export default {
  COSMIC_BUCKET: 'your-bucket-slug'
}

Run iOS

Run the iOS command inside the native folder:

react-native run-ios

Run Android

Run the Android command inside the native folder:

react-native run-android

Questions

For any questions, feel free to reach out to us on the Cosmic JS website through the Intercom chat bubble on the bottom right side of the page. Or join the Cosmic JS Community on Slack.