{"id":26232718,"url":"https://github.com/fahimfba/teebay","last_synced_at":"2026-05-04T13:34:12.905Z","repository":{"id":278784924,"uuid":"933748894","full_name":"FahimFBA/teebay","owner":"FahimFBA","description":"A full-stack web application for buying, selling, and renting products","archived":false,"fork":false,"pushed_at":"2026-03-18T04:16:41.000Z","size":623,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-18T20:35:02.861Z","etag":null,"topics":["apollo","apollo-server","graphql","graphql-server","postgresql","prisma","prisma-orm","react","reactjs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FahimFBA.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":"2025-02-16T15:57:15.000Z","updated_at":"2026-03-18T04:16:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"70d8f3e3-b6e7-4ee0-800a-eb5ff7165774","html_url":"https://github.com/FahimFBA/teebay","commit_stats":null,"previous_names":["fahimfba/teebay"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FahimFBA/teebay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FahimFBA%2Fteebay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FahimFBA%2Fteebay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FahimFBA%2Fteebay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FahimFBA%2Fteebay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FahimFBA","download_url":"https://codeload.github.com/FahimFBA/teebay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FahimFBA%2Fteebay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32609796,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: 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":["apollo","apollo-server","graphql","graphql-server","postgresql","prisma","prisma-orm","react","reactjs"],"created_at":"2025-03-13T00:38:12.980Z","updated_at":"2026-05-04T13:34:12.898Z","avatar_url":"https://github.com/FahimFBA.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Teebay Project\n\nTeebay is a full-stack web application for buying, selling, and renting products. This project uses a React frontend with a Node.js backend, GraphQL API, and PostgreSQL database.\n\n## Table of Contents\n\n- [Teebay Project](#teebay-project)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Tech Stack](#tech-stack)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n  - [Troubleshooting](#troubleshooting)\n    - [Database Setup Issues](#database-setup-issues)\n    - [Product Creation Issues](#product-creation-issues)\n    - [Verifying Data](#verifying-data)\n  - [Database Schema](#database-schema)\n  - [Prisma Schema](#prisma-schema)\n  - [Usage](#usage)\n  - [Current Status](#current-status)\n    - [Product](#product)\n    - [Purchase](#purchase)\n    - [Rent](#rent)\n    - [UI](#ui)\n    - [Future Improvements](#future-improvements)\n  - [Test User](#test-user)\n  - [API Documentation](#api-documentation)\n  - [Screenshots](#screenshots)\n    - [1. Login Page](#1-login-page)\n    - [2. Register Page](#2-register-page)\n    - [3. Logged In Home Page](#3-logged-in-home-page)\n    - [4. Products Page](#4-products-page)\n    - [5. Categorized Products Page](#5-categorized-products-page)\n    - [6. Owned Products Page](#6-owned-products-page)\n    - [7. Rented Products Page](#7-rented-products-page)\n    - [8. Create New Product Page](#8-create-new-product-page)\n    - [9. Create New Product Page Contd.](#9-create-new-product-page-contd)\n    - [10. Product Deletion Page](#10-product-deletion-page)\n    - [11. User Settings Page](#11-user-settings-page)\n    - [12. Buy A Product](#12-buy-a-product)\n    - [13. Create A New Product](#13-create-a-new-product)\n    - [14. Delete A Product](#14-delete-a-product)\n    - [15. Edit A Owned Product](#15-edit-a-owned-product)\n    - [16. Release A Rented Product](#16-release-a-rented-product)\n    - [17. Rent A Product](#17-rent-a-product)\n  - [Contributing](#contributing)\n  - [License](#license)\n\n## Features\n\n- User authentication (register, login, logout)\n- Product management (create, read, update, delete)\n- Buy and sell products\n- Rent products\n- User profile management\n- Responsive design for mobile and desktop\n\n## Tech Stack\n\n- Frontend: React, TypeScript, Vite, Tailwind CSS\n- Backend: Node.js, Express, TypeScript\n- API: GraphQL with Apollo Server\n- Database: PostgreSQL with Prisma ORM\n- Authentication: JSON Web Tokens (JWT)\n\n## Prerequisites\n\nBefore you begin, ensure you have met the following requirements:\n\n- Node.js (v14 or later)\n- npm (v6 or later)\n- PostgreSQL (v12 or later)\n- Git\n\n## Installation\n\n1. Clone the repository:\n   ```\n   git clone https://github.com/FahimFBA/teebay.git\n   cd teebay\n   ```\n\n2. Install backend dependencies:\n   ```\n   cd backend\n   npm install\n   ```\n\n3. Set up the database:\n   - Create a new PostgreSQL database for the project.\n   - Copy the `.env.example` file to `.env` and update the `DATABASE_URL` with your database credentials:\n     ```\n     DATABASE_URL=\"postgresql://username:password@localhost:5432/teebay_db\"\n     ```\n\n4. Set up the database, generate Prisma client, and apply migrations:\n   ```\n   npx prisma generate\n   npx prisma migrate dev\n   ```\n\n   These commands do the following:\n   - `npx prisma generate`: Generates the Prisma client based on your schema\n   - `npx prisma migrate dev`: Applies all pending migrations and creates a new one if there are schema changes\n  \n  \n\u003e [!IMPORTANT]  \n\u003e Always run these commands after pulling new changes or when switching branches to ensure your database schema is up-to-date.\n\n5. Seed the database with initial data:\n   ```\n   npx prisma db seed\n   ```\n\n\u003e[!IMPORTANT]\n\u003e This step is crucial to populate your database with all the necessary data for development and testing.\n\n6. Start the backend server:\n   ```\n   npm run dev\n   ```\n\n7. In a new terminal, install frontend dependencies:\n   ```\n   cd frontend\n   npm install --force\n   ```\n\n8. Start the frontend development server:\n   ```\n   npm run dev\n   ```\n\n9. Access the application in your web browser at `http://localhost:5173` (or the port specified by Vite).\n\n\u003e [!NOTE]\n\u003e Note: If you encounter any issues during the installation process, particularly with database setup or product creation, please refer to the Troubleshooting section below.\n\n## Troubleshooting\n\n### Database Setup Issues\n\nIf you encounter issues during database setup or migration:\n\n1. Ensure your PostgreSQL server is running and the DATABASE_URL in your .env file is correct.\n\n2. If migrations fail, try resetting the database (this will delete all data):\n   ```\n   npx prisma migrate reset\n   ```\n\n3. If the reset doesn't work, manually delete the `prisma/migrations` folder:\n   ```\n   rm -rf prisma/migrations\n   ```\n   (On Windows, use `rmdir /s /q prisma\\migrations`)\n\n4. Then run the migration command again:\n   ```\n   npx prisma migrate dev\n   ```\n\n### Product Creation Issues\n\nIf you're experiencing problems creating new products, such as ID conflicts:\n\n1. Ensure you've run all migrations, especially the one that resets the Product table's auto-increment sequence:\n   ```\n   npx prisma migrate dev\n   ```\n\n2. If the issue persists, try applying the specific migration for resetting the Product sequence:\n   ```\n   npx prisma migrate resolve --applied \"20250227_reset_product_sequence\"\n   npx prisma migrate dev\n   ```\n\n3. If problems continue, check your database using Prisma Studio:\n   ```\n   npx prisma studio\n   ```\n   Verify that the Product table's ID sequence is correct.\n\n4. If none of the above steps resolve the issue, please open an issue on the GitHub repository with details about the error you're encountering.\n\n### Verifying Data\n\nTo confirm that all data has been properly seeded and the database is set up correctly:\n\n1. Use Prisma Studio to view and manage your database:\n   ```\n   npx prisma studio\n   ```\n   This will open Prisma Studio in your default web browser, typically at `http://localhost:5555`.\n\n2. Check the User and Product tables to ensure they contain the expected data.\n\nIf you encounter any unexpected issues not covered here, please refer to the project's issue tracker on GitHub or seek assistance from the project maintainers.\n\n## Database Schema\n\n```mermaid\nerDiagram\n    User {\n        int id PK\n        string email\n        string name\n        string password\n        datetime createdAt\n        datetime updatedAt\n    }\n    Product {\n        int id PK\n        int ownerId FK\n        string name\n        float price\n        float rent\n        int rentedTo\n        datetime createdAt\n        datetime updatedAt\n        string category\n        string productDescription\n    }\n    User ||--o{ Product : owns\n```\n\n## Prisma Schema\n\n```prisma\ngenerator client {\n  provider = \"prisma-client-js\"\n}\n\ndatasource db {\n  provider = \"postgresql\"\n  url      = env(\"DATABASE_URL\")\n}\n\nmodel User {\n  id        Int       @id @default(autoincrement())\n  email     String    @unique\n  name      String?\n  createdAt DateTime  @default(now())\n  updatedAt DateTime  @updatedAt\n  password  String\n  products  Product[]\n}\n\nmodel Product {\n  id                 Int      @id @default(autoincrement())\n  ownerId            Int\n  name               String\n  price              Float\n  rent               Float?\n  rentedTo           Int?\n  createdAt          DateTime @default(now())\n  updatedAt          DateTime @updatedAt\n  category           String\n  productDescription String?\n  owner              User     @relation(fields: [ownerId], references: [id])\n}\n```\n\n## Usage\n\n1. Register a new account or log in with existing credentials.\n2. Browse available products on the home page.\n3. Click on a product to view details, buy, or rent.\n4. To sell a product, click on \"Add Product\" and fill in the required information.\n5. Manage your products and rentals from your user profile.\n\n## Current Status\n\n### Product\n- ✅ Add Product\n- ✅ Read 1 product \n- ✅ Read all products\n- ✅ Delete Product\n- ✅ Edit Product\n- Add product Description (In progress)\n\n### Purchase \n- ✅ Purchase a product\n\n### Rent\n- ✅ Rent a product\n- ✅ Release a product\n\n### UI \n- ✅ Navbar with Auth Features\n- ✅ Debouncing\n\n### Future Improvements\n- Implement toaster notifications for better user feedback\n\n## Test User\n\nFor testing purposes, you can use the following test user credentials:\n\n- ID: 3\n- Email: newuser2@example.com\n- Password: newPassword1234\n\nPlease note that this information is for development and testing purposes only. Do not use these credentials in a production environment.\n\n## API Documentation\n\nThe GraphQL API is available at `http://localhost:4000/graphql`. You can use GraphQL Playground to explore and test the API.\n\nSome example queries and mutations:\n\n```graphql\n# Get all products\nquery {\n  products {\n    id\n    name\n    category\n    price\n    rent\n  }\n}\n\n# Create a new product\nmutation {\n  createProduct(input: {\n    name: \"Example Product\"\n    category: \"ELECTRONICS\"\n    price: 99.99\n    rent: 9.99\n  }) {\n    id\n    name\n    category\n    price\n    rent\n  }\n}\n```\n\nFor a full list of available queries and mutations, refer to the schema in GraphQL Playground.\n\n## Screenshots\n\nHere are some screenshots of the Teebay project in action:\n\n### 1. Login Page\n![Login Page](img/1.png)\n\n### 2. Register Page\n![Register Page](img/2.png)\n\n### 3. Logged In Home Page\n![Logged In Home Page](img/3.png)\n\n### 4. Products Page\n![Products Page](img/4.png)\n\n### 5. Categorized Products Page\n![Categorized Products Page](img/5.png)\n\n### 6. Owned Products Page\n![Owned Products Page](img/6.png)\n\n### 7. Rented Products Page\n![Rented Products Page](img/7.png)\n\n### 8. Create New Product Page\n![Create New Product Page](img/8.png)\n\n### 9. Create New Product Page Contd.\n![Create New Product Page Contd.](img/9.png)\n\n### 10. Product Deletion Page\n![Product Deletion Page](img/10.png)\n\n### 11. User Settings Page\n![User Settings Page](img/11.png)\n\n### 12. Buy A Product\n[https://github.com/user-attachments/assets/1adde507-555e-450a-a4a4-88a2f317cc1f](https://github.com/user-attachments/assets/1adde507-555e-450a-a4a4-88a2f317cc1f)\n\n### 13. Create A New Product\n[https://github.com/user-attachments/assets/45daadd7-aacf-4182-9080-a912ac11437f](https://github.com/user-attachments/assets/45daadd7-aacf-4182-9080-a912ac11437f)\n\n### 14. Delete A Product\n[https://github.com/user-attachments/assets/2cdb3e73-67e0-40b3-8f28-304d7ffcd6a9](https://github.com/user-attachments/assets/2cdb3e73-67e0-40b3-8f28-304d7ffcd6a9)\n\n### 15. Edit A Owned Product\n[https://github.com/user-attachments/assets/debce999-7082-419b-b863-c6d91554e003](https://github.com/user-attachments/assets/debce999-7082-419b-b863-c6d91554e003)\n\n### 16. Release A Rented Product\n[https://github.com/user-attachments/assets/c1cddf43-efbe-4650-8878-9db6111ec5cd](https://github.com/user-attachments/assets/c1cddf43-efbe-4650-8878-9db6111ec5cd)\n\n### 17. Rent A Product\n[https://github.com/user-attachments/assets/75b1379a-c7fd-4272-a5f7-2013123c0869](https://github.com/user-attachments/assets/75b1379a-c7fd-4272-a5f7-2013123c0869)\n\nThese screenshots provide a visual overview of the key features and interfaces of the Teebay project.\n\n## Contributing\n\nContributions to the Teebay project are welcome. Please follow these steps to contribute:\n\n1. Fork the repository\n2. Create a new branch: `git checkout -b feature-branch-name`\n3. Make your changes and commit them: `git commit -m 'Add some feature'`\n4. Push to the branch: `git push origin feature-branch-name`\n5. Create a pull request\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffahimfba%2Fteebay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffahimfba%2Fteebay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffahimfba%2Fteebay/lists"}