{"id":15089011,"url":"https://github.com/bartzalewski/marketplace","last_synced_at":"2026-01-04T21:36:26.764Z","repository":{"id":241398066,"uuid":"806746705","full_name":"bartzalewski/marketplace","owner":"bartzalewski","description":"This project is a simple yet powerful backend system for an online marketplace where users can buy and sell products.","archived":false,"fork":false,"pushed_at":"2024-05-27T20:18:26.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T23:52:39.920Z","etag":null,"topics":["composer","php","stripe"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/bartzalewski.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-05-27T20:17:18.000Z","updated_at":"2024-05-27T20:18:29.000Z","dependencies_parsed_at":"2024-05-28T06:02:44.297Z","dependency_job_id":null,"html_url":"https://github.com/bartzalewski/marketplace","commit_stats":null,"previous_names":["bartzalewski/marketplace"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartzalewski%2Fmarketplace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartzalewski%2Fmarketplace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartzalewski%2Fmarketplace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartzalewski%2Fmarketplace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bartzalewski","download_url":"https://codeload.github.com/bartzalewski/marketplace/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244767801,"owners_count":20507110,"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":["composer","php","stripe"],"created_at":"2024-09-25T08:38:41.276Z","updated_at":"2026-01-04T21:36:26.724Z","avatar_url":"https://github.com/bartzalewski.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Online Marketplace Backend\n\nWelcome to the Online Marketplace backend! This project is a simple yet powerful backend system for an online marketplace where users can buy and sell products. It features user registration, product management, and integrated Stripe payment processing.\n\n## Features\n\n- User registration and authentication\n- Product listing and management\n- Stripe payment integration for secure transactions\n- Basic routing and request handling\n\n## Prerequisites\n\nBefore you begin, ensure you have met the following requirements:\n\n- PHP installed on your server (\u003e= 7.2)\n- MySQL database\n- Composer for dependency management\n- A Stripe account for payment processing\n\n## Installation\n\nFollow these steps to set up the project locally:\n\n1. Clone the repository:\n\n   ```sh\n   git clone https://github.com/bartzalewski/marketplace.git\n   ```\n\n2. Navigate to the project directory:\n\n   ```sh\n   cd marketplace\n   ```\n\n3. Install dependencies using Composer:\n\n   ```sh\n   composer install\n   ```\n\n4. Create a MySQL database and import the provided SQL file:\n\n   ```sql\n   CREATE DATABASE marketplace;\n   USE marketplace;\n\n   CREATE TABLE users (\n       id INT AUTO_INCREMENT PRIMARY KEY,\n       username VARCHAR(50) NOT NULL,\n       email VARCHAR(100) NOT NULL,\n       password VARCHAR(255) NOT NULL\n   );\n\n   CREATE TABLE products (\n       id INT AUTO_INCREMENT PRIMARY KEY,\n       user_id INT,\n       name VARCHAR(100) NOT NULL,\n       description TEXT,\n       price DECIMAL(10, 2) NOT NULL,\n       FOREIGN KEY (user_id) REFERENCES users(id)\n   );\n\n   CREATE TABLE transactions (\n       id INT AUTO_INCREMENT PRIMARY KEY,\n       product_id INT,\n       user_id INT,\n       stripe_charge_id VARCHAR(100),\n       amount DECIMAL(10, 2),\n       created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n       FOREIGN KEY (product_id) REFERENCES products(id),\n       FOREIGN KEY (user_id) REFERENCES users(id)\n   );\n   ```\n\n5. Configure the project by editing the `src/config.php` file with your database and Stripe credentials:\n\n   ```php\n   \u003c?php\n   // src/config.php\n   return [\n       'db' =\u003e [\n           'host' =\u003e '127.0.0.1',\n           'dbname' =\u003e 'marketplace',\n           'user' =\u003e 'your_db_user',\n           'password' =\u003e 'your_db_password',\n       ],\n       'stripe' =\u003e [\n           'secret_key' =\u003e 'your_stripe_secret_key',\n           'publishable_key' =\u003e 'your_stripe_publishable_key',\n       ]\n   ];\n   ```\n\n6. Start the PHP built-in server:\n\n   ```sh\n   php -S localhost:8000 -t public\n   ```\n\n7. Open your browser and navigate to `http://localhost:8000`.\n\n## Usage\n\n### User Registration\n\nTo register a new user, send a POST request to `/register` with the following parameters:\n\n- `username`: The username of the new user.\n- `email`: The email address of the new user.\n- `password`: The password for the new user.\n\n### Product Management\n\nTo create a new product, send a POST request to `/products` with the following parameters:\n\n- `user_id`: The ID of the user creating the product.\n- `name`: The name of the product.\n- `description`: A description of the product.\n- `price`: The price of the product.\n\nTo list all products, send a GET request to `/products`.\n\n### Purchase Product\n\nTo purchase a product, send a POST request to `/buy` with the following parameters:\n\n- `product_id`: The ID of the product to be purchased.\n- `user_id`: The ID of the user making the purchase.\n- `stripeToken`: The Stripe token for payment.\n\n## Contributing\n\nContributions are welcome! Please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch (`git checkout -b feature-branch`).\n3. Make your changes.\n4. Commit your changes (`git commit -m 'Add some feature'`).\n5. Push to the branch (`git push origin feature-branch`).\n6. Open a pull request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\nThank you for checking out the Online Marketplace backend!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartzalewski%2Fmarketplace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbartzalewski%2Fmarketplace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartzalewski%2Fmarketplace/lists"}