Code Monkey home page Code Monkey logo

nxm201-c4-eval's Introduction

BACKEND - WEATHER APP

Weather Application

Make an weather application using Nodejs, Express, MongoDB, Redis etc.

Use MongoDB Atlas to store the user's preferred city, and their previous searchers in the DB.

Use Redis to cache the weather data. This way your application can quickly retrieve the weather data for a particular city without having to make a new API request, irrespective of the user, for a particular city.

Since weather is something that keeps changing, the weather data stored in Redis for a particular city should expire in 30 minutes.

Implement a mechanism to check if the data is already present in Redis before making an API call to weather API.

Use Winston for logging - log any errors in application to a collection in the DB.

Have a validation middleware which checks that the city passed by the user to get weather info is only a string and doesn't contain any numbers, special characters etc in it, so that you don't waste an API request to weather API with invalid city.

Since you are making your weather application free, implement a rate limiter which limits each user's IP to make only 1 request for weather per 3 minutes. (Explore any rate-limiter package)

Follow all the best practices, such as following the MVC structure, storing all secret things in .env, committing regularly with proper git messages, clean code, etc.

Deploy Backend

nxm201-c4-eval's People

Contributors

rbhomale17 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.