Reapp is everything you need to build amazing apps with React: a collection of packages that work together, our UI kit, and a CLI that scaffolds your app and includes a server and build system.

Related tags

Kotlin reapp
Overview

What is it?

Reapp is everything you need to build amazing apps with React: a collection of packages that work together, our UI kit, and a CLI that scaffolds your app and includes a server and build system.

Join the chat at https://gitter.im/reapp/reapp

Installation

Installation is done through npm:

npm install -g reapp

Generate a new base reapp stack with:

reapp new [name]

And finally in your app directory, run it on localhost:3010:

reapp run

CLI

The CLI has three main functions: creating new apps, running them, and building them for release.

Note that when you run your app, it will run in development mode by default which is much slower but easier to debug. Run it in production mode to get a feel for real-world performance.

CLI Usage:

Usage: reapp [command]

  new [name]  creates a directory with a new reapp-starter scaffold
  run         runs a reapp application with express/webpack-dev-server
  build       builds a reapp application to a bundle in ./build
  debug       use this for opening issues!

The build and run commands take a variety of options to help ease your development, such as:

Usage: reapp-run [options]

  -d, --debug          output extra information for debugging
  -p, --port [number]  specify a port [number]
  -h, --host [host]    specify hostname
  -b, --bind [address] specify bind address if different from host
  -e, --env [env]      specify an environment
  -t, --tool [tool]    specify a webpack devtool
Usage: reapp-build [options]

  -d, --debug  output extra information for debugging
  --no-assets  only build the js
  --no-js      only build the assets

Running & Building

Use reapp run to serve your app locally, by default at localhost:3010. The run command has a few options to help you out:

  • reapp run -d (debug) to output information on how it's running your app
  • reapp run -e production (env=production) to run your app in production mode, which is much faster
  • reapp run -t source-map (tool=source-map) to have full sourcemaps rather than the "eval" style sourcemaps we default to

If you run into a blank page after reapp run, try these commands.

npm install --save [email protected]
npm install --save [email protected]
npm install --save [email protected]

You also have the same flags available to build commands.

The build command is used once you're ready to deploy your app (to either the web or to cordova). For now, we provide two types of builds:

  • reapp build by default sets the platform to web, for mobile sites.
  • reapp build ios targets Cordova ios devices.

When you run reapp build you'll notice a new ./build folder where your assets have been copied to. For example, a reapp build ios will build to ./build/ios. reapp build goes to ./build/web.

It will also copy your assets for you. Here's an example of running reapp build ios:

./assets/shared/* => ./build/ios
./assets/ios/* => ./build/ios
./assets/ios/index.html => (Webpack inserts CSS/JS references) => ./build/ios/index.html

This allows a lot of flexibility. You can share assets between builds, or have exclusive ones for a platform. Leave an asset in the base ./assets folder and it won't be copied at all, but you can still require() it within your app.

A good case for shared assets is your Cordova config.xml. Leave it in ./assets/shared and it'll output for all your builds.

See more on custom builds.

Structure of your applications

You can see the exact app that's generated through the reapp-starter repo.

/app
  /components
  /theme
  app.js
/assets
  /web
    index.html
  /ios
    index.html
  /shared
/config (optional)

By default /app/app.js is your entry point. Everything in the app folder should be pretty self-explanatory. /assets contains static assets as explained in the Running & Building section. In general, you'll place your assets into shared or the specific platform subdirectory.

The /theme folder is reapp-ui specific. You can find docs for it in the repo, but it also should be pretty easy to understand.

If you place a build.webpack.js or run.webpack.js in your /config dir, the reapp CLI will use these configs when you run reapp build or reapp run. To see some example configs, check out the files in the ./config folder of the reapp-pack repo.

Your First App

There are a number of pieces we've included in a reapp. Let's explore a few of them in order of when you'll encounter them in your codebase. Think of this as a tour of a reapp app, giving an introduction to packages as we encounter them.

You can check out the reapp project on Github for more info.

You also have an entry point defined as app/app.js. This starts your app. The most important part here is the routing. Lets start there.

./app/app.js

Load all your stuff. From theme to store to actions. Then, you run your routes, which are done using reapp-routes. This simplifies routing down to the bare minimum. Note that your routes will automatically look into ./components to find files, based on the name you give them.

An example:

routes(require,
  route('home', '/', route('sub')))

  // ./components/Home.jsx
  // ./components/home/Sub.jsx

This is the reapp-routes syntax. The key to note here is the require that is passed to the routes function at the top level, which is how it dynamically requires your components based on the route tree.

./app/theme (reapp-ui UI Kit)

The next theme we require is the ./app/theme/index.js. Themes are loaded by calling Reapp.theme() and passing in an object with styles, constants and animations. You can just use the included iOS theme, but we've included the ./app/theme folder as an example of how you can easily customize themes.

For more documentation on themes, read here.

./app/components/Home.jsx

This is the first React component in your structure, as defined in your routes. Notice when we export it, we wrap it with Reapp. This helper function will provide the this.context variables that you've set up when you loaded your theme, actions, and store (if you decide to use all of those). It will also pass props to your Home route, this.props.child and this.props.viewListProps. You can see that they correspond to any children routes, and to properties needed to be on a that will handle those routes.

More reading

Custom builds

Reapp-pack takes in an object that lets you configure your builds. It provides you with default config files, but you can override them if you need custom Webpack loaders.

The build system generates your Webpack config using reapp-pack.

  • reapp run looks for: ./config/run.config.js
  • reapp build looks for: ./config/build.config.js
  • reapp build [platform] looks for: ./config/build.[platform].config.js

Place a config in your ./config/[run/build].[platform].config.js to override the default.

Here's an example config:

module.exports = {
  entry: './app/app.js',
  devtool: 'none',
  target: 'web',
  env: 'production',
  linkModules: true,
  debug: true,
  separateStylesheet: true,
  minify: true
};

You can also provide the following options that are passed to Webpack:

  loaders: array
  modulesDirectories: array
  prefetch: array

Why Reapp?

Reapp wasn't built purposefully to be a framework. Instead, it started as a UI kit. From that kit, two apps were built. While this isn't a lot, it was enough to see repetition between the two that could be extracted.

From those two apps, over a period of months, we extracted a set of packages, ensuring to keep each of them completely independent. It was an experiment in seeing if a framework was necessary.

What we found was this: if you can subscribe to a certain file structure, you can avoid the framework. With that file structure, we can provide helpers via a CLI. Bootstrap your app in one command and you have a mature build system built in, without having to do anything.

Really, Reapp is simple. You could even just use the UI kit and roll your own app. We just went through that headache, and decided to make it easier to avoid it if you like how we make apps.

Example Apps

We have two example apps you can check the source to:

Development Environment

Sublime users, here's a guide for getting syntax highlighting, snippets and linting that works with babel.

Other reapp packages

You might also like...
The Klutter CLI tool gives access to all tasks to create and manage a Klutter project.

Klutter CLI The Klutter CLI tool gives access to all tasks to create and manage a Klutter project. Gettings started Download the tool. Unzip the file.

🚀 CLI-like personal webpage built with Kotlin/JS
🚀 CLI-like personal webpage built with Kotlin/JS

kotlin-cv.js Personal terminal-like simple webpage template built with Kotlin/JS. The template features CLI commands help, cat, ls, their completion a

A plugin for Termux to use native Android GUI components from CLI applications.

Termux:GUI This is a plugin for Termux that enables command line programs to use the native android GUI. In the examples directory you can find demo v

Modifold - Kotlin CLI tool for moving curseforge mods to modrinth
Modifold - Kotlin CLI tool for moving curseforge mods to modrinth

Modifold Modifold is a Kotlin CLI utility that allows you to transfer mods from

Solid - A CLI that tries to cover a dry-run phase for liquibase database change management

solid a CLI that tries to cover a dry-run phase for liquibase database change ma

A CLI tool to convert multi-module Jetpack Compose compiler metrics into beautiful HTML reports
A CLI tool to convert multi-module Jetpack Compose compiler metrics into beautiful HTML reports

A CLI tool to convert multi-module Jetpack Compose compiler metrics into beautiful HTML reports 1. What are Jetpack Compose compiler metrics? The Comp

A fork of our clean architecture boilerplate using the Model-View-Intent pattern

Android Clean Architecture MVI Boilerplate Note: This is a fork of our original Clean Architecture Boilerplate, except in this repo we have switched o

A fork of our clean architecture boilerplate, this time using the Android Architecture Components

Android Clean Architecture Components Boilerplate Note: This is a fork of our original Clean Architecture Boilerplate, except in this repo we have swi

Starter Kit for Android projects.

About Android Starter Kit was created as a way to save time when starting a new Android project. It is a simple native single-module app based on MVVM

Comments
  • Override default options with custom config

    Override default options with custom config

    Looks like this is the reason why custom config is not having effect https://github.com/reapp/reapp/issues/91 Custom values are being overwritten by default options

    opened by timuric 1
  • Fixes #60 by removing unintentional error reference

    Fixes #60 by removing unintentional error reference

    This change will once again allow debugging of a reapp app using the -d switch (or running repp-debug). Because the e var was out of scope in the called function, the default reapp-pack config file was not being loaded in the absence of a local config file.

    opened by jhopper28 1
  • If custom config throws as error treat it as such.

    If custom config throws as error treat it as such.

    Fixes #72 When a custom config file throws an error, reapp treated it as if the config file was not found, printed an error message saying as much and went on to try the default config file inside reapp-pack.

    opened by boazy 0
  • Add a Gitter chat badge to README.md

    Add a Gitter chat badge to README.md

    reapp/reapp now has a Chat Room on Gitter

    @natew has just created a chat room. You can visit it here: https://gitter.im/reapp/reapp.

    This pull-request adds this badge to your README.md:

    Gitter

    If my aim is a little off, please let me know.

    Happy chatting.

    PS: Click here if you would prefer not to receive automatic pull-requests from Gitter in future.

    opened by gitter-badger 0
Owner
reapp
Make amazing mobile apps
reapp
👋 A common toolkit (utils) ⚒️ built to help you further reduce Kotlin boilerplate code and improve development efficiency. Do you think 'kotlin-stdlib' or 'android-ktx' is not sweet enough? You need this! 🍭

Toolkit [ ?? Work in progress ⛏ ?? ??️ ?? ] Snapshot version: repositories { maven("https://s01.oss.sonatype.org/content/repositories/snapshots") }

凛 35 Jul 23, 2022
An amazing expense tracker app, with great features and beautiful UI. Check it out!

My Expense Tracker Expense tracker app to keep your finances in order. Built entirely in Kotlin using modern architecture components. Build ??️ My Exp

Ken Ali 7 Oct 26, 2022
A news app with amazing features.

Newdo-News In this app I'll show you how to fetch current news from a public API. The aim of this project is to show you how use best practices in And

Victor Loveday 6 Aug 17, 2022
Includes jetpack compose, navigation, paging, hilt, retrofit, coil, coroutines, flow..

Nextflix-Composable A Clean Architecture App to show use of multi-module-architecture in a Jetpack Compose. The modules are as follow: app: Presentati

Talha Fakıoğlu 198 Jan 1, 2023
KaMP Kit is to facilitate your evaluation of Kotlin Multiplatform (aka KMP)

KaMP Kit Welcome to the KaMP Kit! About Goal The goal of the KaMP Kit is to facilitate your evaluation of Kotlin Multiplatform (aka KMP). It is a coll

bas 0 Oct 25, 2021
The goal of the KaMP Kit is to facilitate your evaluation of Kotlin Multiplatform

KaMP Kit Welcome to the KaMP Kit! About Goal The goal of the KaMP Kit is to facilitate your evaluation of Kotlin Multiplatform (aka KMP). It is a coll

null 0 Nov 11, 2021
A android platform i.e, App that helps marriage/party halls and individuals to connect to the nearest places where this food could feed those in need and food wastage is minimised

(Muskan- The joy of giving by nature) , a android platform i.e, App that helps marriage/party halls and individuals to connect to the nearest places where this food could feed those in need and food wastage is minimised.

OxVidhi 15 Nov 26, 2022
Dots indicator that shows the current position on a View Pager. It does all the work for you with a few customisations.

Dots What is Dots? Dots is a library that helps in implementing a simple yet effective dots indicator for the View Pagers used in your android code. I

Deepan 23 Feb 16, 2022