- Docker and docker-compose installed
- Go to the root folder, example:
cd ~/code/city-wheather
- Execute the command docker-compose up -d and wait for the download/configuration
- Put your Api key in
ROOT_FOLDER/city-wheather/.env
file on WHEATHER_API_KEY
key
- Go to your browser and type: http://localhost:8000
- The main app (city-wheather folder) have some tests, if you want to run the these tests you have to execute on your machine:
docker exec -it web /var/www/html/vendor/bin/phpunit /var/www/html/tests
- We have six technologies around this project
- PHP with FPM
- Nginx
- Node
- Mongodb
- Redis
- Mysql
- Used to build de main api and the frontend
- Faster to render web pages
- Webserver with a reverse proxy for the PHP FPM and the Node api
- Here we have a issue that PHP does not act well - PARSE FILE. And we have a not so large, but big json file with the available cities that PHP could not handle very well (only if we increase the memory_limit, but this is not a good way pass thru this).
- Mongodb works very well with large documents and node works very well with Node
- We built an api only with to READ and filter data from mongodb. The main application consumes these api
- To keep the response from the openwheather api in cache and make our application faster.
- To save the cities that user want keep on a list.
- Mysql and PHP works very well. That's why a choose to save this list on mysql.
Comments
- I used javascript and bootstrap 4 to show the response from the api for the client