/nodereact-test

Tech test

Primary LanguageTypeScript

!In Development!

Back-End

We use node version 10.15.0

nvm install 10.15.0
nvm use 10.15.0

The first time, you will need to run

npm install

Then just start the server with

npm run start

It uses nodemon for livereloading :peace-fingers:

Docker Server

You can run the server using docker. Just go to mcfadyen/server and run

docker-compose up

API Validation

By using celebrate the req.body schema becomes clary defined at route level, so even frontend devs can read what an API endpoint expects without need to writting a documentation that can get outdated quickly.

route.post('/signup', 
 celebrate({
   body: Joi.object({
     name: Joi.string().required(),
     email: Joi.string().required(),
     password: Joi.string().required(),
   }),
 }),
 controller.signup)

Example error

{
 "errors": {
   "message": "child \"email\" fails because [\"email\" is required]"
 }
} 

Front-End

still in development, won't run perfectly and has mockups and bugs

To run the front-end, go to the client folder and run

yarn or npm install

When packages are all installed, run

yarn start or npm start