kiryha-krysko commited on
Commit
86b487e
·
1 Parent(s): 06bfde8

init neuron

Browse files
Files changed (9) hide show
  1. Dockerfile +0 -26
  2. index.html +0 -15
  3. neuron +1 -0
  4. neuron.py +0 -18
  5. package.json +0 -24
  6. requirements.txt +0 -5
  7. src/App.jsx +0 -41
  8. src/main.jsx +0 -9
  9. vite.config.js +0 -10
Dockerfile DELETED
@@ -1,26 +0,0 @@
1
- # --- Build Frontend ---
2
- FROM node:20 AS build-stage
3
- WORKDIR /frontend
4
- COPY package*.json ./
5
- RUN npm install
6
- COPY . .
7
- RUN npm run build
8
-
9
- # --- Build Backend ---
10
- FROM python:3.10
11
- WORKDIR /app
12
-
13
- # Create a user to avoid permission issues on HF
14
- RUN useradd -m -u 1000 user
15
- USER user
16
- ENV PATH="/home/user/.local/bin:${PATH}"
17
-
18
- COPY --chown=user requirements.txt .
19
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
20
-
21
- # Copy backend code and the built frontend
22
- COPY --chown=user app.py .
23
- COPY --chown=user --from=build-stage /frontend/dist ./dist
24
-
25
- # Port 7860 is the Hugging Face default
26
- CMD ["uvicorn", "neuron:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
index.html DELETED
@@ -1,15 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Neuron | Latent Scene Engine</title>
7
- <style>
8
- body { margin: 0; overflow: hidden; background: #000; }
9
- </style>
10
- </head>
11
- <body>
12
- <div id="root"></div>
13
- <script type="module" src="/src/main.jsx"></script>
14
- </body>
15
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
neuron ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit aa2f2dcaa643c9f247b87eae45928017b5346907
neuron.py DELETED
@@ -1,18 +0,0 @@
1
- from fastapi import FastAPI
2
- from fastapi.staticfiles import StaticFiles
3
- from fastapi.responses import FileResponse
4
- import os
5
-
6
- app = FastAPI()
7
-
8
- # Dummy endpoint for the future Neural Renderer
9
- @app.get("/api/status")
10
- async def status():
11
- return {"status": "Neuron Engine Offline - Waiting for Model"}
12
-
13
- # Serve the React build files
14
- app.mount("/", StaticFiles(directory="dist", html=True), name="static")
15
-
16
- @app.exception_handler(404)
17
- async def not_found_exception_handler(request, exc):
18
- return FileResponse("dist/index.html")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.json DELETED
@@ -1,24 +0,0 @@
1
- {
2
- "name": "neuron-frontend",
3
- "private": true,
4
- "version": "0.0.0",
5
- "type": "module",
6
- "scripts": {
7
- "dev": "vite",
8
- "build": "vite build",
9
- "preview": "vite preview"
10
- },
11
- "dependencies": {
12
- "@react-three/drei": "^9.0.0",
13
- "@react-three/fiber": "^8.0.0",
14
- "react": "^18.2.0",
15
- "react-dom": "^18.2.0",
16
- "three": "^0.160.0"
17
- },
18
- "devDependencies": {
19
- "@types/react": "^18.2.0",
20
- "@types/react-dom": "^18.2.0",
21
- "@vitejs/plugin-react": "^4.2.0",
22
- "vite": "^5.0.0"
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements.txt DELETED
@@ -1,5 +0,0 @@
1
- fastapi
2
- uvicorn
3
- jinja2
4
- python-multipart
5
- torch
 
 
 
 
 
 
src/App.jsx DELETED
@@ -1,41 +0,0 @@
1
- import React from 'react'
2
- import { Canvas } from '@react-three/fiber'
3
- import { Center, Text3D, OrbitControls, Grid } from '@react-three/drei'
4
-
5
- function Scene() {
6
- return (
7
- <>
8
- <color attach="background" args={['#050505']} />
9
- <ambientLight intensity={0.5} />
10
- <pointLight position={[10, 10, 10]} />
11
-
12
- <Center top>
13
- {/* You'll need a JSON font file in your public folder for Text3D,
14
- or just use standard <Text> for now */}
15
- <mesh>
16
- <sphereGeometry args={[0.5, 32, 32]} />
17
- <meshStandardMaterial color="#00f2ff" emissive="#00f2ff" emissiveIntensity={2} />
18
- </mesh>
19
- </Center>
20
-
21
- <Grid infiniteGrid fadeDistance={50} sectionColor="#111" cellColor="#222" />
22
- <OrbitControls makeDefault />
23
- </>
24
- )
25
- }
26
-
27
- export default function App() {
28
- return (
29
- <div style={{ width: '100vw', height: '100vh' }}>
30
- <div style={{
31
- position: 'absolute', top: 20, left: 20, zIndex: 1,
32
- color: 'white', fontFamily: 'monospace', letterSpacing: '4px'
33
- }}>
34
- NEURON // LATENT ENGINE
35
- </div>
36
- <Canvas camera={{ position: [3, 3, 3], fov: 50 }}>
37
- <Scene />
38
- </Canvas>
39
- </div>
40
- )
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/main.jsx DELETED
@@ -1,9 +0,0 @@
1
- import React from 'react'
2
- import ReactDOM from 'react-dom/client'
3
- import App from './App.jsx'
4
-
5
- ReactDOM.createRoot(document.getElementById('root')).render(
6
- <React.StrictMode>
7
- <App />
8
- </React.StrictMode>,
9
- )
 
 
 
 
 
 
 
 
 
 
vite.config.js DELETED
@@ -1,10 +0,0 @@
1
- import { defineConfig } from 'vite'
2
- import react from '@vitejs/plugin-react'
3
-
4
- export default defineConfig({
5
- plugins: [react()],
6
- server: {
7
- host: '0.0.0.0',
8
- port: 5173,
9
- }
10
- })