This web version allow providers to register yourself, change or reset password, update name and email, update avatar and see your schedules. All the resources used by this application comes from its API
.
Easy peasy lemon squeezy:
$ yarn
Or:
$ npm install
Was installed and configured the
eslint
andprettier
to keep the code clean and patterned.
Configure your environment variables and remember to start the API before to start this app.
In this file you may configure the API's url. Rename the .env.example
in the root directory to .env
then just update with your settings.
key | description | default |
---|---|---|
REACT_APP_API_URL | API's url | http://localhost:3333 |
Start the API (see its README for more information). In case of any change in the API's port
or host
remember to update the .env
too.
To start the app run:
$ yarn start
Or:
npm run start
The project saves users's data and token into localStorage keys: @GoBarber:user
and @GoBarber:token
. Before use @GoBarber:user
data you need parse the data to a JavaScript object with JSON.parse function. Below you can see fictitious data:
@GoBarber:user
{
"id": "01931fee-32d4-4af7-b4e9-12159c5d703e",
"name": "John Doe",
"email": "johndoe@example.com",
"avatar": "52bde824dff12071c7df-20200219_214816.jpg",
"created_at": "2020-06-07T21:16:15.754Z",
"updated_at": "2020-11-20T04:06:15.975Z",
"avatar_url": "http://127.0.0.1:3333/uploads/52bde824dff12071c7df-20200219_214816.jpg"
}
@GoBarber:token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2MDU4MzQ4MDcsImV4cCI6MTYwNTkyMTIwNywic3ViIjoiMDE5MzFmZWUtMzJkNC00YWY3LWI0ZTktMTIxNTljNWQ3MDNlIn0.uzMK3TufipdyIrKxqakOhJtNF3VH7zkHPAfjTUae2q8
Jest was the choice to test the app, to run:
$ yarn test
Or:
$ npm run test
You can see the coverage report inside tests/coverage
. They are automatically created after the tests run.