|
| 1 | +# Functional Specifications |
| 2 | + |
| 3 | +|Author|Loïc NOGUES| |
| 4 | +|:-:|:-:| |
| 5 | +|**Helper**|**Léna DE GERMAIN**| |
| 6 | +|Created|01/06/2024| |
| 7 | +|Finished|01/16/2024| |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +<details> |
| 13 | +<summary>📖 Table of content</summary> |
| 14 | + |
| 15 | + |
| 16 | + - [I. Overview](#i-overview) |
| 17 | + - [A. Project summary](#a-project-summary) |
| 18 | + - [B. Out of Scope](#b-out-of-scope) |
| 19 | + - [C. Personas](#c-personas) |
| 20 | + - [D. Use case](#d-use-case) |
| 21 | + - [II. Functional requirements](#ii-functional-requirements) |
| 22 | + - [A. Node and Path Management](#a-node-and-path-management) |
| 23 | + - [B. Fastest Path Calculation](#b-fastest-path-calculation) |
| 24 | + - [C. REST API Specification](#c-rest-api-specification) |
| 25 | + - [III. Non-Functional Requirements](#iii-non-functional-requirements) |
| 26 | + - [A. Programming Language](#a-programming-language) |
| 27 | + - [B. Performance](#b-performance) |
| 28 | + - [C. Scalability](#c-scalability) |
| 29 | + - [D. API Accessibility](#d-api-accessibility) |
| 30 | + - [E. Data Format Compatibility](#e-data-format-compatibility) |
| 31 | + - [F. Reliability](#f-reliability) |
| 32 | + - [IV. Feature of the API](#iv-feature-of-the-api) |
| 33 | + - [V. Future improvement](#v-future-improvement) |
| 34 | + - [1. Advanced Pathfinding Features](#1-advanced-pathfinding-features) |
| 35 | + - [2. Scalability and Performance Enhancements](#2-scalability-and-performance-enhancements) |
| 36 | + - [VI. Glossary](#vi-glossary) |
| 37 | + |
| 38 | +</details> |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | +# I. Overview |
| 44 | + |
| 45 | +## A. Project summary |
| 46 | + |
| 47 | +SmashThePath aims to determine the time between two nodes and find the fastest way. Users can use it to save time and travel more effectively across the United States. This project is an opportunity to dive into the renowned C++ language[^cpp]. Our main goal is to create an easier way to determine the fastest time between two nodes. |
| 48 | + |
| 49 | +## B. Out of scope |
| 50 | + |
| 51 | +|Sellable API|Complex API| |
| 52 | +|-|-| |
| 53 | +|The project aims to teach us a simple and useful way to manage travel with our API[^restapi] . It is not intended to be very large or commercially viable by the final deadline. |To complete this project, we need to create an API that meets our requirements. An overly complicated interface could be difficult for new users to handle. |
| 54 | + |
| 55 | + |
| 56 | +## C. Personas |
| 57 | +This project will not include personas, for the simple reason that the people who will use it, must understand how it works and be able to code a software to use SmashThePath effectively. |
| 58 | + |
| 59 | +## D. Use case |
| 60 | + |
| 61 | +### 1st use case |
| 62 | + |
| 63 | + |
| 64 | +### 2nd use case |
| 65 | + |
| 66 | + |
| 67 | +### 3rd use case |
| 68 | + |
| 69 | + |
| 70 | +# II. Functional requirements |
| 71 | +## A. Node and Path Management |
| 72 | +The system shall allow defining nodes (landmarks) and their connections with specified travel times. |
| 73 | +It shall support reading node and connection data[^data] from a file (e.g., USA-roads.csv). |
| 74 | + |
| 75 | +## B. Fastest Path Calculation |
| 76 | +The system will calculate the fastest path and total travel time between two nodes based on the given data. |
| 77 | +It provide an ordered list of landmarks in the path. |
| 78 | + |
| 79 | +## C. REST API Specification |
| 80 | +Expose a GET[^get] endpoint that accepts: |
| 81 | +Input: Source and destination node IDs. |
| 82 | +Output: |
| 83 | +Travel time. |
| 84 | +Ordered list of landmarks in the path. |
| 85 | +Response formats: JSON and XML[^jsonxml] . |
| 86 | + |
| 87 | + |
| 88 | +# III. Non-Functional Requirements |
| 89 | + |
| 90 | +## A. Programming Language |
| 91 | +The software must be implemented in C++ to ensure optimal performance and efficient memory handling. |
| 92 | + |
| 93 | +## B. Performance |
| 94 | +To prioritize speed over precision, our solution can use heuristics, provided the returned path's duration does not exceed the shortest possible path by more than 10%. |
| 95 | + |
| 96 | +## C. Scalability |
| 97 | +The software must efficiently handle large datasets (e.g., 24 million nodes in USA-roads.csv). |
| 98 | + |
| 99 | +## D. REST API Accessibility |
| 100 | +The REST API must run on an HTTP server accessible via localhost or public network and support concurrent requests. |
| 101 | + |
| 102 | +## E. Data Format Compatibility |
| 103 | +The system shall ensure compatibility with CSV files and handle potential errors like missing or malformed data. |
| 104 | + |
| 105 | +## F. Reliability |
| 106 | +The system must ensure accurate results for pathfinding, even under high load or large datasets. |
| 107 | + |
| 108 | +# IV. Feature of the API |
| 109 | +The travel time between the node A and the node B. |
| 110 | + |
| 111 | +You can also use other coding language to use the SmashThePath (XML/JSON). |
| 112 | + |
| 113 | +You have the time to find the path. |
| 114 | + |
| 115 | +You have the number of node. |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | +# V. Future improvement |
| 120 | +## 1. Advanced Pathfinding Features |
| 121 | +### Dynamic Weights: |
| 122 | +Incorporate real-time data such as traffic conditions, weather, or road closures to dynamically adjust travel times. |
| 123 | +### Multi-Criteria Optimization: |
| 124 | +Allow users to optimize paths based on multiple criteria, such as shortest distance, fastest time, or cost. |
| 125 | + |
| 126 | +## 2. Scalability and Performance Enhancements |
| 127 | +### Distributed Computation: |
| 128 | +Implement distributed graph processing using frameworks like Apache Giraph or GraphX to handle extremely large datasets. |
| 129 | +### Pre-processing and Caching: |
| 130 | +Pre-process and cache the shortest paths for commonly requested queries to reduce response times. |
| 131 | + |
| 132 | +# VI. Glossary |
| 133 | + |
| 134 | +[^data]: Facts and statistics collected together for reference or analysis. [Source](https://dictionary.cambridge.org/dictionary/english/data) |
| 135 | + |
| 136 | +[^restapi]: An application programming interface (API) that follows the design principles of the REST architectural style. [Source](https://www.redhat.com/en/topics/api/what-is-a-rest-api) |
| 137 | + |
| 138 | +[^cpp]: An object-oriented programming (OOP) language that is viewed by many as the best language for creating large-scale applications. [Source](https://en.wikipedia.org/wiki/C%2B%2B) |
| 139 | + |
| 140 | +[^jsonxml]: JSON is an open data interchange format that is readable by both people and machines. JSON is independent of any programming language and is a common API output in a wide variety of applications. XML is a markup language that provides rules to define any data. [Source](https://en.wikipedia.org/wiki/JSON) |
| 141 | + |
| 142 | +[^get]: Is one of the standard HTTP request methods used in web communication. It is typically used to retrieve data from a server without modifying its state. GET requests are widely employed in RESTful APIs, websites, and web applications for fetching resources or information. [Source](https://en.wikipedia.org/wiki/HTTP) |
0 commit comments