{"id":21135712,"url":"https://github.com/furkan-dogu/stockapi","last_synced_at":"2026-04-12T14:39:20.452Z","repository":{"id":247217053,"uuid":"805477117","full_name":"furkan-dogu/StockAPI","owner":"furkan-dogu","description":"This project is a RESTful API developed using Node.js and Express. The API interacts with a MongoDB database and is documented with Swagger. It supports CRUD operations for auth, user, category, brand, firm, product, purchase, and sale sections, and secures transactions with token and JWT.","archived":false,"fork":false,"pushed_at":"2024-07-07T11:26:21.000Z","size":272,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T06:43:34.767Z","etag":null,"topics":["cors","dotenv","express","express-async-errors","jsonwebtoken","mongodb","mongoose","nodejs","redoc-express","swagger-autogen","swagger-ui-express"],"latest_commit_sha":null,"homepage":"https://stock-api-drab.vercel.app","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/furkan-dogu.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-24T16:57:58.000Z","updated_at":"2024-07-07T11:26:23.000Z","dependencies_parsed_at":"2024-07-07T12:52:04.337Z","dependency_job_id":null,"html_url":"https://github.com/furkan-dogu/StockAPI","commit_stats":null,"previous_names":["furkan-dogu/stockapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkan-dogu%2FStockAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkan-dogu%2FStockAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkan-dogu%2FStockAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkan-dogu%2FStockAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/furkan-dogu","download_url":"https://codeload.github.com/furkan-dogu/StockAPI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243581063,"owners_count":20314163,"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":["cors","dotenv","express","express-async-errors","jsonwebtoken","mongodb","mongoose","nodejs","redoc-express","swagger-autogen","swagger-ui-express"],"created_at":"2024-11-20T06:58:04.908Z","updated_at":"2025-12-31T00:24:49.244Z","avatar_url":"https://github.com/furkan-dogu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stock API\n\nThis project is a RESTful API developed using Node.js and Express. The API interacts with a MongoDB database and is documented with Swagger. It supports CRUD operations for auth, user, category, brand, firm, product, purchase, and sale sections, and secures transactions with token and JWT.\n\n## ERD\n\n![ERD](./erd.png)\n\n## Table of Contents\n\n- [Technologies Used](#technologies-used)\n- [Documentation](#documentation)\n- [Endpoints](#endpoints)\n- [Project Skeleton](#project-skeleton)\n\n## Live Demo\n\n[Stock API](https://stock-api-drab.vercel.app/)\n\n## Technologies Used\n\n- **Node.js**: A JavaScript runtime built on Chrome's V8 JavaScript engine, used for server-side scripting.\n- **Express**: A fast, unopinionated, minimalist web framework for Node.js, used to build the API.\n- **MongoDB**: A NoSQL database for storing application data.\n- **Mongoose**: An Object Data Modeling (ODM) library for MongoDB and Node.js, providing a straightforward, schema-based solution to model application data.\n- **jsonwebtoken**: A library to implement JSON Web Tokens (JWT) for securing API endpoints through token-based authentication.\n- **dotenv**: A module that loads environment variables from a .env file into process.env, allowing for configuration of environment-specific variables.\n- **cors**: A middleware for Express to enable Cross-Origin Resource Sharing (CORS), allowing the API to handle requests from different origins.\n- **express-async-errors**: A middleware to handle errors in async route handlers in Express.\n- **swagger-ui-express**: A library to serve auto-generated Swagger API documentation via an Express route.\n- **swagger-autogen**: A tool to automatically generate Swagger documentation based on JSDoc comments in your code.\n- **redoc-express**: A library to serve the ReDoc documentation for your API.\n\n\n## Documentation\n\n- Swagger UI: [https://stock-api-drab.vercel.app/documents/swagger](https://stock-api-drab.vercel.app/documents/swagger)\n- Redoc: [https://stock-api-drab.vercel.app/documents/redoc](https://stock-api-drab.vercel.app/documents/redoc)\n- JSON Documentation: [https://stock-api-drab.vercel.app/documents/json](https://stock-api-drab.vercel.app/documents/json)\n\n## Endpoints\n\n### Users\n\n- `GET /users`: Lists all users.\n- `POST /users`: Creates a new user.\n- `GET /users/:userId`: Displays a specific user.\n- `PUT /users/:userId`: Updates information of a specific user.\n- `DELETE /users/:userId`: Deletes a specific user.\n\n### Authentication\n\n- `POST /auth/login`: Provides user login.\n- `POST /auth/refresh`: Refreshes the access token using a refresh token to maintain user session.\n- `GET /auth/logout`: Terminates the user session.\n\n### Categories\n\n- `GET /categories`: Lists all blog categories.\n- `POST /categories`: Creates a new blog category.\n- `GET /categories/:categoryId`: Displays a specific blog category.\n- `PUT /categories/:categoryId`: Updates information of a specific blog category.\n- `DELETE /categories/:categoryId`: Deletes a specific blog category.\n\n### Brands\n\n- `GET /brands`: Lists all brands.\n- `POST /brands`: Creates a new brand.\n- `GET /brands/:brandId`: Displays a specific brand.\n- `PUT /brands/:brandId`: Updates information of a specific brand.\n- `DELETE /brands/:brandId`: Deletes a specific brand.\n\n### Firms\n\n- `GET /firms`: Lists all firms.\n- `POST /firms`: Creates a new firm.\n- `GET /firms/:firmId`: Displays a specific firm.\n- `PUT /firms/:firmId`: Updates information of a specific firm.\n- `DELETE /firms/:firmId`: Deletes a specific firm.\n\n### Products\n\n- `GET /products`: Lists all products.\n- `POST /products`: Creates a new product.\n- `GET /products/:productId`: Displays a specific product.\n- `PUT /products/:productId`: Updates information of a specific product.\n- `DELETE /products/:productId`: Deletes a specific product.\n\n### Purchases\n\n- `GET /purchases`: Lists all purchases.\n- `POST /purchases`: Creates a new purchase.\n- `GET /purchases/:purchaseId`: Displays a specific purchase.\n- `PUT /purchases/:purchaseId`: Updates information of a specific purchase.\n- `DELETE /purchases/:purchaseId`: Deletes a specific purchase.\n\n### Sales\n\n- `GET /sales`: Lists all sales.\n- `POST /sales`: Creates a new sale.\n- `GET /sales/:saleId`: Displays a specific sale.\n- `PUT /sales/:saleId`: Updates information of a specific sale.\n- `DELETE /sales/:saleId`: Deletes a specific sale.\n\n## Project Skeleton\n\n```\nStock API (folder) \n│\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│    │     ├── passwordEncrypt.js    \n│    │     └── sync.js \n│    ├── middlewares \n│    │     ├── authentication.js \n│    │     ├── errorHandler.js \n│    │     ├── permissions.js   \n│    │     └── queryHandler.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├── .gitignore\n├── index.js\n├── package-lock.json\n├── package.json\n├── swaggerAutogen.js\n├── vercel.json\n└── README.md\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurkan-dogu%2Fstockapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffurkan-dogu%2Fstockapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurkan-dogu%2Fstockapi/lists"}