Skip to content

Commit 0cc07d2

Browse files
committed
Add Scene Stream Server and Front End
Still working on getting the WebRTC stream connected to test the rest of the flow. Web page is more of a place holder still.
1 parent 31a7207 commit 0cc07d2

File tree

1,641 files changed

+268926
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,641 files changed

+268926
-0
lines changed

SceneStreamServer/.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
npm-debug.log

SceneStreamServer/.idea/.idea.SceneStreamServer.dir/.idea/.gitignore

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SceneStreamServer/.idea/.idea.SceneStreamServer.dir/.idea/encodings.xml

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SceneStreamServer/.idea/.idea.SceneStreamServer.dir/.idea/indexLayout.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SceneStreamServer/.idea/.idea.SceneStreamServer.dir/.idea/jsLibraryMappings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SceneStreamServer/.idea/.idea.SceneStreamServer.dir/.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SceneStreamServer/Dockerfile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM node:18
2+
3+
# Create app directory
4+
WORKDIR /usr/src/app
5+
6+
# Install global dependencies
7+
RUN npm install -g node-pre-gyp
8+
9+
# Install app dependencies
10+
COPY package*.json ./
11+
RUN npm install
12+
13+
# Bundle app source
14+
COPY . .
15+
16+
# Ensure uploads directory exists
17+
RUN mkdir -p uploads
18+
19+
EXPOSE 3000
20+
CMD [ "node", "server.js" ]

SceneStreamServer/Readme.md

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
2+
# Scene Stream Game Streaming and Video Recording
3+
This is a work in progress and may not function fully yet.
4+
5+
This repository contains a Node.js application for uploading images and performing video streaming. This guide will help you set up the project locally on your machine.
6+
7+
## Prerequisites
8+
9+
Before you begin, ensure you have met the following requirements:
10+
11+
- [Node.js](https://nodejs.org/) (including npm)
12+
- [Docker Desktop](https://www.docker.com/products/docker-desktop)
13+
- [Git](https://git-scm.com/)
14+
15+
## Setup Instructions
16+
17+
### 1. Clone the Repository
18+
19+
First, clone the repository to your local machine using Git.
20+
21+
22+
git clone https://github.com/your-username/your-repo.git
23+
cd your-repo
24+
25+
## 2. Install Node.js and npm
26+
If you haven't installed Node.js and npm, download and install them from here. Verify the installation by running:
27+
28+
29+
node --version
30+
npm --version
31+
## 3. Install Dependencies
32+
Navigate to the project directory and install the required Node.js packages:
33+
34+
35+
cd path/to/your/project
36+
npm install
37+
## 4. Set Up MongoDB with Docker
38+
Run MongoDB using Docker. Ensure Docker Desktop is installed and running, then execute the following command to start a MongoDB container:
39+
40+
41+
docker run -d -p 27017:27017 --name mongodb mongo:latest
42+
43+
Verify the MongoDB container is running:
44+
45+
46+
docker ps
47+
## 5. Create Uploads Directory
48+
Ensure the uploads directory exists in your project root. Create it if it does not exist:
49+
50+
51+
mkdir uploads
52+
53+
## 6.Configure Environment Variables (Optional)
54+
If your application requires environment variables, create a .env file in the project root and add your variables. Example:
55+
56+
57+
MONGODB_URI=mongodb://localhost:27017/imageDB
58+
PORT=3000
59+
## 7. Start the Application
60+
Run the Node.js application:
61+
62+
63+
node server.js
64+
The server should now be running at http://localhost:3000.
65+
66+
## 8. Testing the Application
67+
You can use tools like Postman or curl to test the endpoints.
68+
69+
### Upload an Image
70+
Using curl:
71+
72+
73+
curl -X POST http://localhost:3000/upload-image -H "Content-Type: multipart/form-data" -F "image=@path/to/your/image.jpg" -F "event=Sample Event"
74+
Using Postman:
75+
76+
### Create a new POST request.
77+
Set the URL to http://localhost:3000/upload-image.
78+
In the Body section, choose form-data and add the fields:
79+
Key: image, Type: File, Value: (select an image file)
80+
Key: event, Type: Text, Value: Sample Event
81+
Click Send.
82+
Clear Data
83+
Using curl:
84+
85+
86+
curl -X POST http://localhost:3000/clear-data
87+
Using Postman:
88+
89+
Create a new POST request.
90+
Set the URL to http://localhost:3000/clear-data.
91+
Click Send.
92+
## Contributing
93+
If you want to contribute to this project, follow these steps:
94+
95+
Fork the repository.
96+
Create a new branch (git checkout -b feature-branch).
97+
Make your changes and commit them (git commit -m 'Add new feature').
98+
Push to the branch (git push origin feature-branch).
99+
Create a new Pull Request.
100+
License
101+
This project is licensed under the MIT License - see the LICENSE file for details.

SceneStreamServer/docker-compose.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: '3.8'
2+
services:
3+
app:
4+
build: .
5+
ports:
6+
- "3000:3000"
7+
depends_on:
8+
- mongo
9+
volumes:
10+
- ./uploads:/usr/src/app/uploads
11+
mongo:
12+
image: mongo:latest
13+
ports:
14+
- "27018:27017" # Change host port to 27018
15+
volumes:
16+
- mongo-data:/data/db
17+
volumes:
18+
mongo-data:

SceneStreamServer/node_modules/.bin/mime

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SceneStreamServer/node_modules/.bin/mime.cmd

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SceneStreamServer/node_modules/.bin/mime.ps1

+28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SceneStreamServer/node_modules/.bin/mkdirp

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SceneStreamServer/node_modules/.bin/mkdirp.cmd

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SceneStreamServer/node_modules/.bin/mkdirp.ps1

+28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)