Giter Club home page Giter Club logo

architecture's Introduction

Architecture

"We're talking about boxes and lines. We're talking about the big picture."

Contents


Getting Started

How to study the code in this repo.

setting up study-lenses

You will need NPM and nvm on your computer to study this material

Using a browser with good DevTools will make your life easier: Chromium, FireFox, Edge, Chrome

  1. Install o update the study-lenses package globally
    • $ npm install -g study-lenses (if you do not have it installed)
    • $ npm update -g study-lenses (if you already have it installed)
    • Didn't work? you may need to try:
      • (mac) $ sudo npm install -g study-lenses
    • having trouble updating?
      • try this: $ npm uninstall -g study-lenses && npm install -g study-lenses
  2. Fork and clone this repository:
    1. fork the HackYourFuture repository to your personal account
    2. clone your fork to your computer
    3. when there are updates to the module:
      1. update your fork with a PR
      2. pull the changes from your fork to your computer
  3. Navigate to the module repository in terminal
    • $ cd architecture
  4. Run the study command from your CLI
    • $ study
  5. The material will open in your default browser, you're good to go!
    • you can read the study-lenses user guide from your browser by navigating to localhost:xxxx?--help

If you use windows and get this error:

  • ..dy.ps1 cannot be loaded because running scripts ...

follow the instructions in this StackOverflow answer, that should take care of it ; )

npm run install

install everything.

npm run test -- path/to/file.spec.js

You can run tests in this repository using the test script, it will run all the tests in the path you provide.

If you do npm run test or npm run test -- ./ it will run every test in this repository. (there are a lot)

npm run document -- path/to/src

Pro Tip: do not use npm run document without a specific path, it is very slow!

This script will build a dependency graph for all the JavaScript files inside a specific /src folder. It can be very helpful to run the document script every time you add/remove a file or change the import/exports in an exercise.

If you run this script at a higher directory, like ./, it will document all of the /src folders inside that directory.

npm run format -- path/

This script will format all of the code in the path you provide.

Linting

There is no linting script in this repository. It's for practice only, no need to check every detail. Your project starter repositories will have linting scripts.

TOP


Study Tips

  • Don't rush, understand! Programming is hard.
    • The examples and exercises will still be there to study later.
    • It's better to fail tests slowly and learn from your mistakes than to pass tests quickly and not understand why.
  • Don't skip the examples! Understanding and experimenting with working code is a very effective way to learn programming.
  • Practice Pair Programming: two people, one computer.
  • Take a look through the Learning From Code guide for more study tips

Priorities

If you can't finish all the material in this repository, that's expected! Anything you don't finish now will always be waiting for you to review when you need it. These 3 emoji's will help you prioritize your study time and to measure your progress:

  • ๐Ÿฅš :egg: - Understanding this material is required, it covers the base skills you'll need for this module and the next. You do not need to finish all of them but should feel comfortable that you could with enough time.
  • ๐Ÿฃ :hatching_chick: - Do your best to start this material. you don't need to master it or finish it but getting the main idea will be helpful for taking the next steps.
  • ๐Ÿฅ :hatched_chick: - Have you finished all the ๐Ÿฅš's and started all the ๐Ÿฃ's? push yourself with these challenges.

Hashtags

There's sooo many examples and exercises in this repository, it's easy to forget of what you still need to finish or what you want to review again. Luckily VSCode is really good at searching through folders of code.

You can write hashtags in your comments while you're studying, then search for those hashtags later so you don't miss anything. Here's some ideas:

  • // #not-done, still a few blanks left - search for #not-done in VScode to find all the exercises you've started and not finished
  • // coercion is confusing, #review this again next week - search for #review to find the files you need to study again
  • ... anything goes! Find the hashtags that work for you

Module Project Boards

If you create a fork of this repository you can open a project board in your fork to track your progress through the module. Just 3 columns can be enough: Todo, Doing, Done.

TOP


Learning Objectives

What you can expect to learn in this module

expand/collapse
  • ๐Ÿฅš State: You understand the concept of state as the data stored in your application at each moment. You can explain how state is rendered into a user interface, and can explain how each user interaction reads/writes from state.
  • ๐Ÿฅš Persistence: You can explain what persistence means and how it can be implemented in the browser using localStorage. When you encounter a bug in your code based persisted data, you can use localStorage.clear() and a page refresh to reset your project's state.
  • ๐Ÿฅš Data-First Development: You understand applications as data + user interactions. You can demonstrate this by starting your planning process with the data you will need and building a user interface to show that data to a user.
  • ๐Ÿฅš Architecture & Layers: You can explain what software architecture is and the importance of layers for testing, collaboration, and maintenance. These are the layers you will learn to use, from the "back" to the "front":
    • Data Access: This layer is responsible for persisting your data, reading and writing from wherever it is stored. This layer has no fancy logic, it just gets things and puts things away again.
    • Business Logic: This layer is responsible for all the important actions in your application. The Business Logic layer does not ever interact directly with the user or the user interface. Instead it takes in JS data from the Presentation layer, reads/writes state via the Data Access layer, and returns new data for the Presentation Layer to render.
    • Presentation: This is the layer you studied in Separation of Concerns. It renders program state for the user, and handles their interactions. It's possible to different presentation layers for the same business logic!
  • ๐Ÿฅš Function Roles: You can use these new function roles while planning and developing your projects:
    • Data Access: Functions that insert (create), find (read), save (update), remove (delete) entries in your saved data. These are provided for you in this module. Data Access functions can only import utils and other data access functions.
    • Business Logic: Functions that take in JS data, read/update state, and return new data. these can be called from handlers, components, or other business logic. Business Logic functions can only import utils, data-access and other business-logic functions.
    • Handlers: The same role as in Separation of Concerns, only now with a few more restrictions. Handlers can not use data directly or use data access functions. They can only import Business Logic, Components and Utils.
    • Custom Events: Functions that return a new CustomEvent with your choice of .type, and data stored in the it's .details property. These will be very helpful for creating testable and reuseable components in your frontend. Custom Events can only import utils
  • ๐Ÿฅš Development Steps:
  • ๐Ÿฃ Nested Data: Given a nested data structure containing arrays, objects and primitive values, you can 1) access a given value 2) update a given entry 3) filter the data
  • ๐Ÿฃ Matching a JSON Schemas: You can write an object or array that matches a JSON schema.
  • ๐Ÿฃ Using a Library: You can select which functions from the /data-access library to use in your Business Logic functions. This includes reading the documentation, tests and source code to understand how the Data Access functions work.
  • ๐Ÿฃ Stateful Testing: You can pass and write unit tests for stateful functions - using beforeEach to reset state before each test, and testing for the correct side-effects in state.
  • ๐Ÿฅ TDD + Reverse Engineering: Given unit tests for the business logic and an obfuscated demo of the interface, you can build a working application that passes the tests and matches the demo.
  • ๐Ÿฅ Writing a JSON Schemas: You can write a JSON schema that matches several data instances.

TOP


About the Projects

template project for this module: architecture-starter

expand/collapse

Layer 0: localStorage

Layer 1: Data Access

Layer 2: Business Logic

Layer 3: Presentation


TOP


Suggested Study

Helpful links, examples and exercises.

expand/collapse

Software Architecture?

In this Repo

  • examples

    • ๐Ÿฅš /function-roles: learn about the function roles you will be using in this module
    • ๐Ÿฅš /stepped: study HTML/CSS/JS projects built up step-by-step (only examples)
    • ๐Ÿฅš /separated: study HTML/CSS/JS projects that have been separated by concern (only examples)
  • exercises
    • ๐Ÿฃ /json-schemas: learn to describe JS data using a schema, and how to validate data against a schema.

TOP


Week 1

expand/collapse

Before Class

During Class

Before Break

After Break

After Class

one big group project for the whole module

Build a JS quiz! There is some starter data for you in ./quiz-data, you can copy-paste it into the architecture starter's /data folder to get started.

There is some code already in the starter repository, it's just there so you can see how the folder structure works. Your group will want to remove the extra code before getting started (there are comments to help you find what's important to keep ).

- [ ] [repo](https://github.com/_/_) (with a complete README)
- [ ] [live demo](https://_.github.io/_)
- [ ] [Docs](https://github.com/_/_/tree/_/docs/README.md)
- [/planning](https://github.com/_/_/tree/_/planning)
  - [ ] communication plan
  - [ ] constraints
  - [ ] backlog
  - [ ] wireframe
  - [ ] development strategy
  - [ ] retrospective
- [ ] [project board](https://github.com/_/_/projects/1)

TOP


Week 2

expand/collapse

Before Class

During Class

Before Break

After Break

After Class


TOP


Week 3

expand/collapse

Before Class

During Class

Before Break

After Break

After Class


TOP


Week 4

expand/collapse

Before Class

During Class

Before Break

After Break

After Class


TOP


Class Recordings

  • Students: Here you can find recordings of this module from past classes. Enjoy!
  • Coaches: When sending your PR's with links please ...
    • Indicate which class you were teaching
    • Which week it was (if the module is more than 1 week)
    • Give your name
    • and a helpful description
expand/collapse

TOP

architecture's People

Contributors

colevanderswands avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.