Giter VIP home page Giter VIP logo

web's Introduction

Running

Copy .env.development.default to .env.development. Configure the right REACT_APP_API_URL in the .env.development and .env.production.

npm install
npm run start

Setting up the Development Environment

Make sure to install the following plugins for VSCode:

  • vscode-styled-components
  • Prettier - Code formatter (after installation, enable "Format On Save" in your IDE)

Coding Conventions and Goals

1. Strive to write programs "for people to read, and only incidentally for machines to execute" (Abelson && Sussman)

2. Naming conventions:

  • camelCase for Folder names;
  • PascalCase for Javascript file names

3. Separate styled components from React components in JSX

When importing styled components: import a full file as s then refer to the components as s.Component as in the following example. This makes it clear what's a styled component and what's a normal component

    import * as s from "./Exercises.sc";
    ...
    <s.ExercisesColumn>
    ...

4. Separate styling from the code (e.g. Exercises.js and Exercises.js.sc)

5. Avoid hardcoded string contstans

You're more prone to a mis-typing error that way. If you define a constant, you can benefit from auto-completion from your IDE.

6. General functions should be defined in general modules (e.g. utils)

E.g. If you end up definig a general random function, or a isUppercaseString(obj) function, etc. inside a component defintion, you're better moving them out of there. Two reasons:

  1. it's likely that you'll need to use them in other places than that component
  2. keeping things at the same abstraction level: the code in a component should worry about the main business of that component; not about defining generic functions.

7. Use onNotify / Notify pattern when handling Parent/Child updates in React

E.g. If a child can update an element which requires a re-render from the parent, the pattern should be:

export default function Parent({}) {
...
    onNotifyChange()
    {
        // Handle the change from the child component
    }

...

    <Child
        notifyChange={onNotifyChange}
    />
}

Notes

This project was bootstrapped with Create React App.

The project expects /teacher-dashboard to be deployed at localhost:3000 - that's another zeeguu project

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.