Skip to content

Spaceona/spaceona-db-server

Repository files navigation

Spaceona DB Server

Version 1.1.4

Development Instructions

git clone <repo>
npm install
npm run dev
open http://localhost:3000

Testing Instructions

Make changes to isRunning.ts file. Use the command below to run the test suite.

npm run test

Server Application Documentation

This documentation outlines the setup and functionality of a server application integrating Hono for HTTP request handling, Prisma for database interactions, and Firebase Admin for cloud database services. The application is designed to update machine statuses and log actions within a specified environment.

Prerequisites

  • Node.js environment
  • @hono/node-server for serving the application
  • hono for HTTP routes and request handling
  • @prisma/client for database operations
  • firebase-admin for Firebase cloud services
  • Firebase project with Admin SDK setup
  • Environment variable AUTH_TOKEN for authentication

Server Configuration

Configures the server port, either from an environment variable PORT or defaults to 3000. Starts the server and listens for requests on the configured port.

# Database Configuration
DATABASE_URL="file:./data/database.db"

# Authentication Token for Secure Endpoints
AUTH_TOKEN="your_auth_token_here"

# Path to Firebase Admin SDK Configuration File
GOOGLE_APPLICATION_CREDENTIALS="path_to_your_firebase_admin_sdk.json"

# Application Port (default: 3000)
PORT=3000

Deployment

Make these folders: /var/lib/spaceona-db/logs /var/lib/spaceona-db/data

Copy files to current dir One way to do it if you have a .tar.gz for exmaple: mkdir spaceona-db-server && tar -zxvf ./spaceona-db-server.tar.gz -C spaceona-db-server

then do chmod +x ./scripts/install.sh only on first run

.scripts/install.sh

To stop the server: chmod +x ./scripts/stop.sh only on first run

.scripts/stop.sh

To start the server: chmod +x ./scripts/start.sh only on first run

.scripts/start.sh every time you want to start the server (install also starts the server so you don't need to run this)

To update deployment: git pull

chmod +x ./scripts/install.sh only on first run

.scripts/install.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages