Awesome Open Source
Awesome Open Source

This is a simple (admin) starter with typescript, react and webpack.

Have a quick view:

setup

for husky

$ npm run prepare

If you do not need the taobao registry, you can change it in .npmrc

$ npm i

test

$ npm test

build for development

$ npm run dev

build for production

$ npm run build:(qa/prod)

characteristics

pages

TODO

  • config menu by user with permission
  • more functional pages like Socket Debugger

component example

import * as React from 'react'
import { observer } from 'mobx-react'
import { Button } from 'antd'

import useRootStore from '@store/useRootStore'

function Test() {
    const { routerStore } = useRootStore()

    const gotoHome = () => {
        routerStore.push('/')
    }
    return (
        <Button type="primary" onClick={gotoHome}>
            go to page index directly
        </Button>
    )
}

export default observer(Test)

live example

necessary extensions (on vscode)

how to upload file to server

#!/bin/bash

TIMESPAN=$(date '+%s')
DEPLOYNAME=ts-react-webpack.qa.${TIMESPAN}
DEPLOYFILES=${DEPLOYNAME}.tar.gz
SERVER=0.0.0.0

# make compression
cd dist/qa
tar -zcvf ${DEPLOYFILES} ./*

# upload
scp -P 22 -o StrictHostKeyChecking=no ${DEPLOYFILES} [email protected]${SERVER}:/home/pages/ts-react-webpack/tarfiles

# make decompression
ssh -p 22 -o StrictHostKeyChecking=no [email protected]${SERVER} tar xzf /home/pages/ts-react-webpack/tarfiles/${DEPLOYFILES} -C /home/pages/ts-react-webpack

if [ $? -ne 0 ]; then
    echo "success"
else
    echo "fail"
fi

how to deploy with nginx

server {
       listen       9993;
       server_name  localhost:9993;

       location / {
             root   ~/Documents/react/ts-react-webpack/dist/qa/;
             index  index.html index.htm;
       }
 }

the scaffold

steamer-react-redux-ts


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Typescript (252,294
Reactjs (72,763
Mobx (1,079
Admin Dashboard (898
Starter Template (674
Admin Template (265
Webpack5 (201
Related Projects