Skip to content

Package Proxy is an All in One server that handles Packages for NPM, PyPi, Docker/Containers

License

Notifications You must be signed in to change notification settings

mstmoni7/pkgstore

 
 

Repository files navigation

About

Alin.io Package Store UI

Alin.io pkgstore is a simple NPM and Pypi registry server, which also acts as a proxy to the generic public registries. It is built for easy maintainability and performance.

pkgstore is built with an extendable structure that allows adding more storage backends or databases to keep the package metadata information. Currently, by default, the storage backend is an AWS S3 bucket or Minio Bucket if you have a self-hosted environment.

The database is a simple SQLite file, which is configurable from the environment variable of DATABASE_URL, and it acts as a database type selector based on the given database URL prefix, like if you have a postgresql://... then the database instance will act with a PostgreSQL driver. Otherwise, it will fall back to SQLite. You can see how it's done in docker-compose.yaml file

Alin.io Package Store UI

Running Locally with Go

This is a standard Golang Gin project and all the dependencies are inside go.mod and go.sum files. So you can run it with the following steps:

1. Install Go Dependencies

Command below is going to download Go dependencies and put them inside vendor folder.

go mod download
go mod vendor

2. Build the UI Project

We have a React.js based UI inside ui folder to list the available packages and their versions. You can build the UI project with the following command:

cd ui
npm install
npm run build

This will build the Vite React TypeScript project and will copy all the bundles to the cmd/server/ui folder, which will then get bundled with the Go binary. So that at the end, we should have a single binary with the UI inside it.

3. Run the Project

Finally, after having the UI built and Go dependencies installed, we can run the project with the following command:

go run ./cmd/server

OR, we can just build the final binary and run it:

go build -o pkgstore ./cmd/server

./pkgstore

Running with Docker

We have a docker-compose.yaml file that you can use to run the project with Docker. It will run the following services:

  • pkgstore: The main pkgstore service
  • minio: A self-hosted S3 compatible storage service
  • postgres: A PostgreSQL database service

Note: for Docker-Compose based configuration we are using PostgreSQL database, which makes it easier to run the project with Docker. But you can change the database URL to any other database type, like MySQL, SQLite, etc.

docker-compose build
docker-compose up

About

Package Proxy is an All in One server that handles Packages for NPM, PyPi, Docker/Containers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 73.9%
  • TypeScript 24.3%
  • Other 1.8%