The web interface for the LibGSN web repository. Runs on an S3 backend and a PostgreSQL database.
S3_HOSTis the host URL, for examplehttps://abc.digitaloceanspaces.com/.S3_CDN_HOSTis the CDN host URL, for examplehttps://<bucket-name>.<provider>/.S3_ACCESS_KEY_IDis the access key ID.S3_SECRETis the secret key to use the S3 service.S3_REGIONis the bucket region.S3_BUCKET_NAMEis self-explanatory.DATABASE_URLis the URL for the PostgreSQL database. Further information is provided later.CSRF_SECRETis the secret that CSRF cookies will be signed with.COOKIE_SIGNis the secret that session ID cookies will be signed with.
Install the dependencies:
bun installStart the development server with HMR:
bun run devYour application will be available at http://localhost:5173.
Create a production build:
bun run buildThis template includes three Dockerfiles optimized for different package managers:
Dockerfile- for npmDockerfile.pnpm- for pnpmDockerfile.bun- for bun
To build and run using Docker:
# For npm
docker build -t my-app .
# For pnpm
docker build -f Dockerfile.pnpm -t my-app .
# For bun
docker build -f Dockerfile.bun -t my-app .
# Run the container
docker run -p 3000:3000 my-appThe containerized application can be deployed to any platform that supports Docker, including:
- AWS ECS
- Google Cloud Run
- Azure Container Apps
- Digital Ocean App Platform
- Fly.io
- Railway
If you're familiar with deploying Node applications, the built-in app server is production-ready.
Make sure to deploy the output of npm run build
├── package.json
├── package-lock.json (or pnpm-lock.yaml, or bun.lockb)
├── build/
│ ├── client/ # Static assets
│ └── server/ # Server-side code
I'll make a separate folder for the needed SQL scripts soon.
Your S3 should contain index/index.json which follows the following schema:
interface LibGSNIndex {
categories: {
name: string,
key: string,
subjects: {
name: string,
code: string[]
}[]
}[],
doctype: {
name: string,
code: number
}[],
}There should also be an empty files/ directory, which is where the files are stored.
Built with ❤️ using React Router.