Skip to content

Commit

Permalink
Added changes to readme files
Browse files Browse the repository at this point in the history
  • Loading branch information
Azzarox committed Apr 24, 2023
1 parent e3535cf commit 05a6711
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
7 changes: 4 additions & 3 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ Upon clicking the link to the server it should open documentation of the api don
| PUT | `/api/todos/:id` | { "isDone": "true"} | Authorization header in the format `Bearer <token>` and the **id** of the todo in the URL path | `200 OK`: Returns the todo object and and isDone value set as true <br> `400 Bad Request` <br> `401 Unauthorized` | Updates the todo and makes it completed by changing the isDone value to true |
| DELETE | `/api/todos/:id` | N/A | Authorization header in the format `Bearer <token>` and the **id** of the todo in the URL path | `200 OK`: Returns the deleted todo object <br> `400 Bad Request` <br> `401 Unauthorized` | Deletes the todo and returns the deleted todo object |

## Developing and extending the API

## General Information
All dependencies should be installed before doing anything, and after that there should be `.env` file with the required variables which can be found in [`.env.example`](.env.example).
### Developing and extending the API


There are two _main_ scripts which can be run.

Expand All @@ -30,7 +31,7 @@ The second one is `npm run start:prod`. This is the production script which star

There are two more script which are only for developing and are related to `eslint`. The one runes the linter to check for errors the other one automatically fixes the found errors if it is possible.

## Deploying changes
### Deploying changes

To deploy changes they should be committed and pushed to the repository. The service (Render) tracks only the /api folder.

Expand Down
30 changes: 25 additions & 5 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
# CLIENT
# Client

Deployed at: https://my-todo-mern-app.web.app/
The Client is deployed at: https://my-todo-mern-app.web.app/

`npm run build` - run after each change
## General Information

`firebase deploy `- to apply the changes from build to the deployed version
All dependencies should be installed before doing anything, and after that there should be **.env** file with the required variables which can be found in [.env.example.](.env.example)

## Developing and extending the application

[Go Back](../README.md)
If you want to use a local api (ex. localhost:3001) there are few steps that you need to take.

First you should have the environment variable for the dev server inside *.env*.

Second you need to change the ***process.env.REACT_APP_API_BASE_URL*** to ***process.env.REACT_APP_API_DEV_BASE_URL*** inside the files:
- [register and login handlers](./src/services/authServices.js)
- [requester function](./src/services/requester.js)


## Deploying changes

After there are some changes which you want to be reflected to the deployed version you need to run the production build which comes from the React CRA.
Run `npm run build` which will create the /dist folder and there is the compressed application and optimized for deploying.

After that is done you run `firebase deploy` to deploy the changes.

Disclaimer: If you have different firebase project it may not work since the app is bound to a project in Firebase which is different for each user of Firebase. You will need to redeploy it using your project.
Same goes for the api deployment on Render.

[Go Back](../README.md)

0 comments on commit 05a6711

Please sign in to comment.