All Projects → spacemeshos → cosmic

spacemeshos / cosmic

Licence: MIT license
🌱🌌 Seed for a universal (native iOS, native Android, web, desktop) app based on react native web, redux and Typescript

Programming Languages

HTML
75241 projects
typescript
32286 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to cosmic

React Redux Hooks Starter
React-redux boilerplate using hooks 🎣
Stars: ✭ 69 (+115.63%)
Mutual labels:  react-redux, starter-kit
Webpack Starter Basic
A simple webpack starter project for your basic modern web development needs.
Stars: ✭ 552 (+1625%)
Mutual labels:  seed, starter-kit
Redux React Navigation Demos
React-Native + Redux + Redux-Persist + React Navigation ( Authentication Flow with Redux demos)
Stars: ✭ 151 (+371.88%)
Mutual labels:  react-redux, starter-kit
modernization-cookbook-template
Starter Cookbook for Application Modernization and Replatforming Engagements
Stars: ✭ 14 (-56.25%)
Mutual labels:  seed, starter-kit
Generator Ngx Rocket
🚀 Extensible Angular 11+ enterprise-grade project generator
Stars: ✭ 1,329 (+4053.13%)
Mutual labels:  seed, starter-kit
Whitestorm Typescript Boilerplate
📦 🚀 TypeScript boilerplate for WhitestormJS using react/redux ⚛
Stars: ✭ 285 (+790.63%)
Mutual labels:  react-redux, starter-kit
node-starter-kit
Node.js / GraphQL project template pre-configured with TypeScript, PostgreSQL, login flow, transactional emails, unit tests, CI/CD workflow.
Stars: ✭ 76 (+137.5%)
Mutual labels:  seed, starter-kit
react-redux-starter-kit
Get started with React, Redux, Webpack and eslint
Stars: ✭ 29 (-9.37%)
Mutual labels:  react-redux, starter-kit
Reactjs Crud Boilerplate
Live Demo
Stars: ✭ 83 (+159.38%)
Mutual labels:  seed, starter-kit
Starter Kit
📦 Angular 11+ starter kit for enterprise-grade projects
Stars: ✭ 1,102 (+3343.75%)
Mutual labels:  seed, starter-kit
Disperse
React/Redux dApp (decentralized app) boilerplate using Ethereum's blockchain
Stars: ✭ 36 (+12.5%)
Mutual labels:  seed, starter-kit
Express Typescript Boilerplate
A delightful way to building a RESTful API with NodeJs & TypeScript by @w3tecch
Stars: ✭ 2,293 (+7065.63%)
Mutual labels:  seed, starter-kit
Generator Jekyll Starter Kit
🚀 Jekyll Progressive Web App Generator.
Stars: ✭ 139 (+334.38%)
Mutual labels:  seed, starter-kit
Tsmean
Typescript-mysql-express-angular-node seed for your next web-app!
Stars: ✭ 173 (+440.63%)
Mutual labels:  seed, starter-kit
python-flask-app
Start building your next Python Flask app on IBM Cloud.
Stars: ✭ 48 (+50%)
Mutual labels:  starter-kit
react-ssr-advanced-seed
🔮 React SSR Advanced Seed (Typescript + nestJS + React SSR + React Native + Docker)
Stars: ✭ 76 (+137.5%)
Mutual labels:  react-native-web
weex-vue-starter-kit
weex starter kit in vue to use weexpack & weex both.(support hot-reload)
Stars: ✭ 24 (-25%)
Mutual labels:  starter-kit
example-typescript-package
Example TypeScript Package ready to be published on npm & Tutorial / Instruction / Workflow for 2021
Stars: ✭ 71 (+121.88%)
Mutual labels:  starter-kit
symfony-lts-docker-starter
🐳 Dockerized your Symfony project using a complete stack (Makefile, Docker-Compose, CI, bunch of quality insurance tools, tests ...) with a base according to up-to-date components and best practices.
Stars: ✭ 39 (+21.88%)
Mutual labels:  starter-kit
php-base-project
A Composer ready package to start a new PHP 7 project
Stars: ✭ 17 (-46.87%)
Mutual labels:  starter-kit

Spacemesh logo

Cosmic Apps Seed 🌱🌌

Browse Gitcoin Bounties

Overview and Motivation

Universal apps are apps which can run on mobile native or on the web inside a web browser. A Cosmic app is a mobile / web / desktop app - an app which can run in a web browser, on the desktop across all major desktop platforms and on mobile native on iOS and Android. A cosmic app shares all non presentation code between all platforms and ideally only has platform-specific presentation code for few platform-optimized features. e.g. use FaceId for user authentication when running on iPhone X. But the core idea that 90%+ of presentation code - the UI and layout is shared between all supported runtime platform.

A demo Cosmic App

Isn't this lovely?

This project aims to be a well designed and maintained seed for a cosmic (native mobile, web, desktop) app based on react native web, redux and typescript.

Team Spacemesh is building a cosmic Spacemesh App as the first client for go-spacemesh. Team Spacemesh decided to support Cosmic with funded github issues and contribute the seed to the community under the permissive MIT license. Spacemesh will use Cosmic as the foundation for its cosmic wallet app.

Why Cosmic?

Because universal is taken and Cosmic means universal, as of the cosmos :-)

What is this good for?

Tl;dr - the world should have a well-maintained seed for cosmic apps.

There are several similar seeds out there, but none with the project scope and goals we have in mind and none seem to be well maintained and updated.

Having a well designed and maintained seed for cosmic apps is useful for many kinds of applications across many verticals and can drastically reduce boilerplate code and encourages reuse of software components across different kind of packaging and execution environments.

Project Goals

We aim to provide a generic starter seed for building a modern, universal app with the following properties:

  • 100% sharing of app components (business logic) between all platforms
  • 100% sharing of platform services and assets management between all platform
  • Native iOS and Android look-and-feel
  • Reuse of all UI components and layout across all platforms
  • Use one main programming language for all platforms - Typescript to the rescue
  • Use only open source libraries and frameworks

We hope that using the seed developers will be able to be more productive in building cosmic apps as they can focus on their app logic and work using established patterns instead of having to write lots of boilerplate infrastructure code to support each runtime execution environment.

Architectural Directions

tl'dr - Yes, we are opinionated, very opinionated. We'd like to establish baselines patterns and libraries for cosmic apps. The following diagram outlines the concept:

  • React Native Web for all UI widgets and layout

  • Redux for all app state management and data flow between app components and ui components

  • React Router for app navigation. We would like to try using react-native-router-flux

  • App Components is where all shared application logic should be implemented. App components method are called based on app events (such as screen load or request for display data) via redux. App components are shared between all runtime environment and are basically Javascript modules

  • Platform Services are cross-platform components to deal with local resources such as secure storage, local db and local file system. They are implemented to support all runtime environment. e.g. desktop, native, web... They are used by App Components to implement app functionality.

  • Assets https service - We'd like to share almost all static assets / resources between all runtime platforms by serving them over https. React Native supports Network Resources which we can use for implementing cross-platform resources. We may resort to bundling some assets for mobile native delivery based on profiling but this will be an exception to the rule. For the demo app, we should use git hosted resources. All network resources should always be served over https.

  • packaging - an Cosmic app is packaged to the 4 currently supported platforms - Web, Desktop, iOS and Android. Packaging is implemented via tools and compile-time scripts. Desktop is supported via Electron packaging. Both Desktop and Web packaging include a Node.js app to serve the App screens. iOS and Android packaging is implemented using React Native packaging tools. Mobile native packaging supports Assets Bundles - bundling of static assets in the mobile native app packaged binary.

  • The cloud provides data and cloud services via https-json services implementing various APIs. The implementation details of these kind of services are irrelevant as far as an cosmic app is concerned as long as they provide the app with a functional documented API over a cloud endpoint. Note that the seed doesn't include cloud services. They are discussed here to explain how cosmic apps are implemented

  • Typescript is the sorcery which allows developers to build and to test cosmic apps with knowledge of only one programming language. It provides some type safety and a modern syntax for Javascript - the language actually used at the runtime of cosmic apps. It is a good choice because it is the recommended language or it is at least well supported by all underling libraries and frameworks used to build cosmic apps such as react-native, react-native-web

Setup

  1. Clone the repo

git clone https://github.com/spacemeshos/cosmic.git

  1. Follow these instructions for setting up a React Native project dev environment

Android Dev Notes

  1. Follow the React Native instructions for installing Android dev tools

  2. Make sure you have JAVA_HOME env var set to the Java 8 JDK as well as your ANDROID_HOME

e.g: export JAVA_HOME=<path-to-your-jdk>/<jdk>/Contents/Home
export ANDROID_HOME=<path-to-your-android-sdk>
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
  1. Run the emulator with an Android 6 (with Google Play) device

  2. Update build-scripts/local.properties with the right path to your android sdk. Detailed instructions.

Install project dependencies

yarn install

Development builds

web

yarn web

Mobile

Remove all build directories (optional):

yarn clean-all

Generate android and ios builds:

yarn mobile

Serve App on Android Emulator:

yarn android

Serve App on iOS Simulator:

yarn ios

Start and Electron dev app session:

yarn electron-dev

Production builds

Mobile

yarn mobile

Web

yarn build

Desktop

yarn dist

Bundling for Android

yarn bundle-android

Building for OS X, Windows and Linux

yarn electron-pack

Tests

This seed uses Jest for unit testing and calabash-android for android automation testing.

Running Calabash Android Tests

  1. Install ruby
  2. Run bundle install
  3. Run bundle exec calabash-android run /path/to/android/apk/file

Running unit tests

yarn test

Known issues

  1. The name react-native was looked up in the Haste module map. Remove the haste-map- files from your tmp file and rebuild. For Linux rm -rf /tmp/haste-map-* For OSX
yarn cache clean
watchman watch-del-all
rm -rf $TMPDIR/metro-bundler-cache-*
rm -rf $TMPDIR/metro-cache-*
rm -rf $TMPDIR/react-native-packager-cache-*
rm -rf $TMPDIR/haste-map-metro-*

Community

  • Cosmic Dev Talk Gitter Channel

  • We are actively looking for contributors, collaborators and maintainers. Get in touch via Gitter.

  • Help wanted - Our Epic first Gitcoin funded issue: #2

Misc cool tools

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].