Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
689626f
installing package and find data
fadhildaffa Nov 13, 2023
ad56392
adding data
fadhildaffa Nov 13, 2023
a3d7891
adding data
fadhildaffa Nov 13, 2023
6f9710b
adding data
fadhildaffa Nov 13, 2023
3e29c4a
Merge pull request #1 from fadhildaffa/getData
fadhildaffa Nov 13, 2023
2e215ad
preparing data seed
fadhildaffa Nov 14, 2023
d36c926
Done seeding data
fadhildaffa Nov 14, 2023
11d6432
Merge pull request #2 from fadhildaffa/seedData
fadhildaffa Nov 14, 2023
8f7fd0d
preparing REST API
fadhildaffa Nov 14, 2023
2973640
adding route authentication
fadhildaffa Nov 14, 2023
0ec8620
change data
fadhildaffa Nov 14, 2023
21d61cc
adding route add team
fadhildaffa Nov 14, 2023
c6268f0
adding route delete and edit
fadhildaffa Nov 14, 2023
6a464ce
patch route
fadhildaffa Nov 14, 2023
0f99d82
authorization
fadhildaffa Nov 14, 2023
7dfb061
rest Api done
fadhildaffa Nov 14, 2023
5d6292c
Merge pull request #3 from fadhildaffa/restAPI
fadhildaffa Nov 14, 2023
0e4c78a
done adding documentation
fadhildaffa Nov 14, 2023
34a51a6
Merge pull request #4 from fadhildaffa/documentation
fadhildaffa Nov 14, 2023
c3f179c
login testing
fadhildaffa Nov 14, 2023
647b418
read teams, create team, read detail team testing
fadhildaffa Nov 14, 2023
16953bc
done testing
fadhildaffa Nov 15, 2023
b0324bf
Merge pull request #5 from fadhildaffa/testing
fadhildaffa Nov 15, 2023
838c02b
take another testing for make sure
fadhildaffa Nov 15, 2023
344b63e
Merge pull request #6 from fadhildaffa/testing
fadhildaffa Nov 15, 2023
4d222ad
done seeding with axios
fadhildaffa Nov 15, 2023
0d9e3ec
Merge pull request #7 from fadhildaffa/testing
fadhildaffa Nov 15, 2023
bc71c44
done
fadhildaffa Nov 15, 2023
73d531b
Merge pull request #8 from fadhildaffa/testing
fadhildaffa Nov 15, 2023
1e8607d
installing package and starting make layout
fadhildaffa Nov 15, 2023
58a636f
register page
fadhildaffa Nov 15, 2023
3db091f
making page detail home navbar etc
fadhildaffa Nov 16, 2023
2e342e6
Merge pull request #9 from fadhildaffa/layouting
fadhildaffa Nov 16, 2023
5849306
adding google sign in
fadhildaffa Nov 16, 2023
cb8ef20
add modal create team
fadhildaffa Nov 16, 2023
22eb349
success delete main table
fadhildaffa Nov 16, 2023
f78b70b
done subscription
fadhildaffa Nov 16, 2023
ccbcbf4
already clear crud
fadhildaffa Nov 16, 2023
9bb59dd
Merge pull request #10 from fadhildaffa/CRUD
fadhildaffa Nov 16, 2023
3e9c7c1
done exploring
fadhildaffa Nov 16, 2023
dcd2bc5
Merge pull request #11 from fadhildaffa/openai
fadhildaffa Nov 16, 2023
98ed3ae
change server deploy
fadhildaffa Nov 16, 2023
98adfb1
Merge pull request #12 from fadhildaffa/openai
fadhildaffa Nov 16, 2023
396c252
changing file
fadhildaffa Nov 16, 2023
3443f25
done already
fadhildaffa Nov 16, 2023
99ad5e2
Merge pull request #14 from fadhildaffa/openai
fadhildaffa Nov 16, 2023
1ca3f5b
done
fadhildaffa Nov 24, 2023
34a1778
goal
fadhildaffa Nov 24, 2023
3d17342
push
fadhildaffa Nov 24, 2023
ce46bbc
Merge pull request #16 from fadhildaffa/openai
fadhildaffa Nov 24, 2023
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
513 changes: 512 additions & 1 deletion README.md

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions client/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
4 changes: 4 additions & 0 deletions client/.firebase/hosting.ZGlzdA.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
index.html,1700176544492,882bffdc4f28806775fb744cd846f770dc528e67418c2c3299c1e40df427137c
vite.svg,1699363452801,59ec4b6085a0cb1bf712a5e48dd5f35b08e34830d49c2026c18241be04e05d5a
assets/index-e406f2b7.css,1700176544492,8fd3aec9a213f38a4bcf5e3eeadc7fc9fd39aca602da70fef14d42acbaf91670
assets/index-993211cd.js,1700176544495,ac652bfd75579fb9bda65d38f9f6d560c24b84b981e0a59572201241cc86d31f
5 changes: 5 additions & 0 deletions client/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "ip-daffa-p2"
}
}
24 changes: 24 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
8 changes: 8 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
78 changes: 78 additions & 0 deletions client/component/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import axios from "axios"
import { Link, useNavigate } from "react-router-dom"
import Swal from "sweetalert2"
const baseUrl = "https://server-p2_ip_fadhild.yoiego.my.id"
// const baseUrl = "http://localhost:3000"
export const Navbar = () => {
const navigate = useNavigate()
const handleLogout = () => {
localStorage.removeItem("token")
navigate('/login')
}
const handleSubscribe = async () => {
try {
const { data } = await axios.get(baseUrl + "/payment/midtrans", {
headers: {
Authorization: `Bearer ${localStorage.getItem('token')}`
}
})
window.snap.pay(data.transaction_token, {
onSuccess: async function (result) {
/* You may add your own implementation here */
// console.log(result.order_id)
localStorage.setItem("success", result.order_id)

if (localStorage.getItem("success")) {
await axios.patch(baseUrl + '/users/role', null, {
headers: {
Authorization: `Bearer ${localStorage.getItem("token")}`
}
})
}

localStorage.removeItem("success")
navigate('/home')
},
onPending: function (result) {
/* You may add your own implementation here */
alert("wating your payment!"); console.log(result);
},
onError: function (result) {
/* You may add your own implementation here */
alert("payment failed!"); console.log(result);
},
onClose: function () {
/* You may add your own implementation here */
Swal.fire({
title: 'Your payment didnt succesfully',
text: 'you closed the popup without finishing the payment',
icon: 'info',
confirmButtonText: "OK"
});
}
})
console.log(data)
} catch (error) {

}


}
return (
<nav className="px-1.5 py-1.5 flex bg-cyan-500 p-0">
<Link to="/home"><img className="rounded-3xl w-28 mx-3 h-full" src="https://d3nfwcxd527z59.cloudfront.net/content/uploads/2021/10/11091243/Lionel-Messi-Argentina-Uruguay-Dribble.jpg" alt="God Dribble level" /></Link>
<div className="flex justify-center w-full text-teal-50 flex-col p-0">
<div className="flex justify-center">
<h1> Welcome to Club [yourname]</h1>
</div>
<div className="flex justify-center">
<p>Just see the magic what is the best team in the world</p>
</div>
<div className="flex justify-center">
<button className="btn btn-primary w-28" onClick={handleSubscribe}>Subscribe</button>
</div>
</div>
<button className="btn btn-danger mx-1.5" onClick={handleLogout}>Log Out</button>
</nav>
)
}
16 changes: 16 additions & 0 deletions client/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
24 changes: 24 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Prediction Get Best Performance Team</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<script src="https://cdn.tailwindcss.com"></script>
<script type="text/javascript" src="https://app.sandbox.midtrans.com/snap/snap.js"
data-client-key="SB-Mid-client-R-YbpLUj0-L5c4gb"></script>
</head>

<body>
<div id="root"></div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"></script>
<script type="module" src="/src/main.jsx"></script>
</body>

</html>
Loading