1. Project Structure

1.1. Why Include a Demo App?

  • Examples of:
    • Automated deployment
    • Directory structure and file naming
    • Framework usage
    • Testing
    • Mock API
  • Codifies decisions
  • Interactive example of working with starter

1.2. Tips

  1. Cannot put js in html. Put js in a .js file

    <html>
      <body>
      <script>
      // slap code here...
      </script>
    </html>
    
    • Test this?
    • Lint this?
    • Reuse this?
    • Transpile this?
    • Import explicit dependencies?
  2. Consider organizing by feature

    Organize by file type (MVC)

    /components
    /data
    /models
    /views
    

    Organize by Feature (larger app)

    /authors
    /courses
    
  3. Extract logic into "POJOs" (plain old javascript object, no framework-specific code)

    Put utils to utils folder, this doesn't have any relationship with react.

Copyright © Guanghui Wang all right reserved,powered by GitbookFile Modified: 2019-08-25 13:56:34

results matching ""

    No results matching ""