Skip to content

adamcasey/rentredi-takehome

Repository files navigation

RentRedi Takehome

Instructions

Task name: User endpoints

Requirements

1.  We need to create CRUD endpoints
2.  The entries (users) can just be saved in a noSQL database (Bonus for using Firebase Realtime Database)
3.  Each user should have the following data entries:
    id, name, zip code, latitude, longitude, timezone
4.  When creating a user, allow input for name and zip code.
    (Fetch the latitude, longitude, and timezone - Documentation: https://openweathermap.org/current)
5.  When updating a user, Re-fetch the latitude, longitude, and timezone (if zip code changes)
6.  Connect to a ReactJS front-end

- feel free to add add something creative you'd like

API Key: 7afa46f2e91768e7eeeb9001ce40de19

How to Run This App

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • Firebase account and project
  • OpenWeather API key

Installation

  1. Clone the repository and install dependencies:
# install server dependencies
npm install

# install client dependencies
cd client
npm install
cd ..

Environment Setup

  1. Create a .env file in the root directory:
OPENWEATHER_API_KEY=your_openweather_api_key_here
  1. Set up Firebase configuration:

Running the Application

  1. From root directory:
npm run dev:all

The server will start on http://localhost:3000

Firebase setup

  • From the app root directory run:
# initiate app
firebase init

# when ready, deploy app
firebase deploy

Notes

Further improvements

  • UI needs some love
  • Client-side zip code validation, debounced submissions, loading skeletons
  • Automatic retries with exponential backoff, retry buttons, geocoding cache
  • Better error logging and monitoring
  • Input validation middleware?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors