This Nest.js application is designed to read data from a list of files depending on the type and number Ex :"adults/series-2.xlsx", map it into a structured format, and expose it through user-friendly APIs. It simplifies the process of managing series-related data and provides a seamless experience for interacting with the information stored in the Excel file.
To run this project locally, follow these steps : ( the application will be accessible at http://localhost:3030 )
- Clone Repository:
git clone https://github.com/sayihhamza/j2hb-backend cd j2hb-backend npm install npm run start:dev
-
Get Available Series Types
- Endpoint:
http://localhost:3030/series/types
- Description: GET request to get the available types of series.
- Endpoint:
-
Get Number of Series for a Type
- Endpoint:
http://localhost:3030/series/:type/count
- Description: GET request to get the number of series for a specific type.
- Parameters:
type
(Path Parameter): The type of series.
- Endpoint:
-
Get Series by Type and Number
- Endpoint:
http://localhost:3030/series/:type/:number
- Description: GET request to get series quiz for a specific type and number of serie quiz.
- Parameters:
type
(Path Parameter): The type of series.number
(Path Parameter): The number of the quiz.
- Endpoint:
Input : - Represents the content of the "adults/series-2.xlsx" file.
Question 1 | Reponse 1 | Reponse 2 | Reponse 3 | Reponse 4 | Question 2 | Reponse 2.1 | Reponse 2.2 | Correction | Justification | Image | Audio |
---|---|---|---|---|---|---|---|---|---|---|---|
هَادْ الطَّرِيقْ يَمْكَنْ لِي الْقِيَّامْ بْالتَّجَاوُزْ: | نَعَمْ | لاَ | نَتْجَاوَزْ: | نَعَمْ | لاَ | 1,4 | [Justification for Question 1] | [ImageURL for Question 1] | [AudioURL for Question 1] | ||
الْمَخَالَفَاتْ مَنْ الدَّرَجَة الثَّانِيَة كَتْسْتَوْجَبْ أدَاءْ غَرَامَة مَالِيَة دْيَالْ: | 700 دَرْهَمْ | 500 دَرْهَمْ | 300 دَرْهَمْ | 2 | [Justification for Question 2] | [ImageURL for Question 2] | [AudioURL for Question 2] |
Output : - Illustrates the transformed JSON object returned by the API.
[
{
"questions": [
{
"question": "هَادْ الطَّرِيقْ يَمْكَنْ لِي الْقِيَّامْ بْالتَّجَاوُزْ:",
"responses": [
"نَعَمْ",
"لاَ"
],
"correction": [
0
]
},
{
"question": "نَتْجَاوَزْ:",
"responses": [
"نَعَمْ",
"لاَ"
],
"correction": [
1
]
}
],
"image": "[Image URL for Question 1]",
"audio": "[Audio URL for Question 1]",
"justification": "[Justification for Question 1]"
},
{
"questions": [
{
"question": "الْمَخَالَفَاتْ مَنْ الدَّرَجَة الثَّانِيَة كَتْسْتَوْجَبْ أدَاءْ غَرَامَة مَالِيَة دْيَالْ:",
"responses": [
"700 دَرْهَمْ",
"500 دَرْهَمْ",
"300 دَرْهَمْ"
],
"correction": [
1
]
}
],
"image": "[Image URL for Question 2]",
"audio": "[Audio URL for Question 2]",
"justification": "[Justification for Question 2]"
}
]