Skip to content

Feature/backup dummy app #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"prettier.jsxSingleQuote": true,
"prettier.singleQuote": true
}
1 change: 1 addition & 0 deletions Dummy App/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Dummy openapi web search
25 changes: 25 additions & 0 deletions Dummy App/client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

.env
node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
118 changes: 118 additions & 0 deletions Dummy App/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@500;900&family=Manrope:wght@500;800&display=swap"
rel="stylesheet">
<script defer type="module" src="/main.js"></script>
<title>OpenAPI Web Search</title>
</head>

<body>
<div class="app_header">
<img class="app_header_logo" src="/logo.svg" alt="OpenAPI logo">
<h1 class="app_header_title">Dummy OpenAPI Web Search</h1>
</div>
<form class="search_form">
<input type="text" name="" id="search_field"
placeholder="eg. kontent.ai,NDC API,carbon API,Sharik API and etc.">
<button class="search_button">Search</button>
</form>
<ul class="results note_list">
<p class="loader">Loading...</p>
<p class="initial_msg">Search results will be displayed here...</p>
</ul>
<div class="note">
<h1 class="note_heading">Note - </h1>
<p class="note_message">These URLs are part of a set of test cases I've prepared for evaluating the search
functionality of our app, which allows users to search for documents based on keywords. Feel free to try out
these URLs content as keywords in the dummy app and see how the search algorithm performs.</p>
<ul class="note_list">
<li class="note_list_items">
https://api.sinao.app/v1/swagger.yaml
</li>
<li class="note_list_items">
http://47.92.32.107/mas/openapi/pages.do?method=exPlay&appKey=gov&id=102&autoPlay=false
</li>
<li class="note_list_items">
http://20.106.255.136:1020/swagger
</li>
<li class="note_list_items">
http://20.106.255.136:1020/swagger/index.html
</li>
<li class="note_list_items">
http://61.183.214.214:81/mas/openapi/pages.do?method=exPlay&appKey=gov&type=vod&id=174&docId=53825
</li>
<li class="note_list_items">
http://89.108.88.254:81/swagger/index.html
</li>
<li class="note_list_items">
https://apis.government.ae/swagger/ui/index
</li>
<li class="note_list_items">
https://mt-market-data-client-api-v1.vint-hill.agiliumtrade.ai/swagger/
</li>
<li class="note_list_items">
https://beta.aito.ai/docs/swagger/
</li>
<li class="note_list_items">
https://kontent.ai/learn/reference/openapi/delivery-api/
</li>
<li class="note_list_items">
https://kontent.ai/learn/reference/openapi/subscription-api/
</li>
<li class="note_list_items">
https://docs.moveworks.ai/openapi/reference/
</li>
<li class="note_list_items">
https://blog.noodle.ai/tag/swagger/
</li>
<li class="note_list_items">
https://rockstar.ai/tags/swagger
</li>
<li class="note_list_items">
https://www.teneo.ai/documentation/7.0.3/swagger/teneo-inquire/client/index.html
</li>
<li class="note_list_items">
https://www.teneo.ai/documentation/7.1.0/swagger/teneo-inquire/client/index.html
</li>
<li class="note_list_items">
https://www.teneo.ai/documentation/7.1.0/swagger/teneo-manager/client/index.html
</li>
<li class="note_list_items">
https://aakira.app/tags/openapi/
</li>
<li class="note_list_items">
https://aakira.app/tags/swagger/
</li>
<li class="note_list_items">
https://base.assembled.app/api/swagger
</li>
<li class="note_list_items">
https://ndcportal.app/swagger/
</li>
<li class="note_list_items">
https://carbon-api.red-river.app/swagger/index.html
</li>
<li class="note_list_items">
https://api.responsum.app/responsum/swagger/responsumPublicApi
</li>
<li class="note_list_items">
https://api.responsum.app/responsum/swagger/responsumPublicApi
</li>
<li class="note_list_items">
https://stirling-brandworks-website-32e7c7avs-stirling-brandworks.vercel.app/tags/insights/tag/swagger/
</li>
<li class="note_list_items">
https://stirling-brandworks-website-he9ev6t2e-stirling-brandworks.vercel.app/tags/insights/tag/swagger/
</li>
</ul>
</div>
</body>

</html>
1 change: 1 addition & 0 deletions Dummy App/client/javascript.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions Dummy App/client/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import './style.css'
import axios from "axios"
const input = document.getElementById("search_field");
const button = document.querySelector(".search_button")
const searchResults = document.querySelector(".results");
const loader = document.querySelector(".loader");
const initialMsg = document.querySelector(".initial_msg")
let query = ""
input.value = query;

loader.style.display = "none";



function renderResults(data) {
if(data.length === 0) {
searchResults.innerHTML = "NOT FOUND!"
return;
}
let output = ``;
data.forEach(d => {
output += d;
})
searchResults.innerHTML = output
searchResults.style.textAlign = "left";
}

function makeOutput(data) {
const results = data.map(d => `<li class="note_list_items"><a href="${d._source.body.url}" target="_blank">${d._source.body.url}</a></li>`);
renderResults(results)
}


async function makeSearch() {
try {
loader.style.display = "block";
initialMsg.style.display = "none";
const response = await axios.get(`${import.meta.env.VITE_SERVER_URL_CLOUD}/search`,{
params: {
q: query
}
})
makeOutput(response.data)
loader.style.display = "none";
initialMsg.style.display = "block";
input.value = ""
query = ""
}
catch(e) {
console.error("Something got wrong.",e)
}
}


input.addEventListener("input",(e) => {
query = e.target.value;
})

button.addEventListener("click",(e) => {
e.preventDefault()
if(query === "") {
alert("Input cannot be empty!")
return;
}
makeSearch();
})
17 changes: 17 additions & 0 deletions Dummy App/client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "client",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"vite": "^4.2.0"
},
"dependencies": {
"axios": "^1.3.4"
}
}
1 change: 1 addition & 0 deletions Dummy App/client/public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Dummy App/client/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 96 additions & 0 deletions Dummy App/client/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
body {
font-family: 'Inter', sans-serif;
font-weight: 500;
padding-bottom: 60px;
}

.app_header {
width: fit-content;
height: 300px;
margin: 100px auto 20px auto;
}

.app_header_logo {
width: 200px;
height: auto;
display: block;
margin: auto;
}

.app_header_title {
font-weight: 900;
font-size: 40px;
color: rgb(46, 46, 46);
}

.search_form {
margin: 10px auto 20px auto;
width: fit-content;
display: flex;
align-items: center;
justify-content: center;
}

.note {
padding: 30px;
border-radius: 30px;
background-color: rgb(254, 224, 224);
margin: 0 auto;
width: 800px;
border: 1px solid rgb(209, 49, 49);
}

.results {
margin: 40px auto;
width: 800px;
background-color: rgb(242, 242, 242);
border-radius: 30px;
padding: 30px 60px;
text-align: center;
}

.note_message {
font-size: 0.8rem;
color: rgb(255, 86, 86);
width: 80%;
margin: 20px 0;
}

.note_list_items {
margin-bottom: 6px;
}

#search_field {
font-size: 1.2rem;
border-radius: 30px;
border: 3px solid black;
display: inline-block;
width: 400px;
padding: 12px 30px;
margin-right: 10px;
}

#search_field::placeholder {
font-size: 0.8rem;
}

.search_button {
padding: 12px 20px;
font-size: 1rem;
border-radius: 10px;
border: none;
background-color: black;
color: white;
cursor: pointer;
box-shadow: 2px 3px 6px 0 rgba(0,0,0,0.3);
transition: all 0.3s ease;
}

.search_button:hover {
text-decoration: underline;
transform: translateY(-1px);
}

.search_button:active {
transform: scale(0.97);
}
Loading