Skip to content

Commit

Permalink
Merge pull request #146 from Open-Science-Community-Saudi-Arabia/dev
Browse files Browse the repository at this point in the history
Merge the dev into the main for 1st prototype
  • Loading branch information
BatoolMM authored Dec 28, 2022
2 parents 9bb1b44 + fd1fdca commit 62764b7
Show file tree
Hide file tree
Showing 108 changed files with 15,088 additions and 9 deletions.
74 changes: 74 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,77 @@ vignettes/*.pdf

# R Environment Variables
.Renviron

# Backend API sensitive files
/backend_API/src/.env*
*node_modules/

# History files
.Rhistory
.Rapp.history

# Session Data files
.RData

# User-specific files
.Ruserdata

# Example code in package build process
*-Ex.R

# Output files from R CMD build
/*.tar.gz

# Output files from R CMD check
/*.Rcheck/

# RStudio files
.Rproj.user/

# produced vignettes
vignettes/*.html
vignettes/*.pdf

# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
.httr-oauth

# knitr and R markdown default cache directories
*_cache/
/cache/

# Temporary files created by R markdown
*.utf8.md
*.knit.md

# R Environment Variables
.Renviron

# Backend API sensitive files
/backend_API/src/*.env
*node_modules/

# Frontend
# 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?
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

<!-- Change log file should contain history of all changes or contributions made and a reference to the PR or issue created -->

# Changelog

All notable changes to this project will be documented in this file.
Expand All @@ -16,3 +19,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### `Deprecated`

### `Security`

7 changes: 7 additions & 0 deletions Frontend/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# node node_modules
/node_modules/*

#build artefacts
dist/*
build/*
coverage/*
33 changes: 33 additions & 0 deletions Frontend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: ["plugin:react/recommended", "airbnb", "prettier"],
overrides: [],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["react", "prettier"],
rules: {
"prettier/prettier": ["error"],
"no-unused-vars": "warn",
"react/no-unescaped-entities": 0,
"jsx-a11y/anchor-is-valid": 0,
"react/button-has-type": 0,
"react/self-closing-comp": "warn",
"import/newline-after-import": "warn",
"import/order": "warn",
"no-console": "warn",
"camelcase":"off",
'react/jsx-props-no-spreading': 'off',
'react/no-array-index-key':'off',
'import/prefer-default-export':'off',
'jsx-a11y/click-events-have-key-events':'off',
'jsx-a11y/no-static-element-interactions':'off',
'react/prop-types': ['off'],
'react/jsx-no-constructed-context-values': 'off'
}
}
6 changes: 6 additions & 0 deletions Frontend/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

cd Frontend
yarn lint-staged

4 changes: 4 additions & 0 deletions Frontend/.husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

# include other rules here eg. unit tests
5 changes: 5 additions & 0 deletions Frontend/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!include:../.gitignore
node_modules/

# html files
*.html
25 changes: 25 additions & 0 deletions Frontend/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"printWidth": 100,
"trailingComma": "all",
"tabWidth": 2,
"semi": false,
"singleQuote": false,
"arrowParens": "always",
"requirePragma": true,
"endOfLine": "lf",
"overrides": [
{
"files": "*.json",
"options": {
"singleQuote": false
}
},
{
"files": ".*rc",
"options": {
"singleQuote": false,
"parser": "json"
}
}
]
}
20 changes: 20 additions & 0 deletions Frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<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=Lato&display=swap" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<!-- Google Signup/signin script -->
<script src="https://accounts.google.com/gsi/client" async defer></script>

<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
4 changes: 4 additions & 0 deletions Frontend/lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
'*.{js,jsx}': ['yarn lint'],
'*.{js,json,css,jsx}': ['yarn format'],
}
49 changes: 49 additions & 0 deletions Frontend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "oscsa",
"private": true,
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"lint": "eslint --fix",
"lint:fix": "eslint --fix */**/*.{jsx,js,tsx} --color",
"lint:check": "eslint */**/*.{jsx,js,tsx} --color",
"prettier": "prettier .",
"format": "prettier --write",
"format:fix": "yarn prettier -- --write",
"format:check": "yarn prettier -- --check",
"prepare": "cd .. && husky install Frontend/.husky",
"lint-staged": "lint-staged --config lint-staged.config.js"
},
"dependencies": {
"@vitejs/plugin-react": "^2.1.0",
"axios": "^1.1.3",
"gapi-script": "^1.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-google-login": "^5.2.2",
"react-icons": "^4.6.0",
"react-router-dom": "^6.4.2",
"react-slick": "^0.29.0",
"react-toastify": "^9.1.1",
"slick-carousel": "^1.8.1",
"vite": "^3.1.0"
},
"devDependencies": {
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"eslint": "^7.32.0 || ^8.2.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
"sass": "^1.56.1"
}
}
1 change: 1 addition & 0 deletions Frontend/public/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* /index.html 200
Binary file added Frontend/public/images/Mask Group.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Frontend/public/images/course1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Frontend/public/images/course2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Frontend/public/images/course3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Frontend/public/images/hero-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Frontend/public/images/ring1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Frontend/public/images/ring2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Frontend/public/images/testimonial1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Frontend/public/vectors/certificate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Frontend/public/vectors/training.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Frontend/public/vectors/user.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 Frontend/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.
30 changes: 30 additions & 0 deletions Frontend/src/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from "react"
import "./styles/GlobalStyles.scss"
import { Routes, Route } from "react-router-dom"
import LandingPage from "./pages/landing-page/LandingPage"
import Login from "./pages/auth/login"
import Signup from "./pages/auth/signup"
import Dashboard from "./pages/Dashboard"
import {AppProvider} from "./context";
import ResetPassword from "./pages/auth/password/reset-password";
import ForgotPassword from "./pages/auth/password/forgotpassword";

function App() {

return (

<Routes>
<Route path="/" element={<LandingPage />} />
<Route path="/login" element={<Login />} />
<Route path="/signup" element={<Signup />} />
<Route path="/resetpassword" element={<ResetPassword />} />
<Route path="/forgotpassword" element={<ForgotPassword />} />
<Route path="/dashboard"
element={ <AppProvider><Dashboard /></AppProvider>}
/>

</Routes>)
}

export default App

1 change: 1 addition & 0 deletions Frontend/src/assets/react.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions Frontend/src/components/Carousel/Carousel.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import React from "react";
import './Carousel.scss'
import Slider from 'react-slick'
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";
import LeftArrow from '../vectors/LeftArrow'
import RightArrow from '../vectors/RightArrow'

function Carousel({children}) {
const settings = {
infinite:true,
speed: 500,
slidesToShow: 4,
slidesToScroll: 1,
initialSlide: 0,
nextArrow: <SampleNextArrow />,
prevArrow: <SamplePreviousArrow />,
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 3,
slidesToScroll: 3,
infinite: true,
dots: true
}
},
{
breakpoint: 768,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
initialSlide: 2
}
},
{
breakpoint: 425,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
}
return (
<Slider {...settings} className='carosel'>
{children}
</Slider>
)
}

export default Carousel

function SampleNextArrow({
onClick,
}) {
return (
<div
className=" next "
onClick={onClick}
>

<RightArrow/>
</div>
);
}

function SamplePreviousArrow({
onClick,
}) {
return (
<div
className="prev"
onClick={onClick}
>
<LeftArrow/>
</div>
);
}

7 changes: 7 additions & 0 deletions Frontend/src/components/Carousel/Carousel.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.slick-list {
margin: 0 -10px;
}

.slick-slide>div {
margin: 0 15px;
}
Loading

0 comments on commit 62764b7

Please sign in to comment.