{"id":17978804,"url":"https://github.com/chandankushwahaa/vibranthive","last_synced_at":"2025-07-14T07:34:44.465Z","repository":{"id":232740870,"uuid":"784320326","full_name":"chandankushwahaa/vibranthive","owner":"chandankushwahaa","description":"Blog App ","archived":false,"fork":false,"pushed_at":"2024-04-19T10:01:46.000Z","size":1272,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T06:51:16.386Z","etag":null,"topics":["cloudflare","hono","postgresql","prisma","reactjs","typescript","zod"],"latest_commit_sha":null,"homepage":"https://vibranthive.vercel.app","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/chandankushwahaa.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}},"created_at":"2024-04-09T16:07:54.000Z","updated_at":"2025-03-19T16:19:18.000Z","dependencies_parsed_at":"2024-04-19T10:50:56.996Z","dependency_job_id":null,"html_url":"https://github.com/chandankushwahaa/vibranthive","commit_stats":null,"previous_names":["chandanck22/vibranthive","chandankushwahaa/vibranthive"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chandankushwahaa/vibranthive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandankushwahaa%2Fvibranthive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandankushwahaa%2Fvibranthive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandankushwahaa%2Fvibranthive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandankushwahaa%2Fvibranthive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chandankushwahaa","download_url":"https://codeload.github.com/chandankushwahaa/vibranthive/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandankushwahaa%2Fvibranthive/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265256042,"owners_count":23735394,"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","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":["cloudflare","hono","postgresql","prisma","reactjs","typescript","zod"],"created_at":"2024-10-29T17:35:12.373Z","updated_at":"2025-07-14T07:34:44.423Z","avatar_url":"https://github.com/chandankushwahaa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vibranthive\nVibranthive is a modern blogging application inspired by platforms like Medium, designed to empower users to share their ideas and stories with the world. \n\n## Tech Stack\n### Frontend\n\n- **React**: A JavaScript library for building user interfaces, providing a flexible and efficient way to create dynamic web applications.\n- **Zod**: A TypeScript-first schema declaration and validation library, enabling robust type checking and validation of frontend data.\n- **TypeScript**: A statically typed superset of JavaScript that enhances code quality, maintainability, and developer productivity.\n- **JWT (JSON Web Tokens):** A standard for securely transmitting information between parties as a JSON object, commonly used for authentication in web applications.\n\n\n### Backend\n- **Cloudflare Workers**: A serverless execution environment that allows you to run JavaScript code at the edge of the Cloudflare network, providing scalable and efficient backend logic. [Hono](https://hono.dev/top)\n- **TypeScript**: Leveraged for backend development as well, ensuring consistent type safety and code integrity across the entire application.\n- **Prisma**: A modern ORM (Object-Relational Mapping) tool that simplifies database access and manipulation, offering type-safe database queries and schema migrations. [Prisma](https://www.prisma.io/)\n- **PostgreSQL**: A powerful open-source relational database management system, chosen for its reliability, scalability, and extensive feature set. [Aiven](https://aiven.io/)\n\n\n## Getting Started\n\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/chandanck22/vibranthive.git\n```\n2. Navigate to the project directory:\n```bash\ncd vibranthive\n```\n3. Install dependencies for both the frontend and backend:\n```bash\ncd frontend\nnpm install\n```\n```bash\ncd ../backend\nnpm install\n```\n4. Create a `.env` and `wrangler.toml` file inside backend.\n\n   - inside `.env` - Use [AIVEN](https://aiven.io/) postgres database\n    ```\n    DATABASE_URL=\"PASTE DATABASE URL\"\n    ```\n    #### Creating Connection Pool\n    - Move to [PRISMA](https://www.prisma.io/data-platform/accelerate) site create a new Project. Click Enable Accelerate.\n    - Under Database Connection String PASTE THE AIVEN DB URL created initially.\n    - Click ENABLE ACCELERATE\n    - Click Generate API KEY\n    - A URL is generated paste inside `wrangler.toml` file \n    \u003e It create a POOL url which we give to our backend not the orginal DB url. It help to connect to our database.\n\n    ```\n    name = \"backend\"\n    compatibility_date = \"2023-12-01\"\n\n    [vars]\n    DATABASE_URL=\"PASTE the PRISMA URL (Connection Pool)\"\n    \n    JWT_SECRET=\"mytoken\"\n    ```\n\n5. Start the `backend` server using Cloudflare Workers:\n\n```bash\nnpm run dev\n```\n6. Start the `frontend` development server:\n```bash\nnpm run dev\n```\n\n- **NOTE** If you make changes in the database i.e `schema.prisma` file you need to migrate using the follwing command to tell the database the the table you had added is been altered.\n```bash\nnpx prisma migrate dev --name init_schema\n```\n- It will generate migration folder inside prisma.\n- And then Generate the prisma client  \n```\nnpx prisma generate --no-engine\n```\n\nAccess in your browser at http://localhost:3000.\n\n\n### To Deploy\n\n```\nnpx wrangler whoami\n```\n```\nnpx wrangler login\n```\n```\nnpm run deploy\n```\n\n\u003e cloudflare worker not take environment variable from `.env` file it takes from `wrangle.toml` file\n\n\u003e - This code snippet demonstrates the usage of Cloudflare Workers and the need for a connection pool when connecting to a database.\n\u003e - Cloudflare Workers create multiple instances distributed throughout the world. When deploying the code, each instance connects to the database, which can be inefficient and potentially overload the database.\n\u003e - To address this issue, it is recommended to use a connection pool. In this code, the `prisma` library is used for managing the connection pool and connecting to the database.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchandankushwahaa%2Fvibranthive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchandankushwahaa%2Fvibranthive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchandankushwahaa%2Fvibranthive/lists"}