Skip to content

Commit

Permalink
add layout
Browse files Browse the repository at this point in the history
  • Loading branch information
ismail-kharrobi committed Aug 22, 2023
1 parent 4d384fa commit e70ae57
Show file tree
Hide file tree
Showing 17 changed files with 140 additions and 42 deletions.
25 changes: 25 additions & 0 deletions backend/code/prisma/migrations/20230822133234_init/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- CreateTable
CREATE TABLE "User" (
"id" SERIAL NOT NULL,
"email" TEXT NOT NULL,
"name" TEXT,

CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "Post" (
"id" SERIAL NOT NULL,
"title" TEXT NOT NULL,
"content" TEXT,
"published" BOOLEAN NOT NULL DEFAULT false,
"authorId" INTEGER NOT NULL,

CONSTRAINT "Post_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");

-- AddForeignKey
ALTER TABLE "Post" ADD CONSTRAINT "Post_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
3 changes: 3 additions & 0 deletions backend/code/prisma/migrations/migration_lock.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "postgresql"
20 changes: 20 additions & 0 deletions frontend/code/src/Auth/Assets/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export const Button = () =>{
return (
<svg className="w-80 hover:fill-slate-500 transition duration-500 hover:-translate-y-1 hover:scale-110 ease-in-out" width="330" height="81" viewBox="0 0 330 81" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect className="" width="330" height="81" rx="13" fill="#8C67F6"/>
<g clipPath="url(#clip0_1_36)">
<path d="M63 51.9565H85.1076V63H96.1395V43.0435H74.0756L96.1395 21H85.1076L63 43.0435V51.9565Z" fill="white"/>
<path d="M100.892 32.0435L111.924 21H100.892V32.0435Z" fill="white"/>
<path d="M111.924 32.0435L100.892 43.0435V54.0435H111.924V43.0435L123 32.0435V21H111.924V32.0435Z" fill="white"/>
<path d="M123 43.0435L111.924 54.0435H123V43.0435Z" fill="white"/>
</g>
<path d="M153.828 48.15H162.369V54H146.184V26.505H153.828V48.15ZM178.523 54.273C175.949 54.273 173.583 53.675 171.425 52.479C169.267 51.257 167.551 49.58 166.277 47.448C165.029 45.29 164.405 42.859 164.405 40.155C164.405 37.451 165.029 35.033 166.277 32.901C167.551 30.743 169.267 29.066 171.425 27.87C173.583 26.674 175.949 26.076 178.523 26.076C181.123 26.076 183.489 26.674 185.621 27.87C187.779 29.066 189.482 30.743 190.73 32.901C191.978 35.033 192.602 37.451 192.602 40.155C192.602 42.859 191.978 45.29 190.73 47.448C189.482 49.58 187.779 51.257 185.621 52.479C183.463 53.675 181.097 54.273 178.523 54.273ZM178.523 47.175C180.473 47.175 182.007 46.538 183.125 45.264C184.269 43.99 184.841 42.287 184.841 40.155C184.841 37.971 184.269 36.255 183.125 35.007C182.007 33.733 180.473 33.096 178.523 33.096C176.547 33.096 175 33.733 173.882 35.007C172.764 36.255 172.205 37.971 172.205 40.155C172.205 42.313 172.764 44.029 173.882 45.303C175 46.551 176.547 47.175 178.523 47.175ZM213.588 35.553C213.146 34.825 212.535 34.266 211.755 33.876C211.001 33.486 210.104 33.291 209.064 33.291C207.14 33.291 205.619 33.915 204.501 35.163C203.409 36.411 202.863 38.088 202.863 40.194C202.863 42.56 203.448 44.367 204.618 45.615C205.814 46.837 207.543 47.448 209.805 47.448C212.483 47.448 214.394 46.239 215.538 43.821H207.855V38.322H222.129V45.732C221.531 47.188 220.647 48.553 219.477 49.827C218.333 51.101 216.877 52.154 215.109 52.986C213.341 53.792 211.326 54.195 209.064 54.195C206.308 54.195 203.864 53.61 201.732 52.44C199.626 51.244 197.988 49.593 196.818 47.487C195.674 45.355 195.102 42.924 195.102 40.194C195.102 37.49 195.674 35.085 196.818 32.979C197.988 30.847 199.626 29.196 201.732 28.026C203.838 26.83 206.269 26.232 209.025 26.232C212.483 26.232 215.343 27.064 217.605 28.728C219.867 30.392 221.271 32.667 221.817 35.553H213.588ZM233.199 26.505V54H225.555V26.505H233.199ZM263.019 54H255.375L245.196 38.634V54H237.552V26.505H245.196L255.375 42.066V26.505H263.019V54Z" fill="white"/>
<defs>
<clipPath id="clip0_1_36">
<rect width="60" height="42" fill="white" transform="translate(63 21)"/>
</clipPath>
</defs>
</svg>

)
}
8 changes: 5 additions & 3 deletions frontend/code/src/Auth/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { Link } from "react-router-dom";
import pingpong from '../images/pingpong.svg'
import button from '../images/button.svg'
import {Button} from './Assets/Button'
export const Login = () =>
{

return (
<div className="auth-container overflow-hidden flex flex-col items-center justify-center h-screen bg-[url(./images/bg.gif)] bg-luxury bg-no-repeat bg-cover bg-center">
<div className="overlay absolute h-full w-full bg-black opacity-40 z-10"></div>
<div className="auth-section p-16 absolute top-[25%] sm:top-[30%] xl:top-[35%] z-50 flex flex-col items-center gap-y-20">
<div className="logo-container flex flex-col justify-center">
<img className="logo" src={pingpong} alt="Logo" />
<img src={pingpong} alt="Logo" />
</div>
<Link to="/main">
<img className=" flex justify-center items-center p-2" src={button} alt="Auth Button" />
<Link to="/layout">
<Button/>
</Link>
</div>
</div>
Expand Down
9 changes: 9 additions & 0 deletions frontend/code/src/Layout/Assets/Alert.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

export const Alert = () => {
return (
<svg className="flex justify-center items-center w-10 sm:w-12 " width="62" height="62" viewBox="0 0 62 62" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="62" height="62" rx="20" fill="black"/>
<path d="M27.9189 40.1081C28.5314 39.9785 32.2636 39.9785 32.8761 40.1081C33.3997 40.229 33.966 40.5116 33.966 41.1286C33.9355 41.716 33.5909 42.2367 33.1148 42.5674C32.4974 43.0487 31.7729 43.3535 31.0155 43.4633C30.5966 43.5176 30.185 43.5188 29.7807 43.4633C29.0221 43.3535 28.2976 43.0487 27.6814 42.5662C27.2041 42.2367 26.8594 41.716 26.829 41.1286C26.829 40.5116 27.3952 40.229 27.9189 40.1081ZM30.4698 19C33.0185 19 35.6219 20.2093 37.1684 22.2158C38.1718 23.5078 38.6321 24.7986 38.6321 26.8051V27.327C38.6321 28.8658 39.0388 29.7728 39.9338 30.818C40.6121 31.588 40.8288 32.5765 40.8288 33.6488C40.8288 34.7199 40.4769 35.7367 39.7719 36.5623C38.8488 37.552 37.5471 38.1838 36.2186 38.2936C34.2934 38.4577 32.367 38.5959 30.415 38.5959C28.4618 38.5959 26.5366 38.5132 24.6114 38.2936C23.2817 38.1838 21.98 37.552 21.0582 36.5623C20.3531 35.7367 20 34.7199 20 33.6488C20 32.5765 20.218 31.588 20.895 30.818C21.818 29.7728 22.198 28.8658 22.198 27.327V26.8051C22.198 24.7443 22.7118 23.3967 23.77 22.0776C25.3433 20.1538 27.8652 19 30.3602 19H30.4698Z" fill="#8F8F8F"/>
</svg>
)
}
16 changes: 16 additions & 0 deletions frontend/code/src/Layout/Assets/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const Avatar = () =>{
return (
<div className="avatar online dropdown">
<div tabIndex={0} className="w-10 sm:w-12 rounded-xl">
<img src="https://daisyui.com/images/stock/photo-1534528741775-53994a69daeb.jpg" />
</div>
<ul tabIndex={0} className="dropdown-content z-50 right-0 top-10 menu p-2 shadow bg-base-100 rounded-box w-52">
<li className="hover:bg-primary hover:rounded-xl transform duration-500"><a>Settings</a></li>
<li className="hover:bg-primary hover:rounded-xl transform duration-500"><a>Profile</a></li>
</ul>
</div>



)
}
10 changes: 10 additions & 0 deletions frontend/code/src/Layout/Assets/Dash.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const Dash = () => {
return (
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="4" y="4" width="6" height="7" rx="1" stroke="#BDBDBD" stroke-width="2" stroke-linejoin="round"/>
<rect x="4" y="15" width="6" height="5" rx="1" stroke="#BDBDBD" stroke-width="2" stroke-linejoin="round"/>
<rect x="14" y="4" width="6" height="5" rx="1" stroke="#BDBDBD" stroke-width="2" stroke-linejoin="round"/>
<rect x="14" y="13" width="6" height="7" rx="1" stroke="#BDBDBD" stroke-width="2" stroke-linejoin="round"/>
</svg>
)
}
18 changes: 18 additions & 0 deletions frontend/code/src/Layout/Assets/Logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export const Logo = () => {
return (
<svg className="p-1 fixed left-3 z-100 w-20" width="95" height="51" viewBox="0 0 95 51" fill="none" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink">
<path d="M33.203 31.5552C29.731 31.5316 26.8972 34.3197 26.8735 37.7827C26.8498 41.2458 29.6452 44.0722 33.1172 44.0959C36.5892 44.1195 39.423 41.3313 39.4467 37.8683C39.4704 34.4053 36.675 31.5788 33.203 31.5552Z" fill="white"/>
<path d="M23.7568 49.8316L25.2388 50.844L29.9719 43.9511L28.49 42.9387L23.7568 49.8316Z" fill="white"/>
<path d="M3.98999 28.56V10.9558H7.58099L7.72181 13.765L7.0177 13.5543C7.12723 13.0705 7.44017 12.6179 7.95652 12.1965C8.48852 11.7751 9.16134 11.4318 9.97499 11.1665C10.7886 10.8855 11.6805 10.7451 12.6506 10.7451C13.9806 10.7451 15.1463 11.0182 16.1478 11.5644C17.1648 12.1107 17.9472 12.8676 18.4948 13.8352C19.0581 14.7872 19.3398 15.9031 19.3398 17.1828C19.3398 18.4469 19.0581 19.5628 18.4948 20.5304C17.9315 21.498 17.1413 22.2549 16.1243 22.8012C15.1072 23.3474 13.9337 23.6205 12.6037 23.6205C11.6336 23.6205 10.7417 23.48 9.92805 23.1991C9.1144 22.9026 8.44158 22.528 7.90958 22.0754C7.37758 21.6073 7.04899 21.1391 6.92381 20.6709L7.79223 20.3431V28.56H3.98999ZM11.6883 20.4602C12.4863 20.4602 13.1826 20.3275 13.7772 20.0622C14.3718 19.7813 14.8334 19.3989 15.162 18.9151C15.4906 18.4157 15.6549 17.8383 15.6549 17.1828C15.6549 16.5273 15.4906 15.9577 15.162 15.4739C14.8491 14.9745 14.3875 14.5921 13.7772 14.3268C13.1826 14.0459 12.4863 13.9054 11.6883 13.9054C10.8747 13.9054 10.1628 14.0459 9.55252 14.3268C8.95793 14.6077 8.49634 14.9979 8.16776 15.4973C7.83917 15.9811 7.67487 16.5429 7.67487 17.1828C7.67487 17.8383 7.83917 18.4157 8.16776 18.9151C8.49634 19.3989 8.95793 19.7813 9.55252 20.0622C10.1628 20.3275 10.8747 20.4602 11.6883 20.4602ZM46.1088 23.4098V10.9792H49.6763L49.8172 14.1863L48.8079 14.4204C49.0583 13.765 49.4338 13.1641 49.9345 12.6179C50.4509 12.056 51.1002 11.6034 51.8826 11.2601C52.6649 10.9012 53.5333 10.7217 54.4878 10.7217C55.6613 10.7217 56.6471 10.948 57.4451 11.4006C58.2431 11.8532 58.8455 12.4774 59.2523 13.2734C59.6748 14.0693 59.886 14.9745 59.886 15.9889V23.4098H56.1307V16.6912C56.1307 16.1294 56.0056 15.6377 55.7552 15.2164C55.5049 14.7794 55.1606 14.4516 54.7225 14.2332C54.2844 13.9991 53.7759 13.882 53.1969 13.882C52.6649 13.882 52.1955 13.9756 51.7887 14.1629C51.3819 14.3346 51.0298 14.5687 50.7325 14.8652C50.4509 15.1461 50.2396 15.4505 50.0988 15.7782C49.958 16.1059 49.8876 16.4337 49.8876 16.7614V23.4098H48.0099C47.431 23.4098 46.9772 23.4098 46.6486 23.4098C46.3357 23.4098 46.1557 23.4098 46.1088 23.4098ZM79.1294 28.7941C77.7212 28.7941 76.4616 28.638 75.3506 28.3259C74.2397 28.0137 73.34 27.6392 72.6515 27.2022L73.9424 24.4867C74.2866 24.6427 74.6856 24.8144 75.1394 25.0017C75.6088 25.189 76.133 25.345 76.7119 25.4699C77.2909 25.6103 77.9324 25.6806 78.6365 25.6806C79.4658 25.6806 80.1778 25.5323 80.7723 25.2358C81.3669 24.9393 81.8207 24.5023 82.1336 23.9248C82.4622 23.363 82.6265 22.6529 82.6265 21.7945V20.3899L83.3541 20.507C83.2289 21.0064 82.8847 21.4746 82.3214 21.9116C81.7738 22.333 81.0696 22.6763 80.2091 22.9416C79.3641 23.1913 78.4488 23.3162 77.463 23.3162C76.1643 23.3162 75.0142 23.0587 74.0128 22.5436C73.0114 22.0286 72.2291 21.3029 71.6658 20.3665C71.1181 19.4301 70.8443 18.3533 70.8443 17.136C70.8443 15.8718 71.1338 14.7638 71.7127 13.8118C72.3073 12.8442 73.1209 12.0873 74.1536 11.541C75.1863 10.9948 76.3677 10.7217 77.6977 10.7217C78.0889 10.7217 78.527 10.7685 79.0121 10.8621C79.5128 10.9402 80.0135 11.065 80.5142 11.2367C81.0305 11.3928 81.5078 11.5878 81.9459 11.8219C82.384 12.0404 82.7361 12.3057 83.0021 12.6179C83.2837 12.93 83.4402 13.2577 83.4715 13.6011L82.6969 13.7884L82.8378 10.9792H86.4053V21.7243C86.4053 22.8948 86.2097 23.9248 85.8185 24.8144C85.443 25.704 84.9188 26.4453 84.246 27.0383C83.5888 27.6314 82.8221 28.0684 81.9459 28.3493C81.0696 28.6458 80.1308 28.7941 79.1294 28.7941ZM78.7539 20.4134C79.5832 20.4134 80.2873 20.2807 80.8662 20.0154C81.4608 19.7345 81.9224 19.3521 82.251 18.8683C82.5796 18.3689 82.7439 17.7993 82.7439 17.1594C82.7439 16.5039 82.5796 15.9343 82.251 15.4505C81.9224 14.9667 81.4608 14.5843 80.8662 14.3034C80.2873 14.0225 79.5832 13.882 78.7539 13.882C77.9246 13.882 77.1892 14.0225 76.5476 14.3034C75.9218 14.5843 75.4367 14.9667 75.0925 15.4505C74.7482 15.9343 74.5761 16.5039 74.5761 17.1594C74.5761 17.7993 74.7482 18.3689 75.0925 18.8683C75.4367 19.3521 75.9218 19.7345 76.5476 20.0154C77.1892 20.2807 77.9246 20.4134 78.7539 20.4134Z" fill="white"/>
<path d="M3.98999 50.019V32.4148H7.58099L7.72181 35.2239L7.0177 35.0133C7.12723 34.5295 7.44017 34.0769 7.95652 33.6555C8.48852 33.2341 9.16134 32.8908 9.97499 32.6255C10.7886 32.3445 11.6805 32.2041 12.6506 32.2041C13.9806 32.2041 15.1463 32.4772 16.1478 33.0234C17.1648 33.5696 17.9472 34.3266 18.4948 35.2942C19.0581 36.2462 19.3398 37.362 19.3398 38.6418C19.3398 39.9059 19.0581 41.0218 18.4948 41.9894C17.9315 42.957 17.1413 43.7139 16.1243 44.2601C15.1072 44.8064 13.9337 45.0795 12.6037 45.0795C11.6336 45.0795 10.7417 44.939 9.92805 44.6581C9.1144 44.3616 8.44158 43.987 7.90958 43.5344C7.37758 43.0662 7.04899 42.598 6.92381 42.1298L7.79223 41.8021V50.019H3.98999ZM11.6883 41.9192C12.4863 41.9192 13.1826 41.7865 13.7772 41.5212C14.3718 41.2403 14.8334 40.8579 15.162 40.3741C15.4906 39.8747 15.6549 39.2973 15.6549 38.6418C15.6549 37.9863 15.4906 37.4167 15.162 36.9329C14.8491 36.4335 14.3875 36.0511 13.7772 35.7858C13.1826 35.5049 12.4863 35.3644 11.6883 35.3644C10.8747 35.3644 10.1628 35.5049 9.55252 35.7858C8.95793 36.0667 8.49634 36.4569 8.16776 36.9563C7.83917 37.4401 7.67487 38.0019 7.67487 38.6418C7.67487 39.2973 7.83917 39.8747 8.16776 40.3741C8.49634 40.8579 8.95793 41.2403 9.55252 41.5212C10.1628 41.7865 10.8747 41.9192 11.6883 41.9192ZM46.1088 44.8688V32.4382H49.6763L49.8172 35.6453L48.8079 35.8794C49.0583 35.2239 49.4338 34.6231 49.9345 34.0769C50.4509 33.515 51.1002 33.0624 51.8826 32.7191C52.6649 32.3601 53.5333 32.1807 54.4878 32.1807C55.6613 32.1807 56.6471 32.407 57.4451 32.8595C58.2431 33.3121 58.8455 33.9364 59.2523 34.7323C59.6748 35.5283 59.886 36.4334 59.886 37.4479V44.8688H56.1307V38.1502C56.1307 37.5883 56.0056 37.0967 55.7552 36.6754C55.5049 36.2384 55.1606 35.9106 54.7225 35.6921C54.2844 35.458 53.7759 35.341 53.1969 35.341C52.6649 35.341 52.1955 35.4346 51.7887 35.6219C51.3819 35.7936 51.0298 36.0277 50.7325 36.3242C50.4509 36.6051 50.2396 36.9095 50.0988 37.2372C49.958 37.5649 49.8876 37.8927 49.8876 38.2204V44.8688H48.0099C47.431 44.8688 46.9772 44.8688 46.6486 44.8688C46.3357 44.8688 46.1557 44.8688 46.1088 44.8688ZM79.1294 50.2531C77.7212 50.2531 76.4616 50.097 75.3506 49.7849C74.2397 49.4727 73.34 49.0982 72.6515 48.6612L73.9424 45.9456C74.2866 46.1017 74.6856 46.2734 75.1394 46.4607C75.6088 46.6479 76.133 46.804 76.7119 46.9289C77.2909 47.0693 77.9324 47.1395 78.6365 47.1395C79.4658 47.1395 80.1778 46.9913 80.7723 46.6948C81.3669 46.3982 81.8207 45.9613 82.1336 45.3838C82.4622 44.822 82.6265 44.1119 82.6265 43.2535V41.8489L83.3541 41.966C83.2289 42.4654 82.8847 42.9336 82.3214 43.3706C81.7738 43.7919 81.0696 44.1353 80.2091 44.4006C79.3641 44.6503 78.4488 44.7752 77.463 44.7752C76.1643 44.7752 75.0142 44.5176 74.0128 44.0026C73.0114 43.4876 72.2291 42.7619 71.6658 41.8255C71.1181 40.8891 70.8443 39.8123 70.8443 38.595C70.8443 37.3308 71.1338 36.2228 71.7127 35.2708C72.3073 34.3032 73.1209 33.5462 74.1536 33C75.1863 32.4538 76.3677 32.1807 77.6977 32.1807C78.0889 32.1807 78.527 32.2275 79.0121 32.3211C79.5128 32.3992 80.0135 32.524 80.5142 32.6957C81.0305 32.8517 81.5078 33.0468 81.9459 33.2809C82.384 33.4994 82.7361 33.7647 83.0021 34.0769C83.2837 34.389 83.4402 34.7167 83.4715 35.0601L82.6969 35.2474L82.8378 32.4382H86.4053V43.1833C86.4053 44.3538 86.2097 45.3838 85.8185 46.2734C85.443 47.163 84.9188 47.9043 84.246 48.4973C83.5888 49.0904 82.8221 49.5274 81.9459 49.8083C81.0696 50.1048 80.1308 50.2531 79.1294 50.2531ZM78.7539 41.8723C79.5832 41.8723 80.2873 41.7397 80.8662 41.4744C81.4608 41.1935 81.9224 40.8111 82.251 40.3273C82.5796 39.8279 82.7439 39.2582 82.7439 38.6184C82.7439 37.9629 82.5796 37.3933 82.251 36.9095C81.9224 36.4256 81.4608 36.0433 80.8662 35.7624C80.2873 35.4815 79.5832 35.341 78.7539 35.341C77.9246 35.341 77.1892 35.4815 76.5476 35.7624C75.9218 36.0433 75.4367 36.4256 75.0925 36.9095C74.7482 37.3933 74.5761 37.9629 74.5761 38.6184C74.5761 39.2582 74.7482 39.8279 75.0925 40.3273C75.4367 40.8111 75.9218 41.1935 76.5476 41.4744C77.1892 41.7397 77.9246 41.8723 78.7539 41.8723Z" fill="white"/>
<path d="M23.7498 21.4913L32.4438 27.3115L38.2792 18.64L29.5851 12.8197L23.7498 21.4913Z" fill="url(#pattern0)"/>
<path d="M30.3228 18.7546C31.6602 18.7546 32.7444 17.6732 32.7444 16.3392C32.7444 15.0052 31.6602 13.9238 30.3228 13.9238C28.9853 13.9238 27.9011 15.0052 27.9011 16.3392C27.9011 17.6732 28.9853 18.7546 30.3228 18.7546Z" fill="white"/>
<defs>
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
<use xlinkHref="#image0_152_4981" transform="scale(0.00390625)"/>
</pattern>

</defs>
</svg>
)
}
File renamed without changes
Loading

0 comments on commit e70ae57

Please sign in to comment.