This replinsher task list allows employees to keep track of diffrent tasks they have to complete. An employee can either assign themselves a task or assign another employee a task. The tasks have either 4 priority levels (low, medium, high, or critical) and can be set to repeat on certain intervals (hour, day, or week). Once a task has been assigned, the employee can move the task into different progress levels, starting from "Not Started" to "In Progress" and finally to "Completed".
These instructions will get you a copy of the project up and running on your local machine for development, testing purposes or actual use.
The following steps assume you have npm (node) and pip installed on your computer. If not please follow the links (pip, npm) to install them.
Make sure to clone this repository before following these steps.
Install all neccessary node dependecies:
npm install
Install all neccessary python dependencies:
pip install -r requirements.txt
This project uses the Firebase Realtime database to store data. Hooking up you own Firebase instance for this project is easy!
- Go to the Firebase website
- Create a new
Realtime Database
project - In your new project go to
project settings
->Add Firebase to your web app
Copy
the following items:apiKey
,authDomain
,databaseURL
,storageBucket
,messagingSenderId
- Go to
/walmart-labs/src/rebase.js
in your project andpaste
the items into the corresponding fields - Done!
To actually use the app, follow these steps:
Start flask server:
python flaskServer.py
Server is hosted on http://127.0.0.1:5000/
Start React app:
npm run
Open http://localhost:3000 to view app.
-
GET all tasks from all users
curl -i -H "Accept: application/json" -H "Content-Type: application/json" http://127.0.0.1:5000/get_all_tasks
{ User ID: { Tasks: { All: { Task ID: { summary:"Get Boxes", priority:"High", repeat:"Hour" }, ... }, Not Started: {}, In Progress: {}, Completed: {} } }, ... }
-
POST a new task to a user's
Not Started
task listcurl -H "Content-type: application/json" -X POST http://127.0.0.1:5000/add_task -d '{"uid":"w2XIBYxSNTdzFJlorOjBSXGO0X52", "task":{"summary":"Get Boxes", "priority":"High", "repeat":"hour"}}'
{"uid":"w2XIBYxSNTdzFJlorOjBSXGO0X52", "task": { "summary":"Get Boxes", "priority":"High", "repeat":"Hour" } }
To run the corresponding tests for the project (run in root directory of project):
npm test
The general structure of the unit tests follow the same setup for most cases:
- Since this is a single page app rendering the main
<App/>
component will suffice. - The rendering of most components in the app is dependent upon the content of the
state
so make sure to update the relevantstate
objects. - Once
state
contains the appropriate data and<App/>
is rendered, you can test and interact with the components in question.
describe('<App />', () => {
it('should render main', () => {
const main = mount(<App />);
expect(main.find('[id="main"]').length).toBe(1);
});
- React - The web framework used
- Flask - Backend server and cron jobs
- Jest, Enzyme- JS Testing Libraries
- Manan Bhalodia
This project is licensed under the MIT License.