This project uses json-server
to create an API from the JSON file that holds the customer transaction data. It also uses the template repository kitloong/json-server-vercel
that deploys the API to Vercel.
Tip
To show the graph of a user just click on the user row on the table
- For Customers: https://jobfair-task-w6uv.vercel.app/customers
- For Transactions: https://jobfair-task-w6uv.vercel.app/transactions
The project also uses chart.js library to plot and visaulize the data.
To run the project locally:
-
Prerequisites: Ensure that Node.js and Git are installed on your machine.
-
Clone the Repository: Open your terminal or command prompt and run the following command:
git clone https://github.com/MohamedEmary/jobfair-task.git
- Install Dependencies: Change to the project directory and install the dependencies:
cd jobfair-task
npm install
- Run the JSON Server:
json-server --port 3000 db.json
- Update API Endpoints: In the
public/app.js
file, update the API endpoints as follows:
fetch("http://localhost:3000/customers")
fetch("http://localhost:3000/transactions")
- Open the Application: Finally, open the
public/index.html
file in your browser.