{"id":21198053,"url":"https://github.com/samedfft2634/stock_api_nodejs","last_synced_at":"2026-05-06T03:34:58.915Z","repository":{"id":233107810,"uuid":"785401939","full_name":"samedfft2634/stock_api_nodejs","owner":"samedfft2634","description":"Stock Api ","archived":false,"fork":false,"pushed_at":"2024-05-08T14:35:45.000Z","size":2920,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T08:45:51.515Z","etag":null,"topics":["cors","express","jwt","mongoose","nodejs"],"latest_commit_sha":null,"homepage":"https://stock-api-nodejs.onrender.com","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/samedfft2634.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-11T20:23:32.000Z","updated_at":"2024-05-08T14:44:22.000Z","dependencies_parsed_at":"2024-04-16T18:03:25.635Z","dependency_job_id":"e9dac579-3997-455e-ba9c-bcf696dff655","html_url":"https://github.com/samedfft2634/stock_api_nodejs","commit_stats":null,"previous_names":["samedfft2634/stock_api_nodejs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/samedfft2634/stock_api_nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samedfft2634%2Fstock_api_nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samedfft2634%2Fstock_api_nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samedfft2634%2Fstock_api_nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samedfft2634%2Fstock_api_nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samedfft2634","download_url":"https://codeload.github.com/samedfft2634/stock_api_nodejs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samedfft2634%2Fstock_api_nodejs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32677931,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["cors","express","jwt","mongoose","nodejs"],"created_at":"2024-11-20T19:47:45.023Z","updated_at":"2026-05-06T03:34:58.885Z","avatar_url":"https://github.com/samedfft2634.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Stock Management System NodeJs\n\nThe Stock Management System is a web application developed to facilitate inventory tracking and management. The backend portion of this application provides a RESTful API server that enables users to manage their stock operations. The API supports functionality related to brands and purchases, among other inventory management features. Users can add, update, delete, and search for stock items. Additionally, they can filter stock items based on different categories and suppliers. The user authentication and authorization system assigns different user roles, each with specific levels of permissions. This ensures secure and effective collaboration among users.\n\n[Stock Management System Live Page](https://myurlfromrender.com)\n\u003cbr\u003e\u003cbr\u003e\nIf you prefer to see Redoc or JSON instead of Swagger, simply replace 'swagger' in the endpoint with 'redoc' or 'json'.\u003cbr\u003e\u003cbr\u003e\n[Swagger Documents](https://stock-management-system-backend.onrender.com/documents/swagger/)\n\n## Project ERD\n![erd](./erd.png)\n\n## Project Skeleton\n```\nStock Management System/\n  ├── index.js          \n  ├── .env\n  ├── public\n  ├    ┣ static\n  ├    ┣ index.html   \n  ├── src\n      ┣ configs\n      ┃ ┗ dbConnection.js\n      ┃ ┣ swagger.json\n      ┣ controllers\n      ┃ ┣ auth.js\n      ┃ ┣ brand.js\n      ┃ ┣ category.js\n      ┃ ┣ firm.js\n      ┃ ┣ product.js\n      ┃ ┣ purchase.js\n      ┃ ┣ sale.js\n      ┃ ┣ token.js\n      ┃ ┗ user.js\n      ┣ helpers\n      ┃ ┣ paswordEncrypte.js\n      ┃ ┣ sendMail.js\n      ┃ ┗ sync.js\n      ┣ middlewares\n      ┃ ┣ authentication.js\n      ┃ ┣ errorHandler.js\n      ┃ ┣ logger.js\n      ┃ ┣ permissions.js\n      ┃ ┣ queryHandler.js\n      ┃ ┗ upload.js\n      ┣ models\n      ┃ ┣ brand.js\n      ┃ ┣ category.js\n      ┃ ┣ firm.js\n      ┃ ┣ product.js\n      ┃ ┣ purchase.js\n      ┃ ┣ sale.js\n      ┃ ┣ token.js\n      ┃ ┗ user.js\n      ┣ routes\n      ┃ ┣ auth.js\n      ┃ ┣ brand.js\n      ┃ ┣ category.js\n      ┃ ┣ document.js\n      ┃ ┣ firm.js\n      ┃ ┣ index.js\n      ┃ ┣ product.js\n      ┃ ┣ purchase.js\n      ┃ ┣ sale.js\n      ┃ ┣ token.js\n      ┃ ┗ user.js\n      \n  ├── swaggerAutogen.js\n  ├── package.json   \n  └── README.md       \n```\n\n## Tech/framework used\n- **Express.js:** Fast and flexible Node.js web application framework.\n- **MongoDB:** Flexible and scalable NoSQL database solution.\n- **Mongoose:** Object Data Modeling (ODM) library for MongoDB.\n- **Logging:** Logging functionality is integrated to track application activities and errors.\n- **Swagger/Redoc:** Documentation is generated using Swagger or Redoc to provide API documentation in an interactive and user-friendly manner.\n- **JSON File Creation:** JSON files are created to store data or configurations for various purposes.\n- **Token-based Authentication:** Token-based authentication mechanism is implemented to ensure secure communication between client and server, enhancing overall application security and user authentication.\n- **Dotenv:** Node.js module used for loading environment variables.\n- **Express-async-errors:** Helper module for asynchronous error handling in Express applications.\n- **CRUD Operations** Users can create, read, update, and delete books from the database.\n- **Middleware** Middleware functions are implemented to handle requests, perform validations, and enhance security.\n- **Morgan** HTTP request logging middleware for Node.js. It generates log files for HTTP requests, providing valuable insights into how your application is functioning by recording details of incoming and outgoing HTTP requests.\n- **Multer** A versatile file upload middleware for Node.js. This package retrieves files from HTTP requests and uploads them to the server. It supports features such as multiple file uploads, file size limits, and file type restrictions.\n- **Nodemailer** A Node.js library for sending emails. Nodemailer simplifies the process of sending emails via an SMTP server. It supports features like email templates, attachments, and HTML formatting.\n\n\n## Getting Started\n\nThis is an example of how you may give instructions on setting up your project locally.\nTo get a local copy up and running follow these simple example steps.\n\n### Prerequisites\n\nThis is an example of how to list things you need to use the software and how to install them.\n\n- npm\n  ```sh\n  npm install npm@latest -g\n  ```\n\n### Installation\n\n_Below is an example of how you can instruct your audience on installing and setting up your app. This template doesn't rely on any external dependencies or services._\n\n1. Clone the repo\n   ```sh\n   git clone https://github.com/samedfft2634/stock_api_nodejs.git\n   ```\n2. Install NPM packages\n   ```sh\n   npm install\n   ```\n3. Create .env file in home directory.\n   ```sh\n   HOST=localhost\n   PORT=8000\n   MONGODB=ENTER YOUR Database adres or local: mongodb://127.0.0.1:27017/stockApi\n   SECRET_KEY=ENTER YOUR random letters and number, for example: jsl78dd9ff6f6s9jkd89Kkfnfd\n   ACCESS_KEY=ENTER YOUR random letters and number, for example: jsl78dd9ff6f6s9jkd89Kkfnfd\n   REFRESH_KEY=ENTER YOUR random letters and number, for example: jsl78dd9ff6f6s9jkd89Kkfnfd\n   PAGE_SIZE=25\n\n   ```\n4. Logs File\n   ```sh\n   You can write:\n   mkdir logs\n   ```\n5. The project is ready, you can start using it now.\n   ```sh\n   You can run:\n   nodemon\n   ```\n\n### IMPORTANT NOTES ! \n\nTo use the application, you can log in with the following email and password \u003cbr\u003e\nemail: admin@site.com \u003cbr\u003e\npassword: aA?123456 \u003cbr\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamedfft2634%2Fstock_api_nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamedfft2634%2Fstock_api_nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamedfft2634%2Fstock_api_nodejs/lists"}