weareluastudio / cra-template-luapp

LUApp its a typescript cra-template with firebase, react-router, react-feather, react-snapshot, prettier and ts-lint for code linting, it also includes HOC for app strings like Android App structure.

Repository from Github https://github.comweareluastudio/cra-template-luappRepository from Github https://github.comweareluastudio/cra-template-luapp

LUAppยฎ | cra-template

LUApp it's a typescript cra-template with firebase, react-router, react-feather, react-snapshot, prettier and ts-lint for code linting, it also includes HOC for app strings like Android App structure.


๐Ÿ›  Start building from our app template

โ€ข replace [project-name] with your app name

yarn:

    npx create-react-app [project-name] --template @weareluastudio

npm:

    npm init react-app [project-name] --template @weareluastudio

๐Ÿ”Œ Install optional dependencies (prettier, tslint, react-snapshot)

npm:

    npm run prepare

yarn:

    yarn prepare

๐Ÿ— App Structure

|-- ๐Ÿ“ public/
|   |-- ๐Ÿ“‘ index.html
|   |-- ๐Ÿ“œ manifest.json
|   |-- ๐Ÿค– robots.txt
|-- ๐Ÿ“ src/
|   |-- ๐Ÿ“š Components/
|   |    |-- ๐Ÿ’ป App/
|   |        |-- โš›๏ธ App.tsx
|   |-- ๐Ÿ—ƒ Context/
|   |    |-- ๐Ÿ“ฆ MainContext.ts
|   |-- ๐Ÿ‰ Lang/
|   |    |-- ๐Ÿ“„ Strings.json
|   |-- ๐ŸŒŽ Env/
|   |--  |-- ๐Ÿ‰ Strings.ts
|   |    |-- ๐Ÿ“ฆ global.d.ts
|   |-- ๐Ÿ“– Pages/
|   |    |-- ๐Ÿ“ Index/
|   |        |-- โš›๏ธ Index.tsx
|   |-- ๐Ÿ–Œ index.css
|   |-- โš›๏ธ index.tsx
|   |-- ๐Ÿ“ฆ react-app-env.d.ts
|   |-- ๐Ÿ“ฆ serviceWorker.ts
|-- โš™๏ธ .editorconfig
|-- ๐Ÿ’…๐Ÿฝ .prettierrc
|-- โ›”๏ธ .gitignore
|-- ๐Ÿ—ณ tsconfig.json
|-- ๐ŸŽ€ tslint.json

๐Ÿค” How it works

When you create a page you must create a folder on ๐Ÿ“– src/Pages and then edit ๐Ÿ’ป src/Components/App to add the page on router. If you work on SPA (Single Page Application) just add components to ๐Ÿ“ Pages/Index/Index.tsx

When you write strings to your app, edit on ๐Ÿ‰ Lang/Strings.json and consume the strings from Context Provider, example:

// Pages/MyPage.tsx
import React, { useContext } from "react";
import MainContext from "../Context/MainContext.ts";

const MyPage: React.FC = () => {
  const { lang } = useContext(MainContext);

  return <h1>{lang.hello}</h1>;
};

IMPORTANT! interface on ๐ŸŒŽ Env/Strings.ts always reference to ๐Ÿ‰ Lang/Strings.json and now since version 0.4.8 its autogenerate on change so dont worry

// Env/Strings.ts
export interface Strings {
  es: Es;
}

export interface Es {
  hello: string;
}
// Lang/Strings.json
{
    "es": {
        "hello": "Hello World"
    }
}

This template it's very useful for large or complex projects with many developers, at LUA Development Studio all of our apps are written with this template. 'We use Context Api instead of Redux or MobX, just for performance"


LICENSE MIT

All rights reserved LUA Development Studio ยฎ

About

LUApp its a typescript cra-template with firebase, react-router, react-feather, react-snapshot, prettier and ts-lint for code linting, it also includes HOC for app strings like Android App structure.

License:MIT License


Languages

Language:TypeScript 75.6%Language:HTML 19.3%Language:CSS 5.1%