Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ node_modules/
.DS_Store
.env
.env.local
.cursor

apps/frontend/dist/
apps/frontend/.vite/
apps/backend/.cache/
Expand Down
2 changes: 2 additions & 0 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"langchain": "~0.3.37",
"lib0": "^0.2.95",
"localtunnel": "^2.0.2",
"pdf-lib": "^1.17.1",
"sharp": "^0.34.5",
"tar": "^6.2.1",
"unzipper": "^0.10.14",
"y-protocols": "^1.0.6",
Expand Down
3 changes: 3 additions & 0 deletions apps/backend/src/config/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));

export const REPO_ROOT = path.resolve(__dirname, '..', '..', '..', '..');
export const DATA_DIR = process.env.OPENPRISM_DATA_DIR || path.join(REPO_ROOT, 'data');
const TRANSFER_AGENT_DIR = path.join(REPO_ROOT, 'apps', 'backend', 'src', 'services', 'transferAgent');
/** Venue handbook markdown for transfer agent (neurips.md, acl.md, …) */
export const RULES_DIR = path.join(TRANSFER_AGENT_DIR, 'rules');
export const TEMPLATE_DIR = path.join(REPO_ROOT, 'templates');
export const TEMPLATE_MANIFEST = path.join(TEMPLATE_DIR, 'manifest.json');
export const PORT = Number(process.env.PORT || 8787);
Expand Down
1 change: 1 addition & 0 deletions apps/backend/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const fastify = Fastify({ logger: true });

await fastify.register(cors, { origin: true });
await fastify.register(multipart, {
preservePath: true,
limits: {
fileSize: 200 * 1024 * 1024
}
Expand Down
8 changes: 7 additions & 1 deletion apps/backend/src/routes/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,13 @@ export function registerProjectRoutes(fastify) {
const parts = req.parts();
for await (const part of parts) {
if (part.type !== 'file') continue;
const relPath = sanitizeUploadPath(part.filename);
// With preservePath (busboy), filename keeps relative dirs (e.g. figs/a.png).
// Fallback for odd clients: basename-only still works.
const rawRel =
(typeof part.filename === 'string' && part.filename.trim()) ||
(typeof part.filepath === 'string' && part.filepath.trim()) ||
'';
const relPath = sanitizeUploadPath(rawRel);
if (!relPath) continue;
const abs = safeJoin(projectRoot, relPath);
await ensureDir(path.dirname(abs));
Expand Down
Loading