Welcome to Server in Orbit, a project designed to simulate a space-bound server environment, exploring innovative ways to handle computation and data transmission between Earth and satellites.
- High Performance: Optimized for efficient data handling and low latency communication.
- Simulation: Model realistic server conditions in space.
- Scalable: Easily adaptable to different computational loads.
- Node.js: Back-end server handling.
- Express: Lightweight and fast framework for managing API requests.
- WebSocket: Real-time, bidirectional communication for efficient data transfer.
- Docker: Containerized environment for easy deployment and scaling.
Follow these steps to get the server running on your local machine or in a containerized environment.
Ensure you have the following installed:
-
Clone the repository:
```bash git clone https://github.com/maia2a/server-in-orbit.git ```
-
Navigate into the project directory:
```bash cd server-in-orbit ```
-
Install dependencies:
```bash npm install ```
To run the server locally:
```bash npm start ```
To run the server in a Docker container:
-
Build the Docker image:
```bash docker build -t server-in-orbit . ```
-
Run the Docker container:
```bash docker run -p 3000:3000 server-in-orbit ```
Customize the server behavior through environment variables:
PORT
: Define the port for the server (default:3000
).SATELLITE_LATENCY
: Simulate satellite latency in milliseconds (default:500
).
Example:
```bash PORT=8080 SATELLITE_LATENCY=700 npm start ```
The server uses WebSockets for real-time communication. To test the WebSocket:
-
Connect to the WebSocket endpoint:
```ws://localhost:3000```
-
Send and receive messages in real-time.
GET /status
: Check server health.POST /data
: Send data to the server.
Run unit tests using:
```bash npm test ```
Feel free to submit pull requests or issues to improve the project. All contributions are welcome! """