Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
88b57d8
feat(frontend): add firebase hosting to client application
mitch1009 Apr 24, 2023
b9dfbfb
feat: farm mutation endpoint completed.
Daniel-Mokoena Apr 24, 2023
8cdcbfb
fix: livestock & farm
Daniel-Mokoena Apr 24, 2023
01b7009
Merge branch 'feature/backend' of https://github.com/green-sync/green…
Daniel-Mokoena Apr 24, 2023
883800e
fix: farmMutationResolver fixed
Daniel-Mokoena Apr 24, 2023
183b94b
feat(api): implemet context
mitch1009 Apr 24, 2023
3b949cf
feat(market): add grensync marketplace
mitch1009 Apr 24, 2023
7a772f6
feat(farmer): change client to farmer
mitch1009 Apr 24, 2023
c463da0
feat(market): change title
mitch1009 Apr 24, 2023
c321a0d
feat: add ui library
mitch1009 Apr 24, 2023
a2089a4
refactor: chnage component to ui-library
mitch1009 Apr 24, 2023
e1ec4ff
fea: add greensync ui libraries
mitch1009 Apr 24, 2023
b930be8
feat: architecture of the project adjusted
mitch1009 Apr 24, 2023
2f1df2c
fix: remove css
mitch1009 Apr 24, 2023
a552e20
feat: add storybook resolves #14
mitch1009 Apr 24, 2023
707552b
fix(library): reloves #40
mitch1009 Apr 24, 2023
0993cf3
fix: close #40
mitch1009 Apr 24, 2023
c8f0594
feat: add tailwindcss
mitch1009 Apr 24, 2023
4651cf5
feat: initialize tailwindcss closes #35
mitch1009 Apr 24, 2023
68d6e50
feat: add storybook
mitch1009 Apr 25, 2023
fe3ae70
feat: sample login image
mitch1009 Apr 25, 2023
48cf29c
feat: add authcomponent
mitch1009 Apr 25, 2023
87216bd
feat: add authDto
mitch1009 Apr 25, 2023
e32298f
feat: add authguard
mitch1009 Apr 25, 2023
81468d3
feat: add auth module
mitch1009 Apr 25, 2023
315cf1a
feat: add components module
mitch1009 Apr 25, 2023
8b91bc2
feat: add auth story
mitch1009 Apr 25, 2023
44dd84d
feat: remove default stories
mitch1009 Apr 25, 2023
4d0b111
feat: ui package initial components
mitch1009 Apr 25, 2023
6071af5
feat: closes #37
mitch1009 Apr 25, 2023
bb1966a
feat: usable props
mitch1009 Apr 25, 2023
758a0cd
feat: implement rollup configuration
mitch1009 Apr 25, 2023
5667941
Merge pull request #41 from Green-sync/feature/library
mitch1009 Apr 25, 2023
cedff02
fix(api): serve env
mitch1009 Apr 24, 2023
5e05bd8
dashboard
Dzunisan Apr 24, 2023
638de5c
initiated redirecting
MathibelaD Apr 24, 2023
a80f904
dashboard routing
MathibelaD Apr 24, 2023
41e192f
navigate to dashboard
MathibelaD Apr 24, 2023
13cf326
change form component
MathibelaD Apr 24, 2023
111db19
change components
MathibelaD Apr 24, 2023
526f995
fix error
MathibelaD Apr 24, 2023
679dcee
Co-authored-by: Mitch Chimwemwe Chanza <mitch1009@users.noreply.githu…
MathibelaD Apr 24, 2023
e2be6bb
loginWithEmail
MathibelaD Apr 24, 2023
2304a74
feat(farmer): change client to farmer
mitch1009 Apr 24, 2023
2953f0e
feat: add storybook resolves #14
mitch1009 Apr 24, 2023
3ff8ead
fat: new updated lock file
mitch1009 Apr 25, 2023
466b1e2
feat: farm service edited
mitch1009 Apr 25, 2023
412942f
feat(deploy): add firebase functions
mitch1009 Apr 25, 2023
3a04a10
feat: fucntions hosting initialized
mitch1009 Apr 25, 2023
0a3983c
feat: rename to marketplace
mitch1009 Apr 25, 2023
72f50cd
feat: add firebase
mitch1009 Apr 25, 2023
e94e750
fix(api): serve env
mitch1009 Apr 24, 2023
106aec5
dashboard
Dzunisan Apr 24, 2023
c904dc1
dashboard-green
Dzunisan Apr 24, 2023
4603b8d
feat(market): add grensync marketplace
mitch1009 Apr 24, 2023
31a890c
feat(farmer): change client to farmer
mitch1009 Apr 24, 2023
d4f763c
feat: implement rollup configuration
mitch1009 Apr 25, 2023
0507285
dashboard
Dzunisan Apr 24, 2023
695b3e3
initiated redirecting
MathibelaD Apr 24, 2023
4455a4c
navigate to dashboard
MathibelaD Apr 24, 2023
dae310b
Co-authored-by: Mitch Chimwemwe Chanza <mitch1009@users.noreply.githu…
MathibelaD Apr 24, 2023
efe9067
feat(farmer): change client to farmer
mitch1009 Apr 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
20 changes: 20 additions & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge
'on':
push:
branches:
- marketplace
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: pnpm i && pnpm build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_AGRPRJ }}'
channelId: live
projectId: agrprj
17 changes: 17 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
'on': pull_request
jobs:
build_and_preview:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: pnpm i && pnpm build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_AGRPRJ }}'
projectId: agrprj
9 changes: 0 additions & 9 deletions Applications/client/src/pages/dashboard.tsx

This file was deleted.

File renamed without changes.
24 changes: 24 additions & 0 deletions Applications/consumer/.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?
13 changes: 13 additions & 0 deletions Applications/consumer/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!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>Green market | One stop shop for all things agri</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
29 changes: 29 additions & 0 deletions Applications/consumer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "consumer",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite --port 5300 --host 0.0.0.0 --open",
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@green-sync/ui": "workspace:^",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@typescript-eslint/eslint-plugin": "^5.57.1",
"@typescript-eslint/parser": "^5.57.1",
"@vitejs/plugin-react": "^4.0.0-beta.0",
"eslint": "^8.38.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.4",
"typescript": "^5.0.2",
"vite": "^4.3.0"
}
}
9 changes: 9 additions & 0 deletions Applications/consumer/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {Card} from "@green-sync/ui"
export const App = () => {
const cta = () => {

}
return <>
<Card image="/images.jpeg" description="Welcome" title="" cta={cta}/>
</>
}
Empty file.
69 changes: 69 additions & 0 deletions Applications/consumer/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
}

a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}

body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}

h1 {
font-size: 3.2em;
line-height: 1.1;
}

button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}
10 changes: 10 additions & 0 deletions Applications/consumer/src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import {App} from './App.tsx'
import './index.css'

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)
3 changes: 3 additions & 0 deletions Applications/consumer/src/pages/Home.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const HomePage = () => {
return <>Home Page</>
}
1 change: 1 addition & 0 deletions Applications/consumer/src/pages/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./Home"
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions Applications/farmer/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': 'warn',
},
}
5 changes: 5 additions & 0 deletions Applications/farmer/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "agrprj"
}
}
File renamed without changes.
17 changes: 17 additions & 0 deletions Applications/farmer/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"hosting": {
"site": "dev-agritech",
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"
integrity="sha512-N9XaASe+i+0Z0JsmZSfL8fkHdT95TREw78mqcqTIdyLPJ9lBL0sNOIM+vQkDgA0Ll8HQOKHhJ1hy2gMyyo/6Q=="
crossorigin="anonymous" referrerpolicy="no-referrer" /> -->

<link rel="stylesheet" href="./src/style/agriDashboard.css">
<title>Vite + React + TS</title>
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
"start": "vite --host 0.0.0.0 --port 43000",
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
"preview": "vite preview",
"host":"firebase deploy --only hosting:dev-agritech",
"host:prod":"firebase deploy --only hosting:prod-agritech"
},
"dependencies": {
"@apollo/client": "^3.7.12",
"@headlessui/react": "^1.7.14",
"@heroicons/react": "^2.0.17",
"@reach/disclosure": "^0.18.0",
"firebase": "^9.20.0",
"graphql": "^16.6.0",
"react": "^18.2.0",
Expand Down
1 change: 1 addition & 0 deletions Applications/farmer/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.
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { Routes, Route} from "react-router-dom"
import ErrorPage from "./pages/errorPage"
import LoginPage from "./pages/loginPage"
import DashboardPage from "./pages/dashboard"
import { SignUp } from "./pages/signUpPage"
import {env} from "./utils"
import LoginForms from "./components/forms/LoginForms"
import { RouteGuard } from "./components/authentication/auth.guard"
function App() {
console.log(env)
return (
<>
<Routes>
<Route index path="/" element={<LoginPage/>}/>
<Route path="/signUp" element={<SignUp />} />
<Route path="/dashboard" element={<DashboardPage/>}/>
<Route index path="/" element={
<RouteGuard>
<DashboardPage/>
</RouteGuard>
}/>
<Route path="/signIn" element={<LoginForms />} />
<Route path="*" element={<ErrorPage/>}/>
</Routes>
</>
)
}

export default App
25 changes: 25 additions & 0 deletions Applications/farmer/src/components/authentication/auth.guard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { User, onAuthStateChanged } from "firebase/auth"
import { createContext, useEffect, useState } from "react"
import { auth } from "../../utils"
import { useNavigate } from "react-router-dom"

// export a context
export const GreenContext = createContext<User|null>(null)

export const RouteGuard = ({children}: any) => {
const [user, setUser] = useState<User>()
const nav = useNavigate()
useEffect(()=>{
const sub = onAuthStateChanged(auth, (user)=>{
if(!user) {
nav("/signin")
}
setUser(user as User)
// additional logic
})
return sub
}, [user,nav,setUser])
return <GreenContext.Provider value={user as any}>
{children}
</GreenContext.Provider>
}
1 change: 1 addition & 0 deletions Applications/farmer/src/components/authentication/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './'
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React, { useState } from 'react'
import { SignUp } from '../../pages';
import SignIn from '../../pages/loginPage';

const LoginComponent = () => {
const [showComponent, setShowComponent] = useState(true);

return (
<div>
{showComponent ? <SignIn toggleComponent={() => setShowComponent(!showComponent)} /> : <SignUp toggleComponent={() => setShowComponent(!showComponent)}/>}
</div>
)
}

export default LoginComponent
Loading