The goal of this project is to make an app that display a list of messages and allow the user to add a message to the list that can be public or private.
This project is:
- Made using Next.js, Stylus and Mobx.
- Unitary tested using Jest.
- Functionally tested using Cypress.
- Fully documented using JSDoc.
- Formatted using Prettier.
- This project uses Next.js which means that react is rendered on the server-side and on the client-side.
- The board allow multiple users to join and add messages.
- The user can add private messages only visible to himself.
- The board is refreshed every second with a simple interval that could be improved using web socket or HTTP2 push API.
- A custom express server is used (see
server.js
at the root of the project) - 20 fake messages and authors are generated when the server is launched using Faker.
- There is 5 custom routes on
server.js
that could be documented and we could validate the payload of each request using Joi.
Clone this repository
git clone https://github.com/XavierLeTohic/message-board
Install dependencies via NPM
npm install
Install dependencies via Yarn
yarn
To run the app type
npm run dev
Or using Yarn
yarn dev
The following command will build the application for production use and run the tests to ensure it is deliverable.
npm run build-test
or using Yarn
yarn build-test
Run in production
npm run start
or using Yarn
yarn start
To run the functional tests you must first build and start the server first:
npm run build && npm run start
Then run cypress on another terminal:
npm run cypress:open
Click on Run all specs