Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- .env +0 -0
- .hfignore +17 -0
- Dockerfile +25 -0
- artifacts/api-server/.env +3 -0
- artifacts/api-server/src/app.ts +19 -0
- artifacts/design-studio/.env +2 -0
- local.db +0 -0
- package.json +2 -0
- pnpm-lock.yaml +0 -0
.env
ADDED
|
File without changes
|
.hfignore
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.agents/
|
| 2 |
+
backups/
|
| 3 |
+
local.db
|
| 4 |
+
**/tmp/
|
| 5 |
+
.replit/
|
| 6 |
+
.local/
|
| 7 |
+
.cache/
|
| 8 |
+
.npm/
|
| 9 |
+
.agents/
|
| 10 |
+
.replitignore
|
| 11 |
+
replit.md
|
| 12 |
+
mock-date.js
|
| 13 |
+
upload_staging/
|
| 14 |
+
# node_modules/ is excluded by default in hf upload if we don't force it,
|
| 15 |
+
# but I'll keep it excluded here to avoid platform mismatch issues.
|
| 16 |
+
# I'll explain to the user that Docker handles this automatically.
|
| 17 |
+
node_modules/
|
Dockerfile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM node:20-slim AS base
|
| 2 |
+
ENV PNPM_HOME="/pnpm"
|
| 3 |
+
ENV PATH="$PNPM_HOME:$PATH"
|
| 4 |
+
RUN corepack enable
|
| 5 |
+
|
| 6 |
+
# Build stage
|
| 7 |
+
FROM base AS build
|
| 8 |
+
COPY . /usr/src/app
|
| 9 |
+
WORKDIR /usr/src/app
|
| 10 |
+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
| 11 |
+
RUN pnpm run build
|
| 12 |
+
|
| 13 |
+
# Final stage
|
| 14 |
+
FROM base
|
| 15 |
+
COPY --from=build /usr/src/app /usr/src/app
|
| 16 |
+
WORKDIR /usr/src/app
|
| 17 |
+
|
| 18 |
+
# Expose port 7860 (Hugging Face default)
|
| 19 |
+
EXPOSE 7860
|
| 20 |
+
ENV PORT=7860
|
| 21 |
+
# Set production environment
|
| 22 |
+
ENV NODE_ENV=production
|
| 23 |
+
|
| 24 |
+
# Start the application
|
| 25 |
+
CMD [ "pnpm", "start" ]
|
artifacts/api-server/.env
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
SUPABASE_URL=https://vfxtkwilyiqgywjfhojj.supabase.co
|
| 2 |
+
SUPABASE_ANON_KEY=sb_publishable_-nlcOh7W7jY_rLoQ_CTgEw_5I-6Lhor
|
| 3 |
+
DATABASE_URL=postgresql://postgres.vfxtkwilyiqgywjfhojj:Mora_13579246810@aws-0-eu-west-1.pooler.supabase.com:5432/postgres
|
artifacts/api-server/src/app.ts
CHANGED
|
@@ -34,8 +34,27 @@ app.use(cors({
|
|
| 34 |
app.use(express.json());
|
| 35 |
app.use(express.urlencoded({ extended: true }));
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
app.use("/api", router);
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
app.use((err: any, req: express.Request, res: express.Response, next: express.NextFunction) => {
|
| 40 |
logger.error(err);
|
| 41 |
res.status(500).json({ error: err.message || "Internal Server Error", stack: err.stack });
|
|
|
|
| 34 |
app.use(express.json());
|
| 35 |
app.use(express.urlencoded({ extended: true }));
|
| 36 |
|
| 37 |
+
import path from "path";
|
| 38 |
+
import { fileURLToPath } from "url";
|
| 39 |
+
|
| 40 |
+
const __filename = fileURLToPath(import.meta.url);
|
| 41 |
+
const __dirname = path.dirname(__filename);
|
| 42 |
+
|
| 43 |
app.use("/api", router);
|
| 44 |
|
| 45 |
+
// Serve static files from the React app
|
| 46 |
+
const frontendDistPath = path.resolve(__dirname, "../../design-studio/dist");
|
| 47 |
+
app.use(express.static(frontendDistPath));
|
| 48 |
+
|
| 49 |
+
// Handle React routing, return all requests to React app
|
| 50 |
+
app.get("*", (req, res, next) => {
|
| 51 |
+
if (req.path.startsWith("/api")) {
|
| 52 |
+
return next();
|
| 53 |
+
}
|
| 54 |
+
res.sendFile(path.join(frontendDistPath, "index.html"));
|
| 55 |
+
});
|
| 56 |
+
|
| 57 |
+
|
| 58 |
app.use((err: any, req: express.Request, res: express.Response, next: express.NextFunction) => {
|
| 59 |
logger.error(err);
|
| 60 |
res.status(500).json({ error: err.message || "Internal Server Error", stack: err.stack });
|
artifacts/design-studio/.env
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
VITE_SUPABASE_URL=https://vfxtkwilyiqgywjfhojj.supabase.co
|
| 2 |
+
VITE_SUPABASE_ANON_KEY=sb_publishable_-nlcOh7W7jY_rLoQ_CTgEw_5I-6Lhor
|
local.db
ADDED
|
Binary file (36.9 kB). View file
|
|
|
package.json
CHANGED
|
@@ -3,7 +3,9 @@
|
|
| 3 |
"version": "0.0.0",
|
| 4 |
"license": "MIT",
|
| 5 |
"scripts": {
|
|
|
|
| 6 |
"build": "pnpm run typecheck && pnpm -r --if-present run build",
|
|
|
|
| 7 |
"typecheck:libs": "tsc --build",
|
| 8 |
"typecheck": "pnpm run typecheck:libs && pnpm -r --filter \"./artifacts/**\" --filter \"./scripts\" --if-present run typecheck"
|
| 9 |
},
|
|
|
|
| 3 |
"version": "0.0.0",
|
| 4 |
"license": "MIT",
|
| 5 |
"scripts": {
|
| 6 |
+
"start": "pnpm -C artifacts/api-server run start",
|
| 7 |
"build": "pnpm run typecheck && pnpm -r --if-present run build",
|
| 8 |
+
|
| 9 |
"typecheck:libs": "tsc --build",
|
| 10 |
"typecheck": "pnpm run typecheck:libs && pnpm -r --filter \"./artifacts/**\" --filter \"./scripts\" --if-present run typecheck"
|
| 11 |
},
|
pnpm-lock.yaml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|