{"id":18781641,"url":"https://github.com/finzyphinzy/steezehub_backend","last_synced_at":"2026-04-12T05:33:54.923Z","repository":{"id":243268624,"uuid":"811963989","full_name":"FinzyPHINZY/SteezeHub_Backend","owner":"FinzyPHINZY","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-11T04:26:23.000Z","size":18963,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-28T07:49:11.499Z","etag":null,"topics":["backend","express","fullstack","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/FinzyPHINZY.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-06-07T16:55:26.000Z","updated_at":"2024-07-04T04:13:33.000Z","dependencies_parsed_at":"2024-11-07T20:45:26.354Z","dependency_job_id":null,"html_url":"https://github.com/FinzyPHINZY/SteezeHub_Backend","commit_stats":null,"previous_names":["finzyphinzy/steezehub_backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FinzyPHINZY/SteezeHub_Backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FinzyPHINZY%2FSteezeHub_Backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FinzyPHINZY%2FSteezeHub_Backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FinzyPHINZY%2FSteezeHub_Backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FinzyPHINZY%2FSteezeHub_Backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FinzyPHINZY","download_url":"https://codeload.github.com/FinzyPHINZY/SteezeHub_Backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FinzyPHINZY%2FSteezeHub_Backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28133787,"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-12-30T02:00:05.476Z","response_time":64,"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","express","fullstack","nodejs"],"created_at":"2024-11-07T20:32:55.407Z","updated_at":"2025-12-30T23:02:34.728Z","avatar_url":"https://github.com/FinzyPHINZY.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Steezehub Backend\n\n## Description\n\nSteezehub is an online store that handles user authentication, cart operations, product uploads by admins, and fetches available products from the database. The backend is built using Node.js, Express, and MongoDB, following the MVC architecture.\n\nThe frontend code for Steezehub can be found [here](https://github.com/FinzyPHINZY/SteezeHub).\n\n## Installation\n\n### Prerequisites\n\n- Node.js\n- npm (Node Package Manager)\n- MongoDB\n\n### Steps\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone https://github.com/FinzyPHINZY/SteezeHub_Backend.git\n   cd SteezeHub_Backend\n   ```\n\n2. **Install dependencies:**\n\n   ```bash\n   npm install\n   ```\n\n3. **Set up environment variables:**\n\n   Create a `.env` file in the `config` directory with the following variables:\n\n   ```plaintext\n   DATABASE_URI=your_mongodb_uri\n   PORT=8080\n   ```\n\n4. **Run the application:**\n\n   ```bash\n   npm start\n   ```\n\n   The server will start running on `http://localhost:8080`.\n\n## Usage\n\n### Running the Server\n\nTo start the server, use:\n\n```bash\nnpm start\n```\n\n### API Endpoints\n\n#### Home Routes\n\n- **Homepage**\n\n  - `GET /`\n  - **Description**: Renders the homepage.\n\n- **Sign In**\n\n  - `POST /login`\n  - **Description**: User login.\n  - **Request Body**:\n    ```json\n    {\n      \"email\": \"user@example.com\",\n      \"password\": \"userpassword\"\n    }\n    ```\n  - **Response**: JSON with authentication token.\n\n- **Sign Up**\n  - `POST /signup`\n  - **Description**: User registration.\n  - **Request Body**:\n    ```json\n    {\n      \"name\": \"User Name\",\n      \"email\": \"user@example.com\",\n      \"password\": \"userpassword\"\n    }\n    ```\n  - **Response**: JSON with authentication token.\n\n#### Product Routes\n\n- **Fetch All Products**\n\n  - `GET /product/`\n  - **Description**: Fetches all products from the database.\n\n- **Fetch New Collections**\n\n  - `GET /product/newcollections`\n  - **Description**: Fetches the latest collections.\n\n- **Fetch Popular Products for Women**\n\n  - `GET /product/popularwomen`\n  - **Description**: Fetches popular products in the women category.\n\n- **Get Cart Data**\n\n  - `POST /product/getcart`\n  - **Description**: Retrieves cart data for the logged-in user.\n  - **Request Body**: None\n  - **Response**: JSON with cart data.\n\n- **Add Product to Cart**\n\n  - `POST /product/addtocart`\n  - **Description**: Adds a product to the user's cart.\n  - **Request Body**:\n    ```json\n    {\n      \"itemId\": \"product_id\"\n    }\n    ```\n  - **Response**: JSON indicating success.\n\n- **Remove Product from Cart**\n\n  - `POST /product/removefromcart`\n  - **Description**: Removes a product from the user's cart.\n  - **Request Body**:\n    ```json\n    {\n      \"itemId\": \"product_id\"\n    }\n    ```\n  - **Response**: JSON indicating success.\n\n- **Add Product**\n\n  - `POST /product/addProduct`\n  - **Description**: Adds a new product to the database (Admin only).\n  - **Request Body**:\n    ```json\n    {\n      \"name\": \"Product Name\",\n      \"image\": \"Product Image URL\",\n      \"category\": \"Product Category\",\n      \"new_price\": \"New Price\",\n      \"old_price\": \"Old Price\"\n    }\n    ```\n  - **Response**: JSON indicating success.\n\n- **Remove Product**\n  - `POST /product/removeProduct`\n  - **Description**: Removes a product from the database (Admin only).\n  - **Request Body**:\n    ```json\n    {\n      \"id\": \"product_id\"\n    }\n    ```\n  - **Response**: JSON indicating success.\n\n#### Upload Routes\n\n- **Upload Product Image**\n  - `POST /upload`\n  - **Description**: Uploads an image for a product.\n  - **Request**: Multipart/form-data with a single file field named `product`.\n  - **Response**: JSON with the URL of the uploaded image.\n\n## Technologies Used\n\n- **Node.js**\n- **Express**\n- **MongoDB**\n- **Mongoose**\n- **EJS**\n- **JWT (JsonWebToken)**\n- **Multer**\n- **Cloudinary**\n- **dotenv**\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinzyphinzy%2Fsteezehub_backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffinzyphinzy%2Fsteezehub_backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinzyphinzy%2Fsteezehub_backend/lists"}