{"id":31923307,"url":"https://github.com/fuellabs/forc.pub","last_synced_at":"2025-10-13T23:49:18.392Z","repository":{"id":228911674,"uuid":"775040075","full_name":"FuelLabs/forc.pub","owner":"FuelLabs","description":"Website for discovering Sway packages and Forc plugins","archived":false,"fork":false,"pushed_at":"2025-10-02T05:05:19.000Z","size":16204,"stargazers_count":2,"open_issues_count":15,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-10-02T07:08:55.312Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://forc-pub.vercel.app","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FuelLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-20T16:46:23.000Z","updated_at":"2025-10-02T05:05:22.000Z","dependencies_parsed_at":"2024-04-24T01:31:02.361Z","dependency_job_id":"70d97440-3729-4911-82a1-2288e9dac293","html_url":"https://github.com/FuelLabs/forc.pub","commit_stats":null,"previous_names":["fuellabs/forc.pub"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FuelLabs/forc.pub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FuelLabs%2Fforc.pub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FuelLabs%2Fforc.pub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FuelLabs%2Fforc.pub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FuelLabs%2Fforc.pub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FuelLabs","download_url":"https://codeload.github.com/FuelLabs/forc.pub/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FuelLabs%2Fforc.pub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017229,"owners_count":26086016,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-13T23:49:13.505Z","updated_at":"2025-10-13T23:49:18.382Z","avatar_url":"https://github.com/FuelLabs.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# forc.pub\n\n[![docs](https://docs.rs/forc/badge.svg)](https://docs.rs/forc/)\n[![discord](https://img.shields.io/badge/chat%20on-discord-orange?\u0026logo=discord\u0026logoColor=ffffff\u0026color=7389D8\u0026labelColor=6A7EC2)](https://discord.gg/xfpK4Pe)\n\nWelcome to the GitHub repository for [forc.pub](https://forc.pub/), the official package registry for the Sway programming language.\n\n## How it Works\n\n`forc.pub` has a simple multi-threaded Rocket backend server which stores and fetches package metadata in a Postgres database. Packages are stored in a dedicated IPFS network, and package metadata is indexed and stored in [forc.pub-index](https://github.com/FuelLabs/forc.pub-index).\n\nThe frontend uses React and TypeScript.\n\n## Forc Documentation\n\nFor user documentation, including installing release builds, see: \u003chttps://docs.fuel.network/docs/forc/\u003e.\n\n## Building from Source\n\nThis section is for local development of `forc.pub`.\n\n### Dependencies and Tools\n\n`forc.pub` is built in Rust and TypeScript. To begin, install the Rust toolchain following instructions at \u003chttps://www.rust-lang.org/tools/install\u003e. Then configure your Rust toolchain to use Rust `stable`:\n\n```sh\nrustup default stable\n```\n\nIf not already done, add the Cargo bin directory to your `PATH` by adding the following line to `~/.profile` and restarting the shell session.\n\n```sh\nexport PATH=\"${HOME}/.cargo/bin:${PATH}\"\n```\n\nYou will also need to install [Node.js](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs).\n\nTo run the application locally, you will need [Docker](https://docs.docker.com/engine/install/) with Docker Compose.\n\nTo connect to the database for development, you may optionally install the [Diesel CLI](https://diesel.rs/guides/getting-started).\n\nDiesel is the Rust ORM used to create and run database migrations. It requires a separate C library called `libpq` to be installed as well.\n\n```sh\n# Mac\nbrew install libpq\n# or Ubuntu/Debian\napt-get install libpq5\n\n# Install diesel CLI\ncargo install diesel_cli --no-default-features --features postgres\n\n# Install cargo-binstall\ncargo install cargo-binstall\n\n# On macOS-arm64, you may need additional rust flags:\nRUSTFLAGS='-L /opt/homebrew/opt/libpq/lib' cargo install diesel_cli --no-default-features --features postgres\n```\n\nSee [docs/database.md](database.md) for more information about working with the database.\n\n### Building the `forc.pub` server\n\nClone the repository and build the Sway toolchain:\n\n```sh\ngit clone git@github.com:FuelLabs/forc.pub.git\ncd forc.pub\ncargo build\n```\n\nConfirm the server built successfully:\n\n```sh\ncargo run --bin forc.pub\n```\n\n### Running the `forc.pub` server\n\nThe easiest way to run the complete application stack locally is using Docker Compose, which will start the database, backend server, and pgAdmin interface.\n\nFirst, set up the environment by creating a `.env.local` file with your configuration. You'll need to add your Pinata test gateway details and Github App env (if testing github login functionality).\n\nNow start all services with:\n\n```sh\n./scripts/start-local-server.sh\n```\n\nThis will start:\n- **PostgreSQL database** on port `${POSTGRES_PORT:-5432}`\n- **Backend server** on port `8080`\n- **pgAdmin** (database admin UI) on port `${PGADMIN_PORT:-5050}`\n\nYou can access:\n- Backend API: http://localhost:8080\n- pgAdmin interface: http://localhost:5050\n\n**Database Access**: When connecting to the database server through pgAdmin, use password in `.env.local` (default: `localpw`).\n\nTo force rebuild the application image:\n\n```sh\n./scripts/start-local-server.sh -f\n```\n\nTo view logs:\n\n```sh\ndocker compose logs -f\n```\n\nTo stop all services:\n\n```sh\ndocker compose down\n```\n\n### Alternative: Running components separately\n\nIf you prefer to run components separately for development:\n\n1. Start just the database and pgAdmin:\n   ```sh\n   docker compose up -d db pgadmin\n   ```\n\n2. Run the backend server locally:\n   ```sh\n   cargo run\n   ```\n\n### Manually trigger the APIs\n\nYou can manually trigger the APIs with curl, for example:\n\n```bash\ncurl -X POST \"http://localhost:8080/upload_project?forc_version=0.66.5\" \\\n  -H \"Content-Type: application/gzip\" \\\n  --data-binary \"@tests/fixtures/sway-project.tgz\"\n```\n\n### Running the Frontend\n\nThe frontend requires npm and node to be installed.\n\n```sh\ncd app\nnpm i\nnpm run build\nnpm start\n```\n\nThis will open http://localhost:3000 in your browser. By default, it will use the local server endpoint, so the local server must be running.\n\n## Architecture diagram\n\n```mermaid\nflowchart TD\n    subgraph \"Frontend Layer\"\n        FE[\"React Frontend\"]:::frontend\n    end\n\n    subgraph \"Backend Layer\"\n        BE[\"Rocket Backend\"]:::backend\n        APIRoutes[\"API Routes\"]:::backend\n        Middleware[\"Middleware (CORS,Auth)\"]:::middleware\n        Handlers[\"Business Logic / Handlers\"]:::handlers\n    end\n\n    subgraph \"Database Layer\"\n        DB[\"Postgres Database\"]:::database\n    end\n\n    subgraph \"External Services\"\n        IPFS[\"IPFS/Pinata\"]:::external\n        GitHub[\"GitHub Auth\"]:::external\n    end\n\n    subgraph \"Deployment/CI-CD\"\n        CI[\"CI/CD Workflows\"]:::deployment\n        Docker[\"Docker Containerization\"]:::deployment\n        Helm[\"Kubernetes Helm Charts\"]:::deployment\n    end\n\n    FE --\u003e|\"RESTAPICalls\"| BE\n    BE --\u003e|\"APIEndpoints\"| APIRoutes\n    APIRoutes --\u003e|\"UsesMiddleware\"| Middleware\n    Middleware --\u003e|\"ExecutesLogic\"| Handlers\n    Handlers --\u003e|\"DBOperations\"| DB\n\n    BE --\u003e|\"IPFSIntegration\"| IPFS\n    BE --\u003e|\"GitHubAuth\"| GitHub\n\n    CI --\u003e|\"TriggersContainerBuild\"| Docker\n    CI --\u003e|\"DeploysViaHelm\"| Helm\n    Docker --\u003e|\"DeploysBackend\"| BE\n    Helm --\u003e|\"OrchestratesBackend\"| BE\n\n    click FE \"https://github.com/fuellabs/forc.pub/tree/master/app/\"\n    click BE \"https://github.com/fuellabs/forc.pub/tree/master/src/\"\n    click DB \"https://github.com/fuellabs/forc.pub/tree/master/migrations/\"\n    click IPFS \"https://github.com/fuellabs/forc.pub/blob/master/src/pinata/mod.rs\"\n    click GitHub \"https://github.com/fuellabs/forc.pub/blob/master/src/github.rs\"\n    click CI \"https://github.com/fuellabs/forc.pub/tree/master/.github/workflows/\"\n    click Docker \"https://github.com/fuellabs/forc.pub/tree/master/deployment/Dockerfile\"\n    click Helm \"https://github.com/fuellabs/forc.pub/blob/master/helm/forc.pub\"\n\n    classDef middleware fill:#475569,stroke:#22d3ee,stroke-width:2px,color:#f8fafc;\n    classDef handlers fill:#475569,stroke:#22d3ee,stroke-width:2px,color:#f8fafc;\n    classDef frontend fill:#334155,stroke:#60a5fa,stroke-width:2px,color:#f8fafc;\n    classDef backend fill:#475569,stroke:#22d3ee,stroke-width:2px,color:#f8fafc;\n    classDef database fill:#334155,stroke:#fcd34d,stroke-width:2px,color:#f8fafc;\n    classDef external fill:#1e293b,stroke:#f472b6,stroke-width:2px,color:#f8fafc;\n    classDef deployment fill:#3f3f46,stroke:#fde047,stroke-width:2px,color:#f8fafc;\n\n    linkStyle default stroke:#22d3ee,stroke-width:2px;\n```\n\n## Contributing\n\nWe are not currently accepting contributions to `forc.pub` as the MVP is still being developed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuellabs%2Fforc.pub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuellabs%2Fforc.pub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuellabs%2Fforc.pub/lists"}