Coder Social home page Coder Social logo

event-signup's Introduction

Event Sign Up

Description

This application is an example of a fullstack web-form, that includes validation and testing. It was made using the MERN stack and Redux. Here is the stack:

MongoDB, ExpressJS, React, NodeJS

All persistent state is saved on MongoDB Atlas and managed using Redux in the application. This app is hosted on Heroku at this link.

Quick Start

Docker App Image

This application can be pulled from docter hub using the following command:

docker pull haskin/event-signup:app

When using docker run, you most publish a host port to the container port 3030.

docker run -p [host_port]:3030 ...

Normal Setup (Non-Docker)

In order to run the application you need to have a .env file with the properties:

MONGO_URI, DB_NAME

MONGO_URI should be set to the URI of the mongo database and DB_NAME set to the name of that database. Once that is done follow these steps:

# Install dependencies
npm install

# Run the server
npm run server

# Run the client
npm run client

# Server runs on http://localhost:3030 and client run on http://localhost:3000

Testing

There are 30 tests included, which were made using Jest, react-testing-library, and cypress.

Docker Test Images

Docker tests for the server and client can be pulled with the following commands:

docker pull haskin/event-signup:server-test
docker pull haskin/event-signup:client-test

Testing commands

# Run Server Tests
npm run server-test

# Run Client Tests
npm run client-test

# Run End-to-End Test 
#### Requirements: NODE_ENV ="test", Server & Client must be running
npm run cypress

Testing Directories

Client Tests

./client/src/components/_tests

Server Tests

./tests

End-To-End Tests

./cypress/integration/e2e.spec.js

Validation

Validataion is done three times. Once using HTML5 form validation, before sending the data using a fetch in the client, and before saving to the database. Here is where you can find validation files:

/client/src/utils/validated.js

/models/Registree.js _

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.