This is a project integrating with DVLA API to show information about stored cars. The link is https://tabletop-task.vercel.app/. Some VRNS you can test it with:
- AA19DSL
- AA19MOT
- AA19AMP
- AA19 (Not in mock data)
- WN67DSO (Not in mock data)
- Clone the repository:
git clone <repository-url>- Install dependencies:
npm install- Configure your env file:
API_URL=
API_KEY=- Run the development server:
npm run devthen in another terminal instance:
npm run start- I spun up a proxy server using Express. I didn't want to call a protected endpoint from the front end.
- Also to avoid CORS errors.
- I realised a bunch of VRN codes in the API example weren't working 🫤
- I made a mock data file by copying the VRN data from here.
- It first checks the original API, then if it fails, falls back on the mock one.
- I then modified the index.html & style.css a bit for styling.
- The input bar is accessible 😌
- Fixed the bugs in Garage.js. Added two helpful functions.
- I decided to host on Vercel. Had issues uploading the express server so I just made a vertical function 'vehicles' that does the same thing.
- I updated the src on which endpoint to point to during prod vs dev mode.
- 👍🏾 Pretty interesting project using vanilla JS. It made me appreciate the easy-to-use abstractions provided by frameworks like React & Nextjs.
