Giter Site home page Giter Site logo

circuit-app's Introduction

circuit-app

The webapp that is part of an exemplar circuit for developers who are new to NodeJS and JavaScript development.

The app itself is a simple NodeJS application built upon Restify and a few other items in a webstack for server-side website development.

Notably:

  • Restify - The central webserver framework
  • TypeScript - Any higher logic operations are developed in TypeScript
  • Nunjucks - HTML templating engine
  • SASS/SCSS - HTML CSS engine

Installation

To install and this service, please run the following commands:

npm i && npm run build

These will install all the required packages for this project and create all the build assets that this project uses to run effectively as a UI application.

Run the service

To start the service, follow the steps for installation, then run the following command:

npm run start

This will start the service using http on port 8000 by default. These values can be overridden by providing your own configuration file inside the config/ folder. Copying the config/default.js to config/local.js would allow you to make changes to your local environment without impacting the global repository settings.

Once the server is running, you should be able to log in with the default username and password of administrator/administrator.

Testing

This project contains several dimensions of testing for the application.

  • Plain JS tests can be found under test/spec/app
  • Typescript tests can be found under test/spec/ts
  • Browser tests can be found under test/spec/browser

All of these tests can be run (after following the installation instructions), by running the following instruction:

npm t

The individual test suites can be run with npm run [test:js|test:ts|test:browser], but the prior command will run all three in sequence.

There is also a companion project to this which can be found here. Said project hosts a Selenium suite for more in-depth UI testing and experimentation.

Whenever this project gets built on develop, the acceptance test project will be started and will run against whichever image has just been built.

circuit-app's People

Contributors

j4numbers avatar

Watchers

 avatar

circuit-app's Issues

Allow users to download and upload their calendars

Background

At the moment, the application does allow users to fill in all the holidays they will take within a given year, but it does not allow them to export any of those holidays to other applications. In tandem, it does not allow users to upload an existing holiday calendar that they may have already created.

The Ask

Create two new buttons on the day manager page to 'Import calendar file' and to 'Export calendar file'.

The import calendar file button should take the user to a new page where they can upload a JSON file containing their calendar, then confirm that they are overwriting their calendar with the uploaded file.

The export calendar file button should export the user's calendar and download it to the user's hard drive in a JSON format following the attached schema.

The downloaded and uploaded calendar files should follow the attached schema file's directions for describing holidays.

These pages should require that the user has the new permissions IMPORT_CALENDAR and EXPORT_CALENDAR respectively, and that only logged in users have those permissions.

JSON schema

{
  "$schema": "https://json-schema.org/draft-07/schema",
  "$id": "circuit-app-calendar",
  "title": "Circuit App calendar",
  "type": "array",
  "items": {
    "$id": "individual-holiday-day",
    "title": "Individual holiday day",
    "type": "object",
    "required": [
      "title",
      "date",
      "notes",
      "bunting"
    ],
    "properties": {
      "title": {
        "$id": "holiday-title",
        "title": "Holiday title",
        "type": "string",
        "examples": ["Christmas day"]
      },
      "date": {
        "$id": "holiday-date",
        "title": "Holiday date",
        "type": "string",
        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
        "examples": ["2022-12-25"]
      },
      "notes": {
        "$id": "holiday-notes",
        "title": "Holiday notes",
        "type": "string",
        "examples": [""]
      },
      "bunting": {
        "$id": "holiday-bunting",
        "title": "Holiday bunting",
        "type": "boolean",
        "default": false,
        "examples": [true]
      }
    }
  }
}

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.