Skip to content

bold-studio/sum-up

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SUM-UP

This is a simple application to provide an ability to use some psychological practice on a comfort way.

run

To run the application for local development you would need to run dev script in the root folder.

Or, if you like to run server and client separately:

  1. go to server folder and run dev script
  2. go to client folder and run start script

root scripts

  • start - starts a server
  • dev - runs client and server in a parallel to provide you a quick way to run the app
  • build - build an application for heroku hosting

technology stack

Junior React - test task

Your task is to develop a new Pleasures page.

To do so, add corresponding route to the project's routing system, and attach a new component to the route. Make sure your route is not accessible until user successfully logged in.

Each user in the app, should have ability to create and manage his own list of Pleasures. It means that Pleasures are editable. You should place creatte pleasure button and provide user the ability to edit any of his Pleasures.

Each Pleasure contains:

  • title - property which represents a display name of the Pleasure
  • desctiption - is optional and may contain additional info that explains whole point of particular pleasures

Once you completed the list of pleasures, page is ready to implement daily checklist feature in it.

The schema of the page is looks like that But you should use Material UI components only to implement it.

X axis on the top - represents dates of the last week from Monday to Sunday.

Y axis on the left - represents pleasures list. When user hover a particular Pleasure for 2-3 seconds - show a tooltip with Pleasure's description.

Edit Pleasure

By clicking on the name of the Pleasure user could see a modal window with 2 inputs filled with data about chosen pleasure - it's title and description, and Save button. Backdrop of the modal window should be semitransparent black.

To save new title and/or description user should click on the Save button. If user clicks outside of the modal window - close it without saving.

Entities

Each Day entity contains following properties:

  • date - date which it pepresents
  • pleasures - the Array of titles of Pleasures that was completed in following day. For example, if I have 2 pleasures pl1 and pl2 and both was completed, property value would be - ['pl1', 'pl2']

Each Pleasure entity contains following properties:

  • title - basically this is the short name of the Pleasure, and it's required
  • description -

To send requests to server, make sure you passed authorization header with the token as a value

Server URL - /api/:entityName

So if you want to send requests related to Days - use /api/days endpoint

All Pleasures related requests would be sent to /api/pleasures endpoint

GET

Returns an Array with entities from DB of user you mentioned in authorization token

Top make a GET request make sure you added authorization header with the token.

POST

Returns just created entity from DB

To make a POST request you would need to pass a request body with the object of new Day. It should contain all required properties to work correct.

Serer automatically gonna check whether DB contains an entity with the same required properties. In case if it's already exists, you'll receive an error.

PUT

Returns updated entity from DB

To make PUT request you would need to send request body with updated properties for your entity in order to change it.

DELETE

Returns deleted Day entity from DB

To make DELETE request you would need to pass an ID of the entity you want to delete.

It's easy, let's say I want to delete Pleasure with id ksoiwe53oo34o, so I would need to send DELETE request with URL /api/pleasures/ksoiwe53oo34o

OPTIONAL TASK

If you try to register a user you would face with the issue. If user succesfully registered - nothing changes on the page. No redirection, no form reset, but user creds are successfully saved in DB and server responded.

So the optional task is to fix this unexpected behaviour and make redirection to /login page after successful registration.

Test task submission

  1. Make a fork of out repo into your profile
  2. Make your changes to your
  3. Send us a link to your deployed application instance

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published