This is a simple application to provide an ability to use some psychological practice on a comfort way.
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:
- go to
server
folder and rundev
script - go to
client
folder and runstart
script
start
- starts a serverdev
- runs client and server in a parallel to provide you a quick way to run the appbuild
- build an application for heroku hosting
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.
title
- property which represents a display name of the Pleasuredesctiption
- 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.
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.
Each Day entity contains following properties:
date
- date which it pepresentspleasures
- the Array of titles of Pleasures that was completed in following day. For example, if I have 2 pleasurespl1
andpl2
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 requireddescription
-
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
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.
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.
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.
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
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.
- Make a fork of out repo into your profile
- Make your changes to your
- Send us a link to your deployed application instance