About the Project | How to Use | License
This project was created to demonstrate all my knowledge with the Angular platform and its ecosystem such as state manipulation with the NGRX library and event-based development with the RXJS library for the company Zoox.
The Json-Server was also used to create a "mock", where I simulate the backend, Prettier and Husky to control style-guide, code standardization and versioning.
If it is necessary to generate a key to be able to use the API, then to do this, do the following:
-
Access the website and generate your key from this api.
-
Go to the
environment
files and replace the words"INSERT THE KEY"
with yours.
Remember, the free mode will be used, with this the system can generate an "error" toast, but in fact this means that the API is giving http 429 status
.
There are two items in the store, which are:
Authentication
Weather
World
Authentication
: refers to user authentication, where the token and the fake user are generated.
Weather
: refers to the use of the mentioned API.
World
: refers to the use of some data from countries and cities of the same "moved" in the "backend" which is the json-server..
As I said before, the backend was created with Json-Server
, don't worry that the whole procedure is described in the next section. However, for a brief understanding, when starting the server, we can access the two existing routes, which are:
So when this project is cloned on your machine, it is necessary to install its modules using the package manager YARN
...
If you do not have YARN
properly installed on your machine, access this link to download and install...
If you already have YARN
installed, open terminal
(linux) or cmd
(windows) at the root of the project where the package.json
file is located and run the following command:
yarn
After that, YARN
will install all the project dependencies for you...
The second step is to start the "backend" (Json-Server) of the project, for this I have already prepared a command in the script of the file package.json
, just just run the following command:
yarn start_backend
Finally, we can start the project with the following command:
ng serve
Note: The control of the requests are made by the switchMap
of the RXJS library
and which is inside the SideEffects
of the determined item in the Store
, however as the backend was "moved" with the Json-Server
keep in mind that sometimes it may not be able to handle the requests and fall, so stay tuned at the command prompt! Also remember, if this happens, roll back the server, returning the database.json
file to the original.
This project is under the MIT License. See the LICENSE for more details..
Made with β₯ and with the intention of learning and passing on knowledge. π