add scss and remove styled component
This commit is contained in:
parent
423e43cee0
commit
4b06fbed96
49
README.md
49
README.md
@ -2,6 +2,28 @@
|
|||||||
|
|
||||||
the warehouse use to tracking item in house
|
the warehouse use to tracking item in house
|
||||||
|
|
||||||
|
# Project setup
|
||||||
|
|
||||||
|
install `Taskfile` first with this command line:
|
||||||
|
- for macOS, linux:
|
||||||
|
```bash
|
||||||
|
brew install go-task
|
||||||
|
```
|
||||||
|
- for windows:
|
||||||
|
```bash
|
||||||
|
winget install Task.Task
|
||||||
|
```
|
||||||
|
or
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install -g @go-task/cli
|
||||||
|
```
|
||||||
|
|
||||||
|
install `pnpm` for front-end with command line:
|
||||||
|
```bash
|
||||||
|
npm i pnpm -g
|
||||||
|
```
|
||||||
|
|
||||||
# Common CLI
|
# Common CLI
|
||||||
|
|
||||||
### alembic
|
### alembic
|
||||||
@ -38,32 +60,31 @@ generate migration auto code
|
|||||||
alembic revision --autogenerate -m "version message"
|
alembic revision --autogenerate -m "version message"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Back-end
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```bash
|
||||||
|
task be
|
||||||
|
```
|
||||||
|
|
||||||
# Front-end
|
# Front-end
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ npm install # or pnpm install or yarn install
|
task fe:i
|
||||||
```
|
```
|
||||||
|
|
||||||
### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs)
|
### Learn more on the [Solid Website](https://solidjs.com)
|
||||||
|
|
||||||
## Available Scripts
|
## Available Scripts
|
||||||
|
|
||||||
In the project directory, you can run:
|
In the project directory, you can run:
|
||||||
|
|
||||||
### `npm run dev`
|
```bash
|
||||||
|
task fe
|
||||||
Runs the app in the development mode.<br>
|
```
|
||||||
Open [http://localhost:5173](http://localhost:5173) to view it in the browser.
|
|
||||||
|
|
||||||
### `npm run build`
|
|
||||||
|
|
||||||
Builds the app for production to the `dist` folder.<br>
|
|
||||||
It correctly bundles Solid in production mode and optimizes the build for the best performance.
|
|
||||||
|
|
||||||
The build is minified and the filenames include the hashes.<br>
|
|
||||||
Your app is ready to be deployed!
|
|
||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
|
17
Taskfile.yml
17
Taskfile.yml
@ -12,17 +12,22 @@ dotenv:
|
|||||||
- .env
|
- .env
|
||||||
- .dev.env
|
- .dev.env
|
||||||
tasks:
|
tasks:
|
||||||
be:dev:
|
be:seed:
|
||||||
|
desc: remove db
|
||||||
|
dir: dev/data
|
||||||
|
cmds:
|
||||||
|
- rm -r fuware.db
|
||||||
|
be:
|
||||||
desc: runs the backend server
|
desc: runs the backend server
|
||||||
cmds:
|
cmds:
|
||||||
- poetry run python backend/app.py
|
- poetry run python backend/app.py
|
||||||
fe:dev:
|
|
||||||
desc: runs the frontend server
|
|
||||||
dir: frontend
|
|
||||||
cmds:
|
|
||||||
- pnpm dev
|
|
||||||
fe:i:
|
fe:i:
|
||||||
desc: runs the install package
|
desc: runs the install package
|
||||||
dir: frontend
|
dir: frontend
|
||||||
cmds:
|
cmds:
|
||||||
- pnpm i
|
- pnpm i
|
||||||
|
fe:
|
||||||
|
desc: runs the frontend server
|
||||||
|
dir: frontend
|
||||||
|
cmds:
|
||||||
|
- pnpm dev
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"solid-form-handler": "^1.2.3",
|
"solid-form-handler": "^1.2.3",
|
||||||
"solid-js": "^1.8.15",
|
"solid-js": "^1.8.15",
|
||||||
"solid-styled-components": "^0.28.5",
|
|
||||||
"solid-toast": "^0.5.0",
|
"solid-toast": "^0.5.0",
|
||||||
"yup": "^1.4.0"
|
"yup": "^1.4.0"
|
||||||
},
|
},
|
||||||
|
23
frontend/pnpm-lock.yaml
generated
23
frontend/pnpm-lock.yaml
generated
@ -32,9 +32,6 @@ importers:
|
|||||||
solid-js:
|
solid-js:
|
||||||
specifier: ^1.8.15
|
specifier: ^1.8.15
|
||||||
version: 1.8.17
|
version: 1.8.17
|
||||||
solid-styled-components:
|
|
||||||
specifier: ^0.28.5
|
|
||||||
version: 0.28.5(solid-js@1.8.17)
|
|
||||||
solid-toast:
|
solid-toast:
|
||||||
specifier: ^0.5.0
|
specifier: ^0.5.0
|
||||||
version: 0.5.0(solid-js@1.8.17)
|
version: 0.5.0(solid-js@1.8.17)
|
||||||
@ -1010,11 +1007,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
|
resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
|
|
||||||
goober@2.1.14:
|
|
||||||
resolution: {integrity: sha512-4UpC0NdGyAFqLNPnhCT2iHpza2q+RAY3GV85a/mRPdzyPQMsj0KmMMuetdIkzWRbJ+Hgau1EZztq8ImmiMGhsg==}
|
|
||||||
peerDependencies:
|
|
||||||
csstype: ^3.0.10
|
|
||||||
|
|
||||||
graphemer@1.4.0:
|
graphemer@1.4.0:
|
||||||
resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==}
|
resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==}
|
||||||
|
|
||||||
@ -1518,11 +1510,6 @@ packages:
|
|||||||
peerDependencies:
|
peerDependencies:
|
||||||
solid-js: ^1.3
|
solid-js: ^1.3
|
||||||
|
|
||||||
solid-styled-components@0.28.5:
|
|
||||||
resolution: {integrity: sha512-vwTcdp76wZNnESIzB6rRZ3U55NgcSAQXCiiRIiEFhxTFqT0bEh/warNT1qaRZu4OkAzrBkViOngF35ktI8sc4A==}
|
|
||||||
peerDependencies:
|
|
||||||
solid-js: ^1.4.4
|
|
||||||
|
|
||||||
solid-toast@0.5.0:
|
solid-toast@0.5.0:
|
||||||
resolution: {integrity: sha512-t770JakjyS2P9b8Qa1zMLOD51KYKWXbTAyJePVUoYex5c5FH5S/HtUBUbZAWFcqRCKmAE8KhyIiCvDZA8bOnxQ==}
|
resolution: {integrity: sha512-t770JakjyS2P9b8Qa1zMLOD51KYKWXbTAyJePVUoYex5c5FH5S/HtUBUbZAWFcqRCKmAE8KhyIiCvDZA8bOnxQ==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@ -2695,10 +2682,6 @@ snapshots:
|
|||||||
merge2: 1.4.1
|
merge2: 1.4.1
|
||||||
slash: 3.0.0
|
slash: 3.0.0
|
||||||
|
|
||||||
goober@2.1.14(csstype@3.1.3):
|
|
||||||
dependencies:
|
|
||||||
csstype: 3.1.3
|
|
||||||
|
|
||||||
graphemer@1.4.0: {}
|
graphemer@1.4.0: {}
|
||||||
|
|
||||||
has-flag@3.0.0: {}
|
has-flag@3.0.0: {}
|
||||||
@ -3136,12 +3119,6 @@ snapshots:
|
|||||||
'@babel/types': 7.24.5
|
'@babel/types': 7.24.5
|
||||||
solid-js: 1.8.17
|
solid-js: 1.8.17
|
||||||
|
|
||||||
solid-styled-components@0.28.5(solid-js@1.8.17):
|
|
||||||
dependencies:
|
|
||||||
csstype: 3.1.3
|
|
||||||
goober: 2.1.14(csstype@3.1.3)
|
|
||||||
solid-js: 1.8.17
|
|
||||||
|
|
||||||
solid-toast@0.5.0(solid-js@1.8.17):
|
solid-toast@0.5.0(solid-js@1.8.17):
|
||||||
dependencies:
|
dependencies:
|
||||||
solid-js: 1.8.17
|
solid-js: 1.8.17
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { MetaProvider } from '@solidjs/meta'
|
import { MetaProvider } from '@solidjs/meta'
|
||||||
import { Toaster } from 'solid-toast'
|
import { Toaster } from 'solid-toast'
|
||||||
import './App.css'
|
import './App.scss'
|
||||||
import { SiteContextProvider } from './context/SiteContext'
|
import { SiteContextProvider } from './context/SiteContext'
|
||||||
|
|
||||||
function App(props) {
|
function App(props) {
|
||||||
|
@ -14,11 +14,17 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#main-page.login-page {
|
|
||||||
height: 100svh;
|
|
||||||
}
|
|
||||||
|
|
||||||
#main-page .main-content {
|
#main-page .main-content {
|
||||||
max-height: calc(100svh - 64px);
|
max-height: calc(100svh - 64px);
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
font-weight: 500;
|
||||||
|
color: #646cff;
|
||||||
|
text-decoration: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
color: #535bf2;
|
||||||
|
}
|
@ -1,5 +1,3 @@
|
|||||||
// import { styled } from 'solid-styled-components'
|
|
||||||
|
|
||||||
import { useSiteContext } from '@context/SiteContext'
|
import { useSiteContext } from '@context/SiteContext'
|
||||||
import useAuth from '@hooks/useAuth'
|
import useAuth from '@hooks/useAuth'
|
||||||
import { NAV_ROUTES } from '@routes/routes'
|
import { NAV_ROUTES } from '@routes/routes'
|
||||||
@ -7,6 +5,7 @@ import { A } from '@solidjs/router'
|
|||||||
import { IconLogout, IconTriangle } from '@tabler/icons-solidjs'
|
import { IconLogout, IconTriangle } from '@tabler/icons-solidjs'
|
||||||
import { For, Show } from 'solid-js'
|
import { For, Show } from 'solid-js'
|
||||||
import { Dynamic } from 'solid-js/web'
|
import { Dynamic } from 'solid-js/web'
|
||||||
|
import './navbar.scss'
|
||||||
|
|
||||||
export default function Navbar() {
|
export default function Navbar() {
|
||||||
const { store, setAuth } = useSiteContext()
|
const { store, setAuth } = useSiteContext()
|
1
frontend/src/components/Navbar/index.js
Normal file
1
frontend/src/components/Navbar/index.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
export { default } from './Navbar'
|
@ -3,9 +3,8 @@ import { Route, Router } from '@solidjs/router'
|
|||||||
import { For, lazy } from 'solid-js'
|
import { For, lazy } from 'solid-js'
|
||||||
import { render } from 'solid-js/web'
|
import { render } from 'solid-js/web'
|
||||||
import App from './App'
|
import App from './App'
|
||||||
import './index.css'
|
import './index.scss'
|
||||||
import { ROUTES } from './routes'
|
import { ROUTES } from './routes'
|
||||||
import './styles/fuware.scss'
|
|
||||||
|
|
||||||
const root = document.getElementById('root')
|
const root = document.getElementById('root')
|
||||||
|
|
||||||
|
@ -24,12 +24,3 @@ body {
|
|||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
|
||||||
font-weight: 500;
|
|
||||||
color: #646cff;
|
|
||||||
text-decoration: inherit;
|
|
||||||
}
|
|
||||||
a:hover {
|
|
||||||
color: #535bf2;
|
|
||||||
}
|
|
@ -4,83 +4,13 @@ import { useNavigate } from '@solidjs/router'
|
|||||||
import { Field, useFormHandler } from 'solid-form-handler'
|
import { Field, useFormHandler } from 'solid-form-handler'
|
||||||
import { yupSchema } from 'solid-form-handler/yup'
|
import { yupSchema } from 'solid-form-handler/yup'
|
||||||
import { Show, onMount } from 'solid-js'
|
import { Show, onMount } from 'solid-js'
|
||||||
import { styled } from 'solid-styled-components'
|
|
||||||
import * as yup from 'yup'
|
import * as yup from 'yup'
|
||||||
|
import './login.scss'
|
||||||
|
|
||||||
import logo from '@assets/logo-fuware.svg'
|
import logo from '@assets/logo-fuware.svg'
|
||||||
import useAuth from '@hooks/useAuth'
|
import useAuth from '@hooks/useAuth'
|
||||||
import useToast from '@hooks/useToast'
|
import useToast from '@hooks/useToast'
|
||||||
|
|
||||||
const LoginPage = styled('div')`
|
|
||||||
width: 100%;
|
|
||||||
height: 100svh;
|
|
||||||
display: flex;
|
|
||||||
padding-left: 15px;
|
|
||||||
padding-right: 15px;
|
|
||||||
background: #fff url('/images/bg-login.jpg') no-repeat fixed center;
|
|
||||||
background-size: cover;
|
|
||||||
place-items: center;
|
|
||||||
|
|
||||||
.login-wrap {
|
|
||||||
width: 40%;
|
|
||||||
max-width: 500px;
|
|
||||||
min-width: 320px;
|
|
||||||
margin: 0 auto;
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
&:after {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
width: 500px;
|
|
||||||
height: 500px;
|
|
||||||
border-radius: 15px;
|
|
||||||
position: absolute;
|
|
||||||
z-index: 2;
|
|
||||||
top: -120px;
|
|
||||||
left: -285px;
|
|
||||||
background: #10b981;
|
|
||||||
transform: rotate(45deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
width: 500px;
|
|
||||||
height: 500px;
|
|
||||||
border-radius: 15px;
|
|
||||||
position: absolute;
|
|
||||||
z-index: 2;
|
|
||||||
top: -40px;
|
|
||||||
left: -130px;
|
|
||||||
background: #ff6600;
|
|
||||||
transform: rotate(20deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-body {
|
|
||||||
position: relative;
|
|
||||||
z-index: 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
|
||||||
position: relative;
|
|
||||||
z-index: 4;
|
|
||||||
display: block;
|
|
||||||
width: 40%;
|
|
||||||
max-width: 150px;
|
|
||||||
min-width: 100px;
|
|
||||||
margin: 0 auto;
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-box {
|
|
||||||
box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.25);
|
|
||||||
border-radius: 5px;
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
||||||
|
|
||||||
const loginSchema = yup.object({
|
const loginSchema = yup.object({
|
||||||
username: yup.string().required('Username is required'),
|
username: yup.string().required('Username is required'),
|
||||||
password: yup.string().required('Password is required'),
|
password: yup.string().required('Password is required'),
|
||||||
@ -125,7 +55,7 @@ export default function Login() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LoginPage>
|
<div class="login-page">
|
||||||
<div class="card glass card-compact login-wrap shadow-xl">
|
<div class="card glass card-compact login-wrap shadow-xl">
|
||||||
<div class="h-44">
|
<div class="h-44">
|
||||||
<picture class="logo">
|
<picture class="logo">
|
||||||
@ -218,6 +148,6 @@ export default function Login() {
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</LoginPage>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
1
frontend/src/pages/Login/index.js
Normal file
1
frontend/src/pages/Login/index.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
export { default } from './Login'
|
69
frontend/src/pages/Login/login.scss
Normal file
69
frontend/src/pages/Login/login.scss
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
.login-page {
|
||||||
|
width: 100%;
|
||||||
|
height: 100svh;
|
||||||
|
display: flex;
|
||||||
|
padding-left: 15px;
|
||||||
|
padding-right: 15px;
|
||||||
|
background: #fff url('/images/bg-login.jpg') no-repeat fixed center;
|
||||||
|
background-size: cover;
|
||||||
|
place-items: center;
|
||||||
|
|
||||||
|
.login-wrap {
|
||||||
|
width: 40%;
|
||||||
|
max-width: 500px;
|
||||||
|
min-width: 320px;
|
||||||
|
margin: 0 auto;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
content: '';
|
||||||
|
display: block;
|
||||||
|
width: 500px;
|
||||||
|
height: 500px;
|
||||||
|
border-radius: 15px;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 2;
|
||||||
|
top: -120px;
|
||||||
|
left: -285px;
|
||||||
|
background: #10b981;
|
||||||
|
transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: '';
|
||||||
|
display: block;
|
||||||
|
width: 500px;
|
||||||
|
height: 500px;
|
||||||
|
border-radius: 15px;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 2;
|
||||||
|
top: -40px;
|
||||||
|
left: -130px;
|
||||||
|
background: #ff6600;
|
||||||
|
transform: rotate(20deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-body {
|
||||||
|
position: relative;
|
||||||
|
z-index: 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
position: relative;
|
||||||
|
z-index: 4;
|
||||||
|
display: block;
|
||||||
|
width: 40%;
|
||||||
|
max-width: 150px;
|
||||||
|
min-width: 100px;
|
||||||
|
margin: 0 auto;
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-box {
|
||||||
|
box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.25);
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user