{"id":30961668,"url":"https://github.com/foc-fun/foc-fun","last_synced_at":"2026-02-28T05:02:06.661Z","repository":{"id":270443176,"uuid":"874527383","full_name":"foc-fun/foc-fun","owner":"foc-fun","description":"The Starknet App Engine","archived":false,"fork":false,"pushed_at":"2025-08-03T05:16:08.000Z","size":1627,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-03T05:26:45.610Z","etag":null,"topics":["backend","cairo","starknet"],"latest_commit_sha":null,"homepage":"https://foc.fun","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foc-fun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-10-18T01:52:05.000Z","updated_at":"2025-08-03T05:16:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"35b113be-2200-4168-b841-b968fd93877e","html_url":"https://github.com/foc-fun/foc-fun","commit_stats":null,"previous_names":["b-j-roberts/foc-fun","foc-fun/foc-fun"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/foc-fun/foc-fun","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foc-fun%2Ffoc-fun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foc-fun%2Ffoc-fun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foc-fun%2Ffoc-fun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foc-fun%2Ffoc-fun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foc-fun","download_url":"https://codeload.github.com/foc-fun/foc-fun/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foc-fun%2Ffoc-fun/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274689581,"owners_count":25331864,"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-09-11T02:00:13.660Z","response_time":74,"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":["backend","cairo","starknet"],"created_at":"2025-09-11T18:46:30.495Z","updated_at":"2026-02-28T05:01:56.622Z","avatar_url":"https://github.com/foc-fun.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FOC Fun - Starknet App Engine\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"frontend/public/logo/logo-high-res.png\" alt=\"FOC Fun Logo\" width=\"200\" height=\"200\"\u003e\n  \n  \u003cp\u003e\u003cstrong\u003eA platform for deploying and managing smart contracts on the Starknet blockchain\u003c/strong\u003e\u003c/p\u003e\n\n  ![Next.js](https://img.shields.io/badge/Next.js-15.1.7-black?style=flat-square\u0026logo=next.js)\n  ![React](https://img.shields.io/badge/React-19.0.0-61DAFB?style=flat-square\u0026logo=react)\n  ![TypeScript](https://img.shields.io/badge/TypeScript-5.x-3178C6?style=flat-square\u0026logo=typescript)\n  ![Go](https://img.shields.io/badge/Go-1.23.1-00ADD8?style=flat-square\u0026logo=go)\n  ![Cairo](https://img.shields.io/badge/Cairo-2024_07-FF6B35?style=flat-square)\n  ![Starknet](https://img.shields.io/badge/Starknet-Sepolia-29296B?style=flat-square)\n  ![Docker](https://img.shields.io/badge/Docker-Compose-2496ED?style=flat-square\u0026logo=docker)\n  ![PostgreSQL](https://img.shields.io/badge/PostgreSQL-14.11-336791?style=flat-square\u0026logo=postgresql)\n  ![MongoDB](https://img.shields.io/badge/MongoDB-Latest-47A248?style=flat-square\u0026logo=mongodb)\n  ![Redis](https://img.shields.io/badge/Redis-7.2.4-DC382D?style=flat-square\u0026logo=redis)\n\u003c/div\u003e\n\n## Overview\n\nFOC Fun is a comprehensive Starknet App Engine that provides a registry system for contract classes, automated deployment, event indexing, and a web interface for contract interaction. It serves as a platform for developers to deploy and manage smart contracts on the Starknet blockchain with ease.\n\n## Features\n\n- 🔗 **Smart Contract Registry**: Central registry for managing contract classes and deployments\n- 🚀 **Automated Deployment**: Streamlined contract deployment process\n- 📊 **Event Indexing**: Real-time blockchain event monitoring and processing\n- 🌐 **Web Interface**: User-friendly frontend for contract interaction\n- 🔐 **Wallet Integration**: Support for Starknet wallets via Starknet React\n- 📈 **Analytics**: Contract usage tracking and metrics\n\n## Tech Stack\n\n### Frontend\n- **Next.js 15.1.7** with App Router\n- **React 19** with TypeScript\n- **Tailwind CSS** for styling\n- **Starknet React** for blockchain integration\n- **pnpm** package manager\n\n### Backend\n- **Go 1.23.1** REST API server\n- **PostgreSQL 14.11** for structured data\n- **MongoDB** for flexible event storage\n- **Redis 7.2.4** for caching\n- **Apibara** for blockchain indexing\n\n### Smart Contracts\n- **Cairo** (Starknet edition 2024_07)\n- **Scarb** build tool\n- **Starknet Foundry** for testing\n\n### Infrastructure\n- **Docker \u0026 Docker Compose** for development\n- **Kubernetes with Helm** for production deployment\n\n## Quick Start\n\n### Prerequisites\n- Docker and Docker Compose\n- Go 1.23.1+\n- Node.js 18+ with pnpm\n- Scarb (Cairo build tool)\n\n### Development Setup\n\n1. **Clone the repository**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd foc-fun\n   ```\n\n2. **Start all services**\n   ```bash\n   docker-compose up\n   ```\n\n3. **Frontend development** (separate terminal)\n   ```bash\n   cd frontend\n   npm run dev\n   ```\n\n4. **Access the application**\n   - Frontend: http://localhost:3000\n   - Backend API: http://localhost:8080\n\n## Essential Commands\n\n### Development\n```bash\n# Start all services locally\ndocker-compose up\n\n# Frontend development (port 3000)\ncd frontend \u0026\u0026 npm run dev\n\n# Lint and fix frontend code\ncd frontend \u0026\u0026 npm run lint:fix\n\n# Build everything\nmake build\n\n# Run smart contract tests\nmake test\n```\n\n### Building\n```bash\n# Build all components\nmake build\n\n# Individual builds\nmake build-backend     # Go backend\nmake build-frontend    # Next.js frontend  \nmake build-contracts   # Cairo contracts\n\n# Docker builds\nmake docker-build      # Build all Docker images\nmake docker-push       # Push images to registry\n```\n\n### Testing\n```bash\n# Smart contract tests\ncd onchain \u0026\u0026 scarb test\n# or\nmake contracts-test\n\n# Frontend linting\ncd frontend \u0026\u0026 npm run lint\n```\n\n### Deployment\n```bash\n# Kubernetes deployment\nmake helm-install      # Initial deploy\nmake helm-upgrade      # Update deployment\nmake helm-uninstall    # Remove deployment\n```\n\n## Architecture\n\n### Core Components\n\n1. **Registry Contract** (`onchain/src/registry.cairo`): Central smart contract managing class registration, contract deployment, and event tracking\n2. **Backend API** (`backend/cmd/backend/`): REST API server providing endpoints for contract interaction\n3. **Consumer Service** (`backend/cmd/consumer/`): Processes indexed blockchain events from Apibara\n4. **Indexer Service** (`indexer/`): Monitors blockchain for registry events\n5. **Frontend** (`frontend/`): Next.js app for user interaction with contracts\n\n### Key Directories\n\n```\n├── frontend/           # Next.js frontend application\n│   ├── src/app/       # App Router pages\n│   ├── src/components/ # React components\n│   └── src/contract/  # Smart contract interaction logic\n├── backend/           # Go backend services\n│   ├── routes/        # HTTP route handlers\n│   └── indexer/       # Event processing logic\n├── onchain/           # Cairo smart contracts\n│   └── src/           # Contract source files\n├── abis/              # Contract ABI JSON files\n└── indexer/           # Blockchain event indexer\n```\n\n## Environment Configuration\n\nKey environment variables:\n- `FOC_FUN_REGISTRY_CONTRACT`: Registry contract address\n- `POSTGRES_PASSWORD`: Database password\n- `MONGO_URI`: MongoDB connection string\n- `AUTH_TOKEN` / `APIBARA_AUTH_TOKEN`: Apibara authentication\n- `NEXT_PUBLIC_REGISTRY_CONTRACT_ADDRESS`: Frontend registry address\n- `NEXT_PUBLIC_BACKEND_URL`: Backend API URL\n\n## Development Workflow\n\n1. **Smart contract changes**: Edit in `onchain/src/`, run `scarb build` and `scarb test`\n2. **Backend changes**: Edit Go files, rebuild with `make build-backend`\n3. **Frontend changes**: Edit in `frontend/src/`, changes hot-reload in `npm run dev`\n4. **Full stack testing**: Use `docker-compose up` to run all services together\n\n## Contract Deployment\n\nContracts are deployed to Starknet Sepolia testnet. The registry contract address is configured in docker-compose.yml and environment configs.\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Run tests and linting\n5. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Support\n\nFor support and questions, please open an issue in the GitHub repository.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoc-fun%2Ffoc-fun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoc-fun%2Ffoc-fun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoc-fun%2Ffoc-fun/lists"}