All Projects → webkom → lego-webapp

webkom / lego-webapp

Licence: MIT license
Open source frontend for abakus.no

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to lego-webapp

react-app-simple-chat-app
A Simple Chat Application using MERN stack (MongoDB, Express JS, React JS, Node JS) and Socket.io for real time chatting
Stars: ✭ 41 (-6.82%)
Mutual labels:  babel7, webpack5
react-easy-ssr
🔥 React Starter Project with Webpack 5, Babel 7, TypeScript, Redux-saga, Styled-components, React-jss, Split code, Server Side Rendering.
Stars: ✭ 31 (-29.55%)
Mutual labels:  babel7, webpack5
cypress-retry
Retry just the failed Cypress.io tests using Cypress module API and AST rewriting
Stars: ✭ 16 (-63.64%)
Mutual labels:  cypress
cypress-upload-file-post-form
Solution for two Cypress testing use-cases I came across with: perform a direct http FORM request to the server containing a file and other parameters and upload a file into a form before submission
Stars: ✭ 59 (+34.09%)
Mutual labels:  cypress
TLE5012-Magnetic-Angle-Sensor
This repository includes an library for Arduino for the TLE5012 Magnetic Angle Sensor with SSC interface.
Stars: ✭ 37 (-15.91%)
Mutual labels:  cypress
cypress-example-docker-circle-workflows
Cypress + Docker + CircleCI Workflows = ❤️
Stars: ✭ 29 (-34.09%)
Mutual labels:  cypress
cypress-slack-reporter
A home for various Cypress Plugins
Stars: ✭ 126 (+186.36%)
Mutual labels:  cypress
cypress-page-object
Represent the screens of your website as a series of objects in your Cypress test suite
Stars: ✭ 23 (-47.73%)
Mutual labels:  cypress
starter-kit
Starter kit for full-stack JavaScript projects
Stars: ✭ 21 (-52.27%)
Mutual labels:  cypress
main
Mocks Server monorepo
Stars: ✭ 109 (+147.73%)
Mutual labels:  cypress
uiw-admin
UIW-Admin Panel Framework, Powered by React and @uiwjs.
Stars: ✭ 21 (-52.27%)
Mutual labels:  webpack5
cypress-nextjs-auth0
Cypress commands to support Auth0 and Next.js
Stars: ✭ 56 (+27.27%)
Mutual labels:  cypress
webpack-starter
Simple webpack config with babel, scss, and lodash
Stars: ✭ 47 (+6.82%)
Mutual labels:  babel7
quasar-testing
Testing Harness App Extensions for the Quasar Framework 1.0+
Stars: ✭ 142 (+222.73%)
Mutual labels:  cypress
react-resume
Resume Builder in React
Stars: ✭ 70 (+59.09%)
Mutual labels:  cypress
xvfb
Easily start and stop an X Virtual Frame Buffer from your node apps
Stars: ✭ 35 (-20.45%)
Mutual labels:  cypress
odoo-cypress
Odoo Framework E2E Testing using Cypress
Stars: ✭ 19 (-56.82%)
Mutual labels:  cypress
zmi
🎃 Universal React Vue miniapp-ts development tool
Stars: ✭ 99 (+125%)
Mutual labels:  webpack5
cypress-cheat-sheet
A cheat sheet for Cypress.io
Stars: ✭ 27 (-38.64%)
Mutual labels:  cypress
cypress-browserify-preprocessor
Cypress preprocessor for bundling JavaScript via browserify
Stars: ✭ 23 (-47.73%)
Mutual labels:  cypress

lego-webapp

Open source frontend for abakus.no

MIT last commit coontibutors Build Status

Issues: We track issues in the main repo of LEGO

open issues

Quick access

  1. Quick Start
  2. Development
  3. Deployment (webkom/lego#deployment)

Quick Start

$ yarn # Install dependencies
$ yarn start:staging # Start webserver with development backend

Everything should be up and running on localhost:3000. The :staging suffix points the webserver at a hosted development backend.

Running with local backend

First, you need to have the django backend running, see webkom/lego.

$ yarn start # Start webserver with local backend

Server side rendering (Optional)

In production (live) we use server side rendering. Due to bad hot reloading, we don't use it by default in dev. The server side renderer can be started by running:

$ yarn build
$ yarn ssr # or yarn ssr:staging

Environment Variables

The webserver running the frontend can take many optional environment variables. Docs can be found at config/environment.md, and default can be found at server/env.js and config/env.js.

Development

We use some conventions and tools for our JavaScript/React development.

  • prettier for JS code formatter.
    • yarn prettier
  • eslint for finding and fixing problems in your JavaScript code.
    • yarn lint
  • flow as a static type checker for JavaScript.
    • yarn flow

We recommend getting plugins/extensions in VSCode or Vim so the code auto-formats, and automatically prompts you with errors. When you submit code to Github the CI server will automatically run all the commands above to check that your code is up to par.

Unit tests

Unit tests (jest)

Run all the tests and check for lint errors with the command:

$ yarn test

For development you can run the tests continuously by using:

$ yarn test:watch

A coverage report can be generated by running yarn test -- --coverage.

Cypress E2E (End-to-end tests)

End to end tests (cypress)

In order to run end to end tests, you need to run both lego-webapp and lego. Lego can be found here: https://github.com/webkom/lego. Lego is assumed to have a clean development database, follow the steps below to achieve that.

Backend

$ cd ../lego
$ docker-compose up -d # Start all services that lego depends on
$ python manage.py initialize_development # Initialize and load data sources (postgres)
$ docker-compose restart lego_cypress_helper # The cypress helper resets database between every test and might need this restart to function correctly
$ python manage.py runserver

If you already have the backend setup, make sure your database is clean

python manage.py reset_db
python manage.py migrate
python manage.py load_fixtures
docker-compose restart lego_cypress_helper # Make sure the copy is of the clean database

Frontend

Start up the node server

$ yarn start

And start cypress in another terminal

$ yarn cypress open

Alternative: You can also run the node server with server side rendering enabled. This is how the tests are run on CI. To do this, you build and start the server

$ yarn build
$ yarn ssr

And you run cypress headlessly (no visible browser) in another terminal

yarn cypress run

STRIPE

In order to run the payment end-2-end tests, a few extra steps are required. First one has to install the stripe cli, log in and then run

$ stripe listen --forward-to localhost:8000/api/v1/webhooks-stripe/

In addition, the backend needs to run with two environment variables.

$  STRIPE_WEBHOOK_SECRET=<SECRET> STRIPE_TEST_KEY=<SECRET> python manage.py runserver

The webhook is obtained when running the stripe command above, while the test key can be obtained from the stripe dashboard.

Lastly, one has to run the frontend without captcha:

$ SKIP_CAPTCHA=TRUE yarn start
Debugging

Debugging

To debug chunk size (size of the javascript sent to the browser), run

$ BUNDLE_ANALYZER=true yarn build
CI/CD

CI/CD

We use drone as our CI/CD system. The server runs at https://ci.webkom.dev. This repo is public, so anyone can see the status at https://ci.webkom.dev/webkom/lego-webapp.

Since the repo is public and we use a lot of secrets in the pipeline, we require the pipeline to be verified with a signature from drone. To obtain this, use the cli:

drone sign webkom/lego-webapp

You need to login to retrieve the signature. Get the login data from your user settings.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].