

This is a minimalist weather app
Taking into account the proposed development time (less than 48 hours), the application is simple. The best principle of software engineering used here was “simplicity”, if I don’t need to use, I don’t need to implement or import unnecessary libs
- The client side was implemented without libs or frameworks, pure javascript
- For the server side I used Express to speed up the development of translation routes
- There is a memory cache that checks if a request has already been made in less than two hours with the same coordinate
- If it was done in less than two hours, the system does not make the request and returns the cached response. Otherwise, a new request is made to the external APIs
Make sure you have these requirements installed on your machine
- Node^8
- npm / yarn / docker
Run:
$ npm i // install all dependencies
$ npm start // starts your express server using process.env.PORT or 8080
$ npm start:open // starts the aplication and open the browser
$ npm run compile:sass // compile your .sass files to .css into public folder with a watcher
$ npm run transpile // transpiles src/index.js into public folder to be used on the client
$ npm run transpile:watch // watch each change on file
$ npm run build // build your application to public folder
Run:
$ yarn
$ yarn start
$ docker build -t <app name>/weather-app .
$ docker run -p 8080:8080 weather-app
public/ ___________________________________ # Application to serve
|- assets/
| |- weather-icons/ ______________________ # Weather icons
|- css/ ___________________________________ # Compiled css from scss
|- js/ ____________________________________ # Transpiled javascript
src/
| |- routes/ _____________________________ # Express routes
| |- sass/ _______________________________ # Sass files
| |- views/ ______________________________ # Template files
|- index.js _______________________________ # Client application entry
- Babel 7 [ transforming JSX and ES6,ES7,ES8 ]
- Express [ Fast, unopinionated, minimalist web framework for Node.js ]
- Mustache Express
- Node-sass [ Binding for Node.js to LibSass ]

Leave a Reply