Giter Club home page Giter Club logo

react-cash-machine's Introduction

React Cash Machine

Example project using React hooks and TypeScript for UI. Server using: NodeJs, Express & TypeScript.

Project structure

Project consists of server side api - in api folder and client ui part in cash-machine-ui folder.

API

Api project is using:

  • Node JS
  • TypeScript
  • Express
  • Jest & Supertest - for unit testing
  • Webpack - for project build
  • Prettier - for auto-formating

Api project structure:

  • api

    • src - contains main files
    • tests - contains tests
    • build - output files built by webpack
    • node_modules - dependecies

    Spliting requested cash amount into bank notes is done in: api/src/cashService.ts

To build & run use:

cd ./api/

npm run start:dev

This will start the project in development mode. CrossEnv library is used to handle both Windows & Linux OS.

Server will start at http://localhost:3001

Running API unit tests

Inside api run following command: npm run test

Some error logs will be displayed in console, this is expected as throwing exceptions is done in one of tests.

UI

Cash-Machine-UI project is using:

  • React with Hooks
  • TypeScript
  • React-scripts for building
  • Jest, Enzyme for unit testing
  • Prettier - for formatting

Project structure:

  • cash-machine-ui
    • src - main directory of the app
      • components - React components
      • services - access to API
    • public - static resources for the web page
    • build - contains output files
    • tests

Running

Before running UI please start-up the api server on localhost port 3001 (default).

To build and run in development mode use:

cd cash-machine-ui

npm run start

To build in production mode run:

cd cash-machine-ui

npm run build

Serve build folder with some static web-server, i.e.: serve -s build

Testing

The plan was to use Jest & Enzyme to test the UI project. Unfortunately I've run out of time to implement those. This will be done in version 2.0.

React Cash Machine UI Screenshot

react-cash-machine's People

Contributors

aciura avatar dependabot[bot] 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.