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.
yarn:
npx create-react-app [project-name] --template @weareluastudio
npm:
npm init react-app [project-name] --template @weareluastudio
npm:
npm run prepare
yarn:
yarn prepare
|-- ๐ 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
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"
All rights reserved LUA Development Studio ยฎ