GithubHelp home page GithubHelp logo

alexey-dc / react_koans Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 724 KB

Test cases for edge case behavior in React.js

License: GNU Affero General Public License v3.0

JavaScript 96.78% CSS 3.22%

react_koans's Introduction

About

This is a set of examples/tests of react edge cases. In part inspired by http://rubykoans.com/

Demo

A live demo is hosted at https://react.alexey-dc.com/

License

I licensed this work as AGPL - i.e. I want it to stay open source if any modifications or additions are made, and any distributions should have attribution. I'm aware of the criticisms of copyleft licenses, but in this case I don't think of this code as the foundation for any application code; I think preserving the openness of it is more important.

If you do wish to use a part of the code here in a commercial or closed-source project, or avoid attribution - I can be reached at [email protected] - perhaps we can work something out. I'm also open to being convinced that a different license is more appropriate.

This code was based on a template I own which is licensed as MIT, i.e. all code there is free for use in any form: https://github.com/alexey-dc/nextjs_express_template - you may find sufficient value there.

Running

The project relies on the dotenv package, so you'll need to create a .env file at the root of this project and add some environment variables into it. A .env-example file is included with the project that has all the expected environment variables.

It's recommended to use pnpm with this project, as pnpm-lock.yaml is commited: pnpm install. See https://classic.pnpmpkg.com/en/docs/install (or do npm install -g pnpm)

After all is ready, just do

# I recommend pnpm https://pnpm.io/benchmarks
pnpm install
pnpm start

# Otherwise use yarn or npm...
yarn start
npm start

I use HTTPS locally, and the instructions to set that up are below. If you wish to use HTTP instead, instructions are also below.

Http

In app/server.js, change

this.server = httpsServer(this.express)

to

this.server = httpServer(this.express)

Https

This project is set up to run HTTPS. The instructions to set up your certificates in localhost are below.

Localhost HTTPS

I recommend setting up certificates with mkcert. It's really simple:

# 1. Install mkcert
brew install mkcert   # For MacOS; for Linux - you can e.g. install brew https://docs.brew.sh/Homebrew-on-Linux
brew install nss      # for Firefox
mkcert -install

# 2. Issue certificates
mkdir mkcert          # Inside the root of this project
cd mkcert
mkcert localhost

Then set environment variables for your new cert:

# 3. Add certificate to a .env file at the root of this project
SSL_PRIVATE_KEY_PATH = mkcert/localhost-key.pem
SSL_CERTIFICATE_PATH = mkcert/localhost.pem

react_koans's People

Contributors

alexey-dc avatar

Watchers

 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.