Skip to content

Instantly share code, notes, and snippets.

@Gideon877
Last active August 7, 2024 18:41
Show Gist options
  • Save Gideon877/32f8d7f110dccdf5c30587d44fb94c28 to your computer and use it in GitHub Desktop.
Save Gideon877/32f8d7f110dccdf5c30587d44fb94c28 to your computer and use it in GitHub Desktop.
Cars CRUD App using

Practical Test: Car CRUD API Application

Objective

Create a CRUD (Create, Read, Update and Delete) API application using Alpine.js, Axios, Node, and Express to perform various operations on car data. You will choose one function from the provided list and implement the functionality. The application should also demonstrate the use of HTTP methods.

Car Data Example

You can fetch the car data from the following API URL.

var car = {
  "color": "orange",
  "make": "Ford",
  "model": "Fiesta",
  "reg_number": "CL 77790"
}

Town Codes

  • Paarl ('CJ')
  • Bellville ('CY')
  • Stellenbosch ('CL')
  • Malmesbury ('CK')
  • Cape Town ('CA')
  • Kuilsriver ('CF')

Available Functions

  1. Most Popular Make (mostPopularCar)

    • Determine the most popular car make.
  2. Nissan Count from Malmesbury (nissansFromCK)

    • Count how many Nissans are from Malmesbury.
  3. Town with Most Blue Cars (mostBlueCars)

    • Identify the town with the most blue cars.
  4. Town with Fewest Orange Cars (fewestOrangeCars)

    • Determine the town with the fewest orange cars.
  5. Most Popular Car Model (mostPopularModel)

    • Find the most popular car model overall.
  6. Most Popular Car Model in Stellenbosch (mostPopularCL)

    • Identify the most popular car model in Stellenbosch.
  7. Least Popular Car Model in Kuilsriver (leastPopularCF)

    • Determine the least popular car model in Kuilsriver.
  8. Cars for a Given Town (carsForTown('townname'))

    • List all cars for a specified town.
  9. Cars for a Specific Color in a Town (numberOfCars('blue', 'townname'))

    • List all cars of a specific color in a specified town.
  10. Cars for a Specific Color & Model in a Town (numberOfCarsPerModel('blue', 'model', 'townname'))

    • List cars of a specific color and model in a specified town.
  11. Most Popular Color Car for a Town (mostPopularColor('townname'))

    • Determine the most popular color car in a given town.

Evaluation Criteria

  1. Functionality: Correct implementation of the chosen function.
  2. API Design: Proper use of HTTP methods and clear API endpoints.
  3. Frontend Integration: Effective use of Alpine.js and Axios to interact with the API.
  4. Code Quality: Clean, readable, and well-documented code.
  5. User Experience: Simple and intuitive user interface.

Submission Instructions

  • Kanban: Please add some basic planning on your Kanban board.
  • Code: Submit the complete codebase for the backend and frontend to GitHub.
  • Documentation: Include a README file with setup instructions, API endpoint documentation, and a brief explanation of the chosen function. Make sure that everything is deployed, and working correctly as expected.
  • Demo: Details regarding the demo will be communicated separately.

Testing Instructions

Please write Mocha tests for the function you implement. Ensure that your tests cover all possible scenarios and edge cases.

You can add a GitHub badge to display the build status of your tests. Here is an example of how to add a badge to your README:

[![Build Status](https://img.shields.io/github/workflow/status/your-username/your-repo/CI)](https://github.com/your-username/your-repo/actions)

Replace your-username and your-repo with your GitHub username and repository name respectively.

@Gideon877
Copy link
Author

It is a good recap exercise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment