- node v10.2.0
- npm 4.6.1
Please be patient... since Heroku Applications go to sleep after about an hour of inactivity, it will take around 30 seconds or so to wake the app back up. Both the React Application and the Rails API need to be woken up, so please be sure to to refresh the page until there is data. I have left some applications preloaded, so if there are none -- be patient, they will appear (unless they have all been deleted by a third party visiting the site).
To copy the application to your local machine, please run the following command:
git clone https://github.com/jgrubard/landlord-app-react
Then once you have navigated into the directory via command line, to grab the necessary dependencies, please run:
npm install
To run the application in your browser, type the following command.
npm start
The browser should automatically open, but in case it doesn't, once it is running, you can visit http://localhost:3000/. If you are running the Ruby on Rails API on this port, you will be prompted to run this app on another port.
The main page is meant for our main User, the Landlord.
Here, the landlord can create a new application after selecting whether they would like a basic or full application. A basic application asks for some info about the applicant and their previous landlord. A full application adds mother’s maiden name and social security number to the form. A token is autogenerated and saved on the application model.
The landlord can also view and delete all created applications.
If an application is new, a link with the token will be generated for the landlord to send to the applicant. Once received, the applicant will correctly fill out the form, and submit to the landlord. Once completed, the token is destroyed and the applicant can no longer submit the form. The applicant will be redirected to a thank you page, and will wait to hear back from the landlord.
If the application has already been submitted, the link is gone, since there is no longer an application token. There is now the option to see the application data. This brings us to a page with all of the data from this application.
We can then navigate back to the main page.
Once the Landlord has more than 5 applications in the database, the applications will spill over onto other pages, so that a single page is not inundated with applications. There are no more than 5 applications per page, with the newest on top. If an applicant submits their application, this will also be moved to the top.