Skip to content

mjtabaya/fuel-tracker-app

Repository files navigation

Fuel Tracker App

A sample application to meet a technical task.

Technical TaskHow To UseScreenshotsDownloadCreditsDevelopment Logbook

Technical Task

To build a Rails App to meet the following user stories:

  • User Story - 1

    • As an Employee, I need to be able to enter information into an app when I refuel a vehicle so that my company can keep track of this information.
  • Acceptance Criteria:

    • I need to be able to go to the app (url) and enter in the following information about refuelling -- Date, Driver, Vehicle, Odometer Reading, Refuel location, litters of Fuel. I need to be able to enter and save this information.

  • User Story - 2

    • As a manager - with log in credentials, I need to be able to view refuelling information that other people have entered into the system so that I can view and keep track of that information.
  • Acceptance Criteria:

    • I need to be able to log in with credentials so that I can access the manager section of the system.
    • I need to be able to view refuelling information in the form of a table.
    • I need to be able to log out of the system.

How to Use

To clone and run this application, you'll need the following installed on your computer:

Setup

From your command line:

# Clone this repository
$ git clone https://github.com/mjtabaya/fuel-tracker-app

# Go into the repository, then react app's directory
$ cd fuel-tracker-app/FuelTrackerApp

# Install dependencies
$ npm install

# Migrate and seed the database
$ rails db:migrate db:seed

For Testing:

# Go into the root directory
$ cd fuel-tracker-app

# Migrate the database for the test environment
$ rails db:migrate RAILS_ENV=test

# Run the specs/tests
$ rspec

Running the App

From your command line:

# From inside the root directory (may also be ran from subfolders)
$ cd fuel-tracker-app

# Start the app (runs on ports 3000 and 3001, configured in Procfile.dev)
$ rake start

Open the app on your chosen browser with the following url: http://localhost:3000

(Alternative) Running the API and React in separate command lines

From the first command line:

# Go into the react app's directory
$ cd fuel-tracker-app/FuelTrackerApp

# Run the app (runs on port 3000 by default)
$ npm start

From a second command line:

# Go into the root directory
$ cd fuel-tracker-app

# Start Rails API from port 3001
$ rails s -p 3001

Screenshots

Initial Page - Login

Login page


Initial Page - Registration (modal)

Registration modal


Registration Message - on errors (logs in on success)

Registration error message


Employee View - on employee's login

Employee-only view


Employee View - on successful refuelling history submit

Refuelling History success


Employee View - on errors

Refuelling History fail


Manager View - on manager's login

Manager-only view

Note: If you're using Linux Bash for Windows, see this guide or use node from the command prompt.

Download

You can download the latest installable version of Fuel Tracker App for Windows, macOS and Linux.

Credits

This software uses the following open source packages:

Development Logbook

https://docs.google.com/spreadsheets/d/1hs8iJfz_pEagrzLUYfqFdCA7fLmpi7Kl0VBIq3hdaPE/edit?usp=drivesdk

To-do

  • Add specs/tests for react
  • Add search function for Manager View

GitHub @mjtabaya