hiteshchoudhary / apihub Goto Github PK
View Code? Open in Web Editor NEWYour own API Hub to learn and master API interaction. Ideal for frontend, mobile dev and backend developers.
Home Page: https://freeapi.app
License: Other
Your own API Hub to learn and master API interaction. Ideal for frontend, mobile dev and backend developers.
Home Page: https://freeapi.app
License: Other
no option is avaliable in the Swagger UI authorization token
I tried to use localy by clone and npm install it works fine and i can access it via http://localhost:8080. But if i use docker, it wont work on http://localhost:8080 instead it will use the ip of that docker and yes i can access it via http://192.168.1.16:8080. The problem is that when i tried to make api request or like populate the data for todo or ecommerce it will tell me cors error, network failure, http and https stuff. but i think it all realated to the thing is http://localhost:8080 inaccessable
just try to install it using the instruction as in this repo suggest, followw exact same steps:
Docker up and running, can't access locahost:8080 but can access 192.168.1.16:8080
A clear and concise description of what you expected to happen.
A way to make it accessable via localhost:8080 or if not 192.168.1.16:808 shouldn't produce the cors err when fetching data
If applicable, add screenshots to help explain your problem.
Add any other context about the problem here.
Random Products Flutter App
The Random Products App will be built using flutter, and will allow users to browse the different products.
Flutter, Provider
mobile
$ROOT_FOLDER/examples/public/randomproducts/mobile/flutter-provider
Description:
Upon successful login, the user is correctly redirected to the /chat
route. However, if the user manually changes the URL to /login
and then attempts to navigate back to /chat
, the PrivateRoute
component prevents this navigation. This behavior occurs because the token
and user
values in AuthContext
are null
for an instance, causing the PrivateRoute
component to redirect the user as if they were not authenticated.
Steps to reproduce:
/chat
route./login
./chat
.Expected behavior:
The user should be able to navigate to /chat
after step 3 since they are already authenticated.
Actual behavior:
The PrivateRoute
component prevents navigation to /chat
because it reads token
and user
as null
.
Additional context:
To develop a social media web application using React.js ( with typescript ), Shadcn, Tailwind CSS, and React Redux.
I would like to propose an enhancement to the integration between Husky and commit rules. Currently, the combination of Husky and commit rules (e.g., Commitlint) provides an effective way to enforce commit message conventions, which is great for maintaining consistency and readability in Git repositories. However, I believe there is room for improvement to enhance the user experience and flexibility in configuring commit rules.
I want to work on this issue.
MongoDB connection error: MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://www.mongodb.com/docs/atlas/security-whitelist/
at _handleConnectionErrors (F:\apihub-main\apihub-main\node_modules\mongoose\lib\connection.js:788:11)
at NativeConnection.openUri (F:\apihub-main\apihub-main\node_modules\mongoose\lib\connection.js:763:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async connectDB (file:///F:/apihub-main/apihub-main/src/db/index.js:9:32) {
reason: TopologyDescription {
type: 'ReplicaSetNoPrimary',
servers: Map(3) {
'ac-nodlse8-shard-00-00.iaka6gp.mongodb.net:27017' => [ServerDescription],
'ac-nodlse8-shard-00-02.iaka6gp.mongodb.net:27017' => [ServerDescription],
'ac-nodlse8-shard-00-01.iaka6gp.mongodb.net:27017' => [ServerDescription]
},
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: 'atlas-ppkt0r-shard-0',
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined
}
[nodemon] app crashed - waiting for file changes before starting...
I am getting this error again and again despite checking my ip address and cluster in network access section. I got this several times what to do??? I have tried every possible way to solve this but no results??
I am proposing to add more controllers or API function in the chat-app
I want to add
1.Delete a single message or attachment in one to one chat within 15 mins of creation of the message
2.Upload group Picture by the admins
3.Upload description of groups by the admins
4.Editting the group picture or group description by the admins
5.Deleting messages in a group by the sender within 15 minutes of sending
6.Creating different types of group where only admins can send the messages and attachments and participants can see
This will enhance the chat app experience for the users and also improve the functionality of the chat app like in the professional apps like whatsapp.
@hiteshchoudhary
I would like to start working on the additional api's in the chat app i was trying to make my own chat-app with free api but found those functionalities missing so i would like to add them .
Technologies
No additional technologies other than those that are already being used
No response
Right now FreeApi.app is completely written is JavaScript. TypeScript has become an industry standard nowadays. Having the codebase migrated to TypeScript will benifit the developers to better understand the codebase. TypeScript will benifit the project with better type-safety and tooling and thus it will result in improved code quality and confidence in code refactor.
To incrementally migrate to TypeScript because of it's type-safety and tooling. We can have a discussion below for any better alternatives or reasons as to why not to migrate to TypeScript at all.
I'm not suggesting complete rewrite of the codebase but incremental adoption of TypeScript.
If possible kindly leave this issue open for discussion.
The bug is in the middlewares/verifyJWT in auth.middleware.js file
req.cookies?.accessToken || req.headers("Authorization")?.split(" ")[1];
Code breakdown whenever headers are not present, and ends up with Internal Server Error with a status code of 500.
Steps to reproduce the behavior:
Whenever a "Authorization" header is not present, Server should send Unauthorized request.
Just change the way of accessing the headers.
req.cookies?.accessToken || req.headers["Authorization"]?.split(" ")[1];
Add any other context about the problem here.
Adding chat issue, message in alert - "$lookup with 'pipeline' may not specify 'localField' or 'foreignField'"
{MongoDB connection error: Error: queryTxt ETIMEOUT cluster0.fphzhgd.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (node:internal/dns/promises:275:17) {
errno: undefined,
code: 'ETIMEOUT',
syscall: 'queryTxt',
hostname: 'cluster0.fphzhgd.mongodb.net'
}
[nodemon] app crashed - waiting for file changes before starting...
i countinously getting this error and app creashed
statuscodes
To offer users a comprehensive understanding of various HTTP status codes.
1. Code Lookup:
2. Detailed Explanations:
3. Elegant User Interface:
4. Search and Filter:
5. Examples and Case Studies:
6. Regular Updates:
ReactJs, Zustand, tailwindCss, Shadcn
web
$ROOT_FOLDER/examples/kitchen-sink/statuscodes/web/react-shadcn-tailwind-zustand
[email protected] start
apihub-main-backend-1 | > nodemon -r dotenv/config src/index.js
apihub-main-backend-1 |
apihub-main-backend-1 |
apihub-main-backend-1 | npm ERR! code EACCES
apihub-main-backend-1 | npm ERR! syscall spawn sh
apihub-main-backend-1 | npm ERR!
apihub-main-backend-1 | path /usr/src/freeapi
apihub-main-backend-1 | npm ERR! errno -13
apihub-main-backend-1 | npm ERR! Error: spawn sh EACCES
apihub-main-backend-1 | npm ERR! at ChildProcess._handle.onexit (node:internal/child_process:285:19)
apihub-main-backend-1 | npm ERR! at onErrorNT (node:internal/child_process:483:16)
apihub-main-backend-1 | npm ERR!
apihub-main-backend-1 | at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
apihub-main-backend-1 | npm ERR! Error: spawn sh EACCES
apihub-main-backend-1 | npm ERR!
apihub-main-backend-1 | at ChildProcess._handle.onexit (node:internal/child_process:285:19)
apihub-main-backend-1 | npm ERR! at onErrorNT (node:internal/child_process:483:16)
apihub-main-backend-1 | npm ERR! at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
apihub-main-backend-1 | npm ERR! errno: -13,
apihub-main-backend-1 | npm ERR! code: 'EACCES',
apihub-main-backend-1 | npm ERR! syscall: 'spawn sh',
apihub-main-backend-1 | npm ERR!
apihub-main-backend-1 | path: '/usr/src/freeapi',
apihub-main-backend-1 | npm ERR! spawnargs: [ '-c', 'nodemon -r dotenv/config src/index.js' ],
apihub-main-backend-1 | npm ERR! cmd: 'sh',
apihub-main-backend-1 | npm ERR! args: [ '-c', 'nodemon -r dotenv/config src/index.js' ],
apihub-main-backend-1 | npm ERR! stdout: null,
apihub-main-backend-1 | npm ERR! stderr: null,
apihub-main-backend-1 | npm ERR! event: 'start',
apihub-main-backend-1 | npm ERR! script: 'nodemon -r dotenv/config src/index.js',
apihub-main-backend-1 | npm ERR! pkgid: '[email protected]'
apihub-main-backend-1 | npm ERR! }
apihub-main-backend-1 | npm ERR!
apihub-main-backend-1 | npm ERR! The operation was rejected by your operating system.
apihub-main-backend-1 | npm ERR! It is likely you do not have the permissions to access this file as the current user
apihub-main-backend-1 | npm ERR!
apihub-main-backend-1 | npm ERR!
apihub-main-backend-1 | If you believe this might be a permissions issue, please double-check the
apihub-main-backend-1 | npm ERR!
apihub-main-backend-1 | permissions of the file and its containing directories, or try running
apihub-main-backend-1 | npm ERR! the command again as root/Administrator.
Hi, I just found out that coupons creation endpoint in coupon controllers has a bug, that it accepts startData and expiry date both as of past. Which I think should not be the case.
Just create a coupon with startDate and expiryDate in the past.
Coupons will be created.
Windows 11
22H2
Postman
No response
how can i retrieve user details like the username,email id..as the endpoint http://localhost:8080/api/v1/ecommerce/profile
gives a JSON data like
{
"statusCode": 200,
"data": {
"_id": "6590486f1b1bfe2255627e21",
"firstName": "John",
"lastName": "Doe",
"countryCode": "",
"phoneNumber": "",
"owner": "6590486e1b1bfe2255627e1c",
"createdAt": "2023-12-30T16:42:23.248Z",
"updatedAt": "2023-12-30T16:42:23.248Z",
"__v": 0
},
"message": "User profile fetched successfully",
"success": true
}
now from here how can i fetch the details from the owner Id......as there is no endpoint to fetch details from there
I have a question
Why this project is built with javascript as more projects are adopting typescript why are we not using the same here.
Just for the question.
To upgrade mongoose to version 7.3.3 or later
Package version that currently in use is vulnerable to Prototype Pollution. Mongoose has fixed this in their release of 7.3.3
The mongoose.Schema() function is subject to prototype pollution due to the recursively calling of Schema.prototype.add()
function to add new items into the schema object. This vulnerability allows modification of the Object prototype.
Low
Not applicable
Not applicable
We propose enhancing our open-source project by implementing a comprehensive documentation guide for the overall FreeAPI project. This feature request aims to provide users and developers with clear, detailed, and accessible documentation to facilitate easier understanding, implementation, and contribution to the project.
The documentation guide should cover all aspects of the API, including but not limited to:
Imagine a scenario where a new developer or user wants to integrate our API into their project, right now the README.md file provides detailed understanding of the setup and overall project. However, with a comprehensive documentation guide readily available, they can quickly understand the functionalities, endpoints, parameters, authentication methods, and usage examples. This streamlined process encourages adoption and fosters a positive user experience.
No response
We would love to hear from the community if there are any tools available to make this process smooth, more easy and fast.
No response
Hi @wajeshubham , please explain how to work the payment Gateway with Paypal to me.
The searchAvailableUsers
function in chat.controller.js
is currently returning all fields of the user documents from the database, which might include sensitive information. This could potentially lead to a security issue.
Steps to reproduce the behavior:
searchAvailableUsers
function.The function should exclude sensitive fields when querying the database. For instance, if the User
schema includes a password
field, it should not be sent to the client. This can be achieved by adding a $project
stage to the aggregation pipeline to exclude these fields.
Here's the function in question:
const searchAvailableUsers = asyncHandler(async (req, res) => {
const users = await User.aggregate([
{
$match: {
_id: {
$ne: req.user._id, // avoid logged in user
},
},
},
]);
return res
.status(200)
.json(new ApiResponse(200, users, "Users fetched successfully"));
});
Unable to reach the Doc and Setup video through the website .
Here I can't able to get the Cooked in Docs and Setup Video
These Cooked in Docs , Setup video and Featured buttons are not working correctly ......
Please click it to check whether it's working or not
HMart
I would like build an ecommerce application using next.js.
I would like to develop a user friendly e commerce website.
Next.js, React Query
The frontend will run on vercel
examples/apps/ecommerce/nextjs-ts-react-query-playwright
I want to improve the UI design of the project as it's currently not looking cool so I want to do some changes in front end to make page minimal.
Thanks
FreeApi.app as of today doesn't come with any test cases writtern for the application. I want to keep this as a open issue until we reach the goal of 50% coverage in phase 1.
Phase 2 would be to reach min code coverage of 80% for every subsequent release.
We will not be closing this issue until the stated Phases are achieved. Until then all are welcomed to contribute
Features list of single vendor e-commerce admin panel application
No response
No response
I propose the implementation of comprehensive logging for the FreeAPI backend project. The logging should cover both normal application-level logs and detailed API call logs. (Application level logs can be centralized by injecting logger into the error middleware as that is the central place where the errors are being handled)
IMPORTANT:
Our emphasis is not on complex logging by logging each line in the application but rather on strategic logging:
app.js
This enhancement aims to improve the overall observability and debugging capabilities of the FreeAPI backend. With centralized logging, we can efficiently track application activities, monitor errors, and gain insights into API interactions.
Implementing a centralized Morgan middleware for HTTP API calls and integrating Winston for application-level logs can greatly enhance our ability to track, analyze, and troubleshoot issues efficiently.
Winston (for application-level logs):
Morgan (for API call logging):
Medium
Approximately 2-3 days for implementation and integration.
Centralized logging will streamline error handling and provide valuable insights into the FreeAPI backend's behavior. This enhancement aligns with the project's goal of maintaining a robust and easily maintainable codebase.
If you're interested in contributing to the implementation of this feature, feel free to let us know!
help to lot of people they not able pay youtube video api and they want to create a video app
@hiteshchoudhary
hello everyone
I want to contribute video API features.
plese assign video api task me
No response
F:\apihub-main\apihub-main\examples\apps\chat-app\web\react-vite-tailwind>npm run dev
[email protected] dev
vite
'vite' is not recognized as an internal or external command,
operable program or batch file. While following the steps to learn socket.io from freeapi project taught by hitesh sir in english youtube channel, I m getting this thing again and again. Do I need to install the vite again separately? Kindly help anyone.
The App deployment is crashing in both NPM and Docker
Clone the repo
Try to open using Docker
The server should boot up
If applicable, add screenshots to help explain your problem.
Add any other context about the problem here.
Hii, I would like to point out some improvements on how we are syncing the data between the different modules on user creation/update.
Reference:
Problem:
The way we are doing it now it works fine, but it is affecting the user's api response time, as the user have to wait for all the queries to be executed in the post save hook. Besides by using the post save hook we're limiting the scope of using serveral methods such as update , findoneandupdate. see below image.
Suggestion :
I think we can achieve the simillar result by using Mongodb Change Streams. Basically when a change in user collection occurs we can listen for it and do the same data syncing part independently. Thus improving the response time of user's api. And I also believe it will be a better example to the people who will study from this codebase.
Setup Problem
As change streams needs a replica sets or sharded clusters to work. To setup the server locally the contributors will need to have the same. Which can be tough to set up. To handle this we can choose to use the current solution or mongodb change streams based on the Node Env.
Note:
If this suggestion seems reasonable let me know I'll love to contribute on this part. And also a huge round of applause to @hiteshchoudhary for providing us with this repository, you have been a huge inspiration throughout my growing phase as a developer.
I can make some changes to the Dockerfile to make light weight image from it. Please assign this to me.
BUG not able to hit get request for "my profile" in ecommerce app. Response is 401 not authorized, but parameters are not taking any user related input.
A clear and concise description of what the bug is.
go to swagger, ecommerce, get /ecommerce/profile -> returning not authorized as response
Steps to reproduce the behavior:
A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.
Add any other context about the problem here.
Hi, I just found out a use case.
Suppose a user place an order with a specific address (represented by an address object's Mongoose ID). Later, if the user deletes that address and then fetches the order again, the order should still display the original address details associated with that address ID at the time the order was placed, rather than showing the updated address details if the address was later modified.
Just create an order, and delete address that was used for that order, and fetch the same order again by ID
The very first details with which order was placed must be given in the response.
Thanks!
No response
All
No response
Postman
No response
In the file located at /src/routes, a subtle issue has been identified regarding the usage of middleware functions in route definitions. The middleware function, such as userForgotPasswordValidator, is being invoked with parentheses, potentially leading to unexpected behavior. It is recommended to pass middleware functions as references without immediate invocation, aligning with best practices.
Steps to Reproduce:
1- Navigate to /src/routes.
2- Inspect the specific route definitions.
3- Observe that middleware functions like userForgotPasswordValidator are invoked with parentheses.
Expected Result:
Middleware functions should ideally be passed as references without immediate invocation when defining routes to ensure proper execution during the request-response cycle. As per the Express.js documentation: Middleware are functions that have access
to the request object (req), the response object (res), and the next middleware function in the application’s request-response cycle.
Express.js Documentation: https://expressjs.com/en/guide/writing-middleware.html#:~:text=Middleware%20functions%20are%20functions%20that,middleware%20succeeding%20the%20current%20middleware
Actual Result:
The middleware functions are invoked with parentheses during route definition.
Middleware functions often rely on dynamic behavior based on the request context, such as extracting data from the request object. When invoked immediately, these functions may not have access to the request object and may not behave as expected and Invoking the middleware immediately may skip the error-handling logic during route definition.
Relevant Context:
This observation is made within the context of Express.js routing. Invoking middleware functions with parentheses during route definition, even for seemingly small issues, can potentially lead to unforeseen challenges, as middleware functions are designed to execute dynamically during the request-response cycle.
Actual Example:
router
.route("/forgot-password")
.post(userForgotPasswordValidator(), validate, forgotPasswordRequest);
Expected Example:
router
.route("/forgot-password")
.post(userForgotPasswordValidator, validate, forgotPasswordRequest);
Contributor's Note:
I am interested in addressing this issue and plan to work on a solution. I would appreciate any feedback or additional guidance from maintainers and the community as I proceed with the resolution.
@wajeshubham adding items to the cart is not working. show the some Error I want to add any item
=>Error:{
"statusCode": 500,
"data": null,
"success": false,
"errors": [],
"message": "Cannot read properties of null (reading 'items')",
"stack": "TypeError: Cannot read properties of null (reading 'items')\n at
file:///E:/BackEnd/Node%20js/FreeApi_App/apihub/src/controllers/apps/ecommerce/cart.controllers.js:140:29\n at
process.processTicksAndRejections (node: internal/process/task_queues:95:5)"
}
=> Watch the Video Better Understanding of How to Work Add item in cart
=>user add an item is only one it is not right because the user can multiple item cart
=>user add an item only one it is not right because the user can also add multiple items cart. it is some Problem that can be changed
Currently, the application utilizes separate validators for each endpoint that requires validation of MongoDB Ids passed within the route path variable (utlized more frequently) or request body (rarely used).
This approach leads to code duplication violating the DRY (Don't Repeat Yourself) principle. The same validation logic is repeated multiple times for different endpoints, causing maintenance overhead and making the codebase less maintainable (may be).
To address this issue and adhere to the DRY principle, it is recommended to create a common validator function that can handle the validation of MongoDB Ids by accepting the id name as a parameter.
This common validator function can be reused across all endpoints where MongoDB Id validation is needed, reducing the redundant code.
The proposed common validator function should accept an "idName" parameter, which represents the name of the MongoDB Id to be validated in the route path variable or request body. Here's a general outline of the proposed common validator function:
import { body, param } from "express-validator";
/**
*
* @param {string} idName
* @returns ValidationChain[]
* @description A common validator responsible to validate mongodb ids passed in the url's path variable
*/
const mongoIdPathVariableValidator = (idName) => {
return [
param(idName).notEmpty().isMongoId().withMessage(`Invalid ${idName}`),
];
};
/**
*
* @param {string} idName
* @returns ValidationChain[]
* @description A common validator responsible to validate mongodb ids passed in the request body
*/
const mongoIdRequestBodyValidator = (idName) => {
return [body(idName).notEmpty().isMongoId().withMessage(`Invalid ${idName}`)];
};
Create a folder named common
inside the src/validators
folder. Add an index.js
file and add proposed validators inside it.
To validate MongoDB Ids for different endpoints, you can now simply call the mongoIdPathVariableValidator
or mongoIdRequestBodyValidator
functions with the corresponding idName
as a parameter. Here's an example of how to use the common validator function for the three mentioned endpoints:
// Following are the dummy endpoints just for a reference
import {
mongoIdPathVariableValidator,
mongoIdRequestBodyValidator
} from "../route.to.validators";
import { validate } from "../../../validators/validate.js"; // validation middleware
// http://localhost:8080/api/v1/users/:userId
router
.route("/:userId")
.get(
mongoIdPathVariableValidator("userId"),
validate,
getUserById
);
// http://localhost:8080/api/v1/orders/place-order
router
.route("/place-order")
.post(
// to place order user needs to select an address from his/her profile. which client will pass in the request body
mongoIdRequestBodyValidator("addressId"),
validate,
placeOrder
);
By using the mongoIdPathVariableValidator
function, you eliminate the need for separate validator functions for each endpoint and promote code reuse, making the codebase more maintainable and efficient.
The proposed solution provides two common validator functions that significantly reduces code duplication and promotes the DRY principle.
By using this common function, you can easily validate MongoDB Ids for different endpoints without repeating the same validation logic.
Additionally, if there are future changes or improvements to be made in the MongoDB Id validation process, you only need to modify the common validator function, and the changes will automatically apply to all endpoints that use it.
Let's discuss before starting the implementation 🚀
Would like to add a edit message endpoint in the backend of the chat-app and also would like to add the delete message feature in the frontend in the official frontend of the chat-app .
@wajeshubham
User can edit the message they have sent in group chat and one to one chat only messages not attachments
Would like to add the delete message feature in the frontend for user to be able to delete the message will modify the frontend code that is written in react-tailwind that is present in the repo.
No response
No response
Return Request Controller not there
and also in orderModels currentStatus is should be there
currentStatusEnum = ["PENDING" , "SHIPED" , "DELEVERED" , "CENCELLED"]
No response
No response
No response
No response
Error in Dockerfile
configuration after including prepare.js
script for commit-lint.
The issue is due to the absence of prepare.js
file for node prepare.js
command which runs after the package installation step while building the docker image.
However, while running the prepare
command docker hasn't cloned the ROOT
directory which leads to absence of prepare.js
.
prepare.js
file must be available quickly after the package installation step in the Dockerfile
.
Error logs:
$ node prepare.js
#0 27.57 node:internal/modules/cjs/loader:1093
#0 27.57 throw err;
#0 27.57 ^
#0 27.57
#0 27.57 Error: Cannot find module '/usr/src/freeapi/prepare.js'
#0 27.57 at Module._resolveFilename (node:internal/modules/cjs/loader:1090:15)
#0 27.57 at Module._load (node:internal/modules/cjs/loader:934:27)
#0 27.57 at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
#0 27.57 at node:internal/main/run_main_module:23:47 {
#0 27.57 code: 'MODULE_NOT_FOUND',
#0 27.57 requireStack: []
#0 27.57 }
#0 27.57
#0 27.57 Node.js v19.8.1
#0 27.60 error Command failed with exit code 1.
#0 27.61 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
------
failed to solve: process "/bin/sh -c yarn install --pure-lockfile" did not complete successfully: exit code: 1
The URL Access Controller is a new feature aimed at enhancing the security and access control of our application. It allows us to manage and enforce access permissions for specific URLs within our system, ensuring that only authorized users can access certain resources.
Key Functionality:
No response
No response
No response
My application was successfully deployed and I got the following URL
https://freeapi-app-production-a55c.up.railway.app/
I'm trying to fetch the todos by following link
https://freeapi-app-production-a55c.up.railway.app/api/v1/todos
But it is giving me corse issue
Just to be clear I'm using Vue js on frontend side ( Vite Template )
No response
No response
Code:
No response
No response
No response
I'm not used to open source pardon me please if I made any mistake
Thank you
In order to pointout the getPublics method (book,cat,dog,meal,randomjoke,randomproduct,stock), we perform data filtering through search key processing. Upon discovering included keys in the query parameters, we proceed with the entire filterout process and eliminate the keys. Alternatively, we can obtain the paginated payload first, which can greatly enhance performance, and then remove the key.
No response
suggested solution but there can be more cleaner solution just pointing out this we can process lot less data for removing keys
let booksArray = query
? structuredClone(booksJson).filter((book) => {
return (
book.searchInfo?.textSnippet.toLowerCase().includes(query) ||
book.volumeInfo.title?.includes(query) ||
book.volumeInfo.subtitle?.includes(query)
);
})
: structuredClone(booksJson);
//if (inc && inc[0]?.trim()) {
// booksArray = filterObjectKeys(inc, booksArray);
//}
const paginatedResponse = getPaginatedPayload(booksArray, page, limit)
const updatedBooks = inc
? filterObjectKeys(inc, paginatedBooks.data)
: paginatedBooks.data;
return res.status(200).json(
new ApiResponse(
200,
{
...paginatedBooks,
data: updatedBooks,
},
"Books fetched successfully"
)
);
});
No response
Hopefully i submitted issue right way if not please let me know and if provided info is right , i can work on this enhancement
Frontend App Title
E-Shopify
Overview
E-Shopify is a modern online shopping platform built using React.js and Tailwind CSS, offering a sleek and intuitive user interface for seamless shopping experiences.
Detailed Features
User Authentication:
Users can easily register accounts or log in securely to access personalized features and track their orders.
Product Discovery:
Comprehensive search and filter options enable users to discover products effortlessly based on categories, brands, or specifications.
Shopping Cart Management:
Intuitive cart functionality allows users to add, remove, or update items, ensuring a smooth and convenient shopping experience.
Secure Checkout Process:
Multiple payment gateways ensure secure transactions, providing users with various options to complete their purchases with confidence.
Order Tracking:
Users can track their orders in real-time, receiving updates on order status and delivery information for enhanced transparency.
Tech Stack Used
Frontend Framework: React.js
Styling: Tailwind CSS
Built For Platform
E-Shopify is optimized to run on various platforms, providing flexibility and scalability. Hosting options include services like Vercel, Netlify, or traditional web hosting providers.
E-Shopify offers a seamless online shopping experience, combining the power of React.js for dynamic user interfaces and Tailwind CSS for elegant and responsive designs. With its user-friendly features and robust functionality, E-Shopify ensures a delightful shopping journey for every customer.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.