Compare commits

..

No commits in common. "main" and "kevin/reviews-page" have entirely different histories.

11 changed files with 117 additions and 170 deletions

View File

@ -1,32 +0,0 @@
name: Build DeguApp backend
on: pull_request
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Node.js and TypeScript
uses: actions/setup-node@v1
with:
node-version: "20.14.0"
- name: npm install
working-directory: api/
run: |
npm install
- name: npm run build
working-directory: api/
run: |
npm run build --if-present
- name: npm run test
working-directory: api/
run: |
npm run test

View File

@ -35,12 +35,7 @@ To get started with DeguApp, follow these steps:
2. Install dependencies:
```bash
# frontend
cd deguapp/frontend
npm install
# backend
cd deguapp/api
cd deguapp
npm install
```
@ -48,6 +43,11 @@ To get started with DeguApp, follow these steps:
5. Open the app in your browser or Android emulator and start exploring!
## Contributing
Contributions are welcome! If you'd like to contribute to DeguApp, please fork the repository and submit a pull request with your changes.
Use the upstream of the project, which can be found at https:/git.filiprojek.cz/fr/deguapp. **GitHub repository is just a mirror!**
## Local builds
### Android
@ -74,24 +74,12 @@ bundletool build-apks --bundle=./frontend/android/app/build/outputs/bundle/relea
bundletool install-apks --apks=./deguapp.apks
```
#### Resources:
### Resources:
- https://github.com/expo/eas-cli/issues/1300
- https://reactnative.dev/docs/signed-apk-android#generating-the-release-aab
### Server
```bash
cd api/
npm i
npm run build
```
## Contributing
Contributions are welcome! If you'd like to contribute to DeguApp, please fork the repository and submit a pull request with your changes.
Use the upstream of the project, which can be found at https:/git.filiprojek.cz/fr/deguapp. **GitHub repository is just a mirror!**
## License
This project is licensed under the GNU GPLv3 License - see the [LICENSE](LICENSE) file for details.

View File

@ -5,9 +5,9 @@ export const router = Router();
router.use("/api/v1", api_v1);
router.get("*", (req: Request, res: Response) => {
res.sendFile(path.join(__dirname, "../public/index.html"));
});
//router.get("*", (req: Request, res: Response) => {
// res.sendFile(path.join(__dirname, "../views/index.html"));
//});
// 404
router.use((req: Request, res: Response) => {

View File

@ -12,7 +12,9 @@
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"assetBundlePatterns": ["**/*"],
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},

View File

@ -18,7 +18,7 @@ export default function BeerAdd() {
const [open, setOpen] = useState(false);
const [items, setItems] = useState([
{ label: "Tank beer", value: "tank" },
{ label: "Keg beer", value: "keg" },
{ label: "Cask beer", value: "cask" },
{ label: "Glass bottle", value: "glass" },
{ label: "Can", value: "can" },
{ label: "PET bottle", value: "pet" },

View File

@ -19,7 +19,7 @@ export default function reviewAdd() {
const [openSourness, setOpenSourness] = useState(false);
const [openAgain, setOpenAgain] = useState(false);
// foam
// pěna
const [itemFoam, setFoamValue] = useState(null);
const [foam, setFoam] = useState([
{
@ -54,11 +54,11 @@ export default function reviewAdd() {
},
]);
// bitter / sweetness
// hořkost / sladkost
const [itemBitter_sweetness, setBitter_sweetnessValue] = useState(null);
const [bitter_sweetness, setBitter_sweetness] = useState([
{
label: "Bitter",
label: "Bad",
value: "1",
icon: () => (
<Image
@ -78,7 +78,7 @@ export default function reviewAdd() {
),
},
{
label: "Sweet",
label: "Excellent",
value: "3",
icon: () => (
<Image
@ -89,7 +89,7 @@ export default function reviewAdd() {
},
]);
// taste
//chuť
const [itemTaste, setTasteValue] = useState(null);
const [taste, setTaste] = useState([
{
@ -199,7 +199,7 @@ export default function reviewAdd() {
},
]);
// sourness
//kyselost
const [itemSourness, setSournessValue] = useState(null);
const [sourness, setSourness] = useState([
{
@ -224,7 +224,7 @@ export default function reviewAdd() {
},
]);
// would again
//dal bych si znovu?
const [itemAgain, setAgainValue] = useState(null);
const [again, setAgain] = useState([
{

View File

@ -90,7 +90,7 @@ export function AuthProvider({ children }) {
});
if (resUser.status != 200) {
throw Error("Username or password is incorrect!");
throw Error("user does not have user data");
}
const userData = await resUser.json();
@ -104,7 +104,7 @@ export function AuthProvider({ children }) {
await storageUtil.setItem(TOKEN_KEY, loginData.data.jwt);
} catch (err) {
console.error("Failed to log in", err);
return { error: true, msg: err };
return { error: true, msg: err.res };
}
}

View File

@ -20,12 +20,8 @@ function LoginPage() {
}
}, [authState.authenticated]);
async function login() {
const res = await onLogin(email, pass);
if (res !== undefined && res.error === true) {
alert(res.msg);
return;
}
function login() {
onLogin(email, pass);
}
return (

View File

@ -16,28 +16,23 @@ function SignupPage() {
const { onSignin } = useAuth();
async function signin() {
if (pass1 != pass2) {
alert("Passwords are not same!");
return;
}
if (pass1 == pass2) {
const res = await onSignin(username, email, pass1);
const data = await res.json();
if (res.status == 400) {
if (data.message == "validation error") {
alert(data.data.message);
if (res.error) {
if (res.msg.message == "validation error") {
alert(res.msg.data.message);
} else {
alert("Something went wrong");
alert(res.msg.message);
}
return;
}
if (res.status == 201) {
if (!res.error) {
alert("You have been successfully registered. Please Log In");
router.replace("/login");
}
return;
}
alert("Passwords are not same!");
}
return (

View File

@ -1,7 +1,7 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"files": {
"ignore": [".expo/", ".vscode/", "node_modules/", "dist/"]
"ignore": [".expo/", ".vscode/", "node_modules/"]
},
"organizeImports": {
"enabled": true

View File

@ -6,9 +6,7 @@
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"build:web": "npx expo export",
"format": "npx @biomejs/biome format --write ."
"web": "expo start --web"
},
"dependencies": {
"@expo/metro-runtime": "~3.2.1",