{"id":49222015,"url":"https://github.com/softenrj/bricks-backend","last_synced_at":"2026-04-24T04:06:48.645Z","repository":{"id":343242089,"uuid":"1048446801","full_name":"softenrj/Bricks-backend","owner":"softenrj","description":"Bricks Backend is the secure, cloud-ready service layer that powers Bricks AI – an AI-powered IDE that transforms ideas into functional applications directly in your browser.","archived":false,"fork":false,"pushed_at":"2026-03-23T15:57:37.000Z","size":254,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-24T13:34:16.978Z","etag":null,"topics":["babel","backend","developer-tools","devops","engineering","enterprise","expressjs","firebase","mongodb","nodejs","scheduler","typescript"],"latest_commit_sha":null,"homepage":"https://github.com/softenrj/Bricks-backend","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/softenrj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"Support.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-01T13:06:11.000Z","updated_at":"2026-03-23T15:57:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/softenrj/Bricks-backend","commit_stats":null,"previous_names":["softenrj/bricks-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/softenrj/Bricks-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softenrj%2FBricks-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softenrj%2FBricks-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softenrj%2FBricks-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softenrj%2FBricks-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softenrj","download_url":"https://codeload.github.com/softenrj/Bricks-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softenrj%2FBricks-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32208509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["babel","backend","developer-tools","devops","engineering","enterprise","expressjs","firebase","mongodb","nodejs","scheduler","typescript"],"created_at":"2026-04-24T04:06:47.546Z","updated_at":"2026-04-24T04:06:48.638Z","avatar_url":"https://github.com/softenrj.png","language":"TypeScript","readme":"## 🚀 Bricks Backend\n\n**Bricks Backend** is the secure, cloud-ready service layer that powers **[Bricks AI](https://github.com/softenrj/Bricks)** – an AI-powered IDE that transforms ideas into functional applications directly in your browser.\n\nThis backend was scaffolded with the [`create-rjx`](https://www.npmjs.com/package/create-rjx) tool.\n\nThis repository contains the backend services that handle:\n\n- **Project \u0026 workspace orchestration**\n- **AI code generation and execution pipelines**\n- **Authentication, authorization \u0026 user/session management**\n- **Realtime collaboration \u0026 messaging** _(in active development)_\n- **Secure communication with the browser-based IDE**\n\n\u003e **Feature status**  \n\u003e - **Voice** and **image-based** interactions are **under active development** and not yet considered production-ready.  \n\u003e - **Realtime collaboration** capabilities exposed by this backend are also **evolving** and may be experimental or incomplete depending on your deployment.\n\n\u003e **Note**  \n\u003e The public Bricks frontend lives at **[`softenrj/Bricks`](https://github.com/softenrj/Bricks)**.  \n\u003e This repository provides the backend APIs consumed by that UI.\n\n---\n\n## ✨ High‑Level Overview\n\n- **Domain**: Backend for the Bricks AI IDE and project workspace\n- **Role**: Acts as the single source of truth for projects, sessions, files, and AI operations\n- **Clients**:  \n  - Bricks web IDE (`https://bricks-three-rose.vercel.app`)  \n  - Internal services / automations  \n- **Focus**: Reliability, security, observability, and performance under AI-heavy workloads\n\nAt a high level, Bricks Backend is responsible for:\n\n- **Orchestrating AI requests** (code generation, refactors, explanations, etc.)\n- **Managing project state** (files, versions, snapshots, metadata)\n- **Coordinating real-time collaboration \u0026 events** _(designed, with some features in development)_\n- **Enforcing access control and limits**\n\n---\n\n## 🧱 Core Responsibilities\n\n- **Project Management**\n  - Create, read, update, delete projects and workspaces\n  - Maintain metadata for files, tabs, and editor state\n- **AI Operations**\n  - Handle prompts from the Bricks IDE (text in production; voice and image metadata in development)\n  - Route and track model requests and responses\n  - Persist relevant context for future interactions\n- **Execution \u0026 Preview**\n  - Manage build / run tasks sent from the browser\n  - Stream logs and results back to the client\n- **Collaboration**\n  - Session presence \u0026 document events _(in development)_\n  - Notifications for changes, builds, and AI actions\n- **Security**\n  - User auth \u0026 session validation\n  - Rate limiting and abuse protection\n\n---\n\n## 🏗️ Architecture (Conceptual)\n\nBricks Backend is designed around a **modular, service-oriented architecture**:\n\n- **API Layer**\n  - Exposes REST/JSON (and optionally WebSocket) endpoints\n  - Handles auth, validation, and request shaping\n- **Domain / Application Layer**\n  - Encodes all business rules (projects, sessions, AI workflows)\n  - Orchestrates calls to models, storage, and queues\n- **Infrastructure Layer**\n  - Database \u0026 cache integration\n  - Queueing / background jobs\n  - Logging, metrics, and tracing\n\nThis separation keeps:\n\n- **Domain logic** independent from frameworks\n- **Integrations** (DB, model providers, queues) swappable\n- **Scaling** straightforward when traffic grows\n\n---\n\n## 🔌 API Surface (Typical Patterns)\n\n\u003e **Important**: Exact endpoints and payloads may differ from this description if your local implementation has evolved. Use this section as a conceptual guide.\n\n- **Auth \u0026 Users**\n  - `POST /auth/login`\n  - `POST /auth/logout`\n  - `GET /me`\n- **Projects**\n  - `GET /projects`\n  - `POST /projects`\n  - `GET /projects/:id`\n  - `PATCH /projects/:id`\n  - `DELETE /projects/:id`\n- **Files**\n  - `GET /projects/:id/files`\n  - `PUT /projects/:id/files/:path`\n  - `DELETE /projects/:id/files/:path`\n- **AI / Chat / Actions**\n  - `POST /projects/:id/ai/chat`\n  - `POST /projects/:id/ai/generate`\n  - `POST /projects/:id/ai/refactor`\n- **Execution**\n  - `POST /projects/:id/run`\n  - `GET /projects/:id/logs`\n\nWherever possible:\n\n- Requests are **JSON**.\n- Responses are **JSON**, with consistent shapes for `data`, `error`, and `meta`.\n\n---\n\n## ⚙️ Local Development\n\n### 1. Prerequisites\n\n- **Node.js** (LTS recommended)\n- **npm** or **yarn** (depending on your project setup)\n- Access to any required **API keys**, **database instances**, or **model providers**\n\n### 2. Installation\n\nIn the repository root:\n\n```bash\nnpm install\n# or\nyarn install\n```\n\n### 3. Environment Variables\n\nCreate a `.env` (or `.env.local`) file based on the template (if present), and fill in required values:\n\n- **Authentication**\n  - `JWT_SECRET` or relevant key\n  - Provider secrets (e.g., OAuth, Firebase, etc.)\n- **Database / Storage**\n  - `DATABASE_URL`\n  - `REDIS_URL` or cache connection\n- **AI / Model Providers**\n  - `OPENAI_API_KEY` or equivalent\n  - Any other provider keys\n- **Bricks Frontend Integration**\n  - `BRICKS_FRONTEND_URL` (e.g. `https://bricks-three-rose.vercel.app`)\n\n\u003e **Security reminder**: Never commit `.env` files or secrets to version control.\n\n### 4. Running the Server\n\n```bash\nnpm run dev\n# or\nyarn dev\n```\n\nBy default, the API will be available on something like:\n\n- `http://localhost:PORT` (consult your `package.json` / config for the exact port)\n\n### 5. Running Tests (If Configured)\n\n```bash\nnpm test\n# or\nyarn test\n```\n\n### 6. Docker container Run\n ```bash\n docker run --rm -p 8000:8000 --env-file ./.env.dev bricks-backend:1.0.0\n```\n\n---\n\n## 🔐 Security \u0026 Best Practices\n\n- **Secrets Management**\n  - Use environment variables for all secrets.\n  - Prefer a secrets manager in production (e.g. Vault, cloud provider services).\n- **Auth \u0026 Sessions**\n  - Validate tokens on every request.\n  - Avoid storing sensitive data in JWT payloads.\n- **Input Validation**\n  - Validate request bodies, query params, and headers.\n  - Enforce strict types between frontend and backend.\n- **Rate Limiting**\n  - Apply per-IP and per-user limits for sensitive / AI-heavy endpoints.\n  - Protect login, AI actions, and project write operations.\n\n---\n\n## 🧩 Relation to Bricks Frontend\n\nThis backend is designed to be consumed by the **Bricks** web IDE:\n\n- Frontend repository: **[`softenrj/Bricks`](https://github.com/softenrj/Bricks)**\n- Production app: `https://bricks-three-rose.vercel.app`\n\nTypical frontend → backend flows:\n\n- User signs in → frontend obtains auth token → calls backend APIs\n- User creates or opens a project → backend returns project structure \u0026 metadata\n- User interacts with AI (chat, refactor, generate) → backend orchestrates model calls\n- User runs the project → backend triggers build/run, streams logs and results\n\n---\n\n## 🧪 Environments\n\nTypical environment layout (may vary by deployment):\n\n- **Local** – developer machines\n- **Staging** – for pre-production testing\n- **Production** – live traffic from Bricks users\n\nSuggested practices:\n\n- Use separate databases and credentials per environment.\n- Enable more verbose logging in non-production environments.\n- Keep schema migrations automated and version-controlled.\n\n---\n\n## 🤝 Contributing\n\nIf you are working on Bricks Backend internally or in a trusted environment:\n\n- **Open an issue** (or internal task) before large changes.\n- **Discuss architecture** for significant features or refactors.\n- **Keep documentation up-to-date** when introducing new APIs or breaking changes.\n\nFor the public Bricks frontend, see the contribution guidelines in **[`softenrj/Bricks`](https://github.com/softenrj/Bricks)**.\n\n---\n\n## 📄 License\n\nThis project is licensed under the **Apache License 2.0**.\n\n- **Commercial use**: allowed under the terms of the license.\n- **Modification \u0026 redistribution**: permitted, provided you comply with the license conditions.\n- **Patent rights**: explicitly granted as described in Section 3 of the license.\n\nSee the full license text in the `LICENSE` file or online at **[Apache License 2.0][Apache-2.0]**.\n\n---\n\n## 🧭 Roadmap (Conceptual)\n\nPlanned or potential enhancements:\n\n- **Richer AI workflows**\n  - Multi-step agents and workflows orchestrated server-side\n  - Deeper context windows and project-wide awareness\n- **Enhanced Observability**\n  - Detailed traces for AI calls and project events\n  - Dashboards for performance and error rates\n- **Advanced Collaboration**\n  - Presence, cursors, comments, and review workflows\n  - Time-travel and replay of project history\n\n---\n\n## 💬 Support \u0026 Contact\n\nFor general information about Bricks, visit the main repo:\n\n- **Bricks Frontend \u0026 Project Overview**: **[`softenrj/Bricks`](https://github.com/softenrj/Bricks)**\n\nFor internal teams, follow your usual channels (Slack/Teams/email) to reach the maintainers of this backend.\n\n---\n\n## ❤️ Acknowledgements\n\nBricks Backend is part of the broader **Bricks AI** vision:  \n**Transform ideas → code — instantly**, with a beautiful, collaborative, AI-native developer experience.\n\n[Apache-2.0]: https://www.apache.org/licenses/LICENSE-2.0\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftenrj%2Fbricks-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftenrj%2Fbricks-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftenrj%2Fbricks-backend/lists"}