This is a web frontend application that interfaces with the PgVector API server. The project supports both development and production deployment modes, with TypeScript for development and compiled JavaScript for production builds.
Before you start, make sure you have the following installed:
- Node.js (version compatible with node:23-bookworm-slim Docker image)
- npm (Node Package Manager)
- Docker (optional, for containerized deployment)
# Navigate to the frontend directory
cd frontend
# Install dependencies
npm installNote: This project uses a custom npm registry. Ensure you have access to the specified registry URL.
Choose one of the following methods to run the application in development mode:
- Build and run the development container:
docker build -t frontend-dev -f Dockerfile . docker run -p 3000:3000 frontend-dev
-
Install dependencies (if not already done):
npm install --registry=https://nexus3.spe.sony.com/repository/npm/
-
Start development server:
npm run dev
-
Access the application:
- Open your browser and navigate to
http://localhost:3000
- Open your browser and navigate to
Choose one of the following methods to deploy the application in production mode:
- Build and run the production container:
docker build -t frontend-prod . docker run -p 3000:3000 frontend-prod
-
Install dependencies for production:
npm ci
Note:
npm ciis recommended for production as it installs from package-lock.json for reproducible builds. -
Build the application:
npm run build
-
Start the production server:
npm run start
-
Access the application:
- The application will be available at
http://localhost:3000
- The application will be available at
Important: Ensure all necessary environment variables are properly configured for your deployment environment before starting the production server.
The Dockerfile in this project is configured to build and run the frontend application. Here's what each step does:
FROM node:23-bookworm-slim- Uses Node.js version 23 on a minimal Debian base imageRUN apt -y update && apt -y upgrade- Updates the system packages for securityRUN npm upgrade -g --registry=...- Updates npm globally using the custom registryWORKDIR /app- Sets the working directory inside the containerADD package.json .- Copies the package.json file to install dependencies first (for better layer caching)RUN npm install --registry=...- Installs project dependencies using the custom registryCOPY . .- Copies all remaining project files into the containerEXPOSE 3000- Exposes port 3000 for the web serverCMD ["npm", "start"]- Runs the application using the start script
Based on the commands referenced in this README, the following npm scripts should be available:
npm run dev- Start development servernpm run build- Build the application for productionnpm run start- Start the production server
Note: The exact Docker configuration and available scripts may vary based on your specific project setup. Refer to
package.jsonfor the complete list of available scripts.
