Yurhu commited on
Commit
7f8a1ae
·
verified ·
1 Parent(s): cea6e4d

Initial snapshot upload

Browse files
.github/workflows/pushing_to_hf.yml CHANGED
@@ -1,7 +1,7 @@
1
  name: Sync to Hugging Face Spaces
2
  on:
3
  push:
4
- branches: [main, dev]
5
  workflow_dispatch:
6
 
7
  env:
@@ -19,4 +19,4 @@ jobs:
19
  - name: Push to Space
20
  env:
21
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
22
- run: git push --force https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$HF_SPACE_NAME main
 
1
  name: Sync to Hugging Face Spaces
2
  on:
3
  push:
4
+ branches: [dev]
5
  workflow_dispatch:
6
 
7
  env:
 
19
  - name: Push to Space
20
  env:
21
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
22
+ run: git push --force https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$HF_SPACE_NAME dev
frontend/src/app/components/SubmitForm.js CHANGED
@@ -3,7 +3,7 @@
3
  import { useState } from "react";
4
  import { useRouter } from "next/navigation";
5
  import ErrorMessage from "./ErrorMessage";
6
- import {BACKEND_ADDRESS} from "@/app/resources/ResourcesPaths";
7
  import { Trans } from 'react-i18next';
8
  import BigBlueButton from "./BigBlueButton";
9
  import { useTranslation } from 'react-i18next';
@@ -75,12 +75,12 @@ export default function SubmitForm() {
75
  {t('submit_successTitle')}
76
  </h3>
77
  <p className="mt-2">{t('submit_successMessage')}</p>
78
- <button
79
  className="mt-4 px-4 py-2 rounded-full shadow hover:shadow-md"
80
  onClick={() => router.push(`/results/${submissionId}`)}
81
  >
82
  {t('submit_checkResults')}
83
- </button>
84
  </div>
85
  </div>
86
  );
@@ -145,10 +145,33 @@ export default function SubmitForm() {
145
  />
146
  </div>
147
 
148
- <ErrorMessage condition={requiredVisible}>
149
- ⚠️ Email, display name & ZIP are required.
150
- </ErrorMessage>
151
- {renderModal()}
152
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  </div>
154
- );}
 
 
3
  import { useState } from "react";
4
  import { useRouter } from "next/navigation";
5
  import ErrorMessage from "./ErrorMessage";
6
+ import { BACKEND_ADDRESS } from "@/app/resources/ResourcesPaths";
7
  import { Trans } from 'react-i18next';
8
  import BigBlueButton from "./BigBlueButton";
9
  import { useTranslation } from 'react-i18next';
 
75
  {t('submit_successTitle')}
76
  </h3>
77
  <p className="mt-2">{t('submit_successMessage')}</p>
78
+ <BigBlueButton
79
  className="mt-4 px-4 py-2 rounded-full shadow hover:shadow-md"
80
  onClick={() => router.push(`/results/${submissionId}`)}
81
  >
82
  {t('submit_checkResults')}
83
+ </BigBlueButton>
84
  </div>
85
  </div>
86
  );
 
145
  />
146
  </div>
147
 
148
+ <div className="space-y-2">
149
+ <label htmlFor="zipfile" className="block text-sm font-medium text-gray-700">
150
+ {t('submit_labelZip')}
151
+ </label>
152
+ <input
153
+ id="zipfile"
154
+ type="file"
155
+ accept=".zip"
156
+ onChange={handleFileChange}
157
+ className="border border-gray-300 p-3 rounded-md w-full focus:ring-2 focus:ring-blue-500"
158
+ />
159
+ </div>
160
+
161
+ <ErrorMessage condition={requiredVisible}>
162
+ ⚠️ Email, display name & ZIP are required.
163
+ </ErrorMessage>
164
+
165
+ <button
166
+ onClick={submitResults}
167
+ disabled={isSubmitting}
168
+ className="w-full bg-blue-600 text-white py-3 rounded-xl hover:bg-blue-700 mt-4"
169
+ >
170
+ {isSubmitting ? t('submit_submitting') : t('submit_button')}
171
+ </button>
172
+
173
+ {renderModal()}
174
+ </div>
175
  </div>
176
+ );
177
+ }
push_to_spaces.py CHANGED
@@ -8,5 +8,4 @@ upload_folder(
8
  folder_path=local_dir,
9
  repo_type="space", # Important: this tells HF it's a Space
10
  commit_message="Initial snapshot upload",
11
-
12
  )
 
8
  folder_path=local_dir,
9
  repo_type="space", # Important: this tells HF it's a Space
10
  commit_message="Initial snapshot upload",
 
11
  )
start.sh CHANGED
@@ -1,17 +1,17 @@
1
- #!/bin/sh
2
- # Start FastAPI
3
- echo '🔧 Starting backend...'
4
- uvicorn src.backend.submission_api:app --host 0.0.0.0 --port 8000 &
5
- echo '✅ Backend ready'
6
- ls
7
- # Start Next.js
8
- echo '🚀 Starting frontend'
9
- cd /app/frontend
10
- npm run start -- -p 8001 &
11
- echo '🚀 Frontend ready'
12
- # Start Nginx to reverse proxy
13
- echo "Starting Nginx"
14
- nginx -g "daemon off;"
15
- echo "Nginx ready"
16
-
17
  echo " container ready !"
 
1
+ #!/bin/sh
2
+ # Start FastAPI
3
+ echo '🔧 Starting backend...'
4
+ uvicorn src.backend.submission_api:app --host 0.0.0.0 --port 8000 &
5
+ echo '✅ Backend ready'
6
+ ls
7
+ # Start Next.js
8
+ echo '🚀 Starting frontend'
9
+ cd /app/frontend
10
+ npm run start -- -p 8001 &
11
+ echo '🚀 Frontend ready'
12
+ # Start Nginx to reverse proxy
13
+ echo "Starting Nginx"
14
+ nginx -g "daemon off;"
15
+ echo "Nginx ready"
16
+
17
  echo " container ready !"