full-blown-react-structure

Simple Weather Forecast

MIT License

Stars
2

About The Project

Screenshot image

Built With

Project Structure

  • husky
  • config
  • src
    • api
    • assets
    • components
    • pages
    • router
    • store
    • types
    • ultils
  • tests
    • components
    • pages
    • store

Side notes

There is another branch called without-router5 which not included router5. The master branch otherwise is included with router5 and preload data mechanism. Data will be fetch before user visit home page. without-router5 branch is more dynamic, is will load data asynchronously after user visiting.

Unit-test cover all components, redux actions and redux store. API mock was enabled by axios-mock-adapter which is dead simple to use :)

Api fetching is proxy in webpack config.

Since this project is develop using typescripts and ts-loader is used. So it skips Babel.

Getting Started

To get a local copy up and running follow these steps.

Prerequisites

Install npm globally to run webpack project

  • Install npm
    npm install npm@latest -g
    

Installation

  1. Clone the repo
    git clone https://github.com/thinhlesdev/simple-weather-forecast.git
    
  2. Install NPM packages
    npm install
    

Development

Coding

  • Typescripts is strictly be used in this project
  • Code style is checked by eslint with airbnb-typescript plugin
  • Code format by prettier, prettier extention is recommend to install

Commit

  • This project is setup with commit-lint and follow conventional commit.
  • Commit message will be checked by husky so please follow this rule here
  • Make sure all unit-tests are pass and type are properly defined - they will be verify by using husky in every commits.

Usage

  1. To run project on your local machine
    npm run dev
    
  2. To run test
    npm run test
    
  3. To check test coverage
    npm run test:coverage
    

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Ryan Le - [email protected]

Project Link: simple-weather-forecast

Related Projects