If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

Creating web service

Started by TDSko, Apr 17, 2023, 07:36 AM

Previous topic - Next topic

TDSkoTopic starter

Hi there!
The task at hand is to create a single-page application that can quickly download and display a large amount of data from a database using ajax.

Additionally, there are plans to integrate OAuth, so it would be preferable to have pre-existing solutions for this. As I have no experience with web development, I am unsure which language or framework to use. Currently, I am considering Python, Ruby, and Node.js, but PHP isn't desirable.
Any suggestions you have would be greatly appreciated! Just one quick note - please don't suggest C# as the cost of hosting for it is not feasible.
  •  


orlandouriel

Why do you refuse to utilize php? Although the language has a bad reputation for being accessible, leading to subpar code written by inexperienced individuals, excellent developers are able to achieve great things with it.

Most top-tier Internet services rely on php for their backend, especially since its enhancements in version 5.3 and recent versions have boosted its capabilities. While node.js may be more popular for single-page applications, if you lack web development experience, I would recommend pairing php with javascript. This is a classic approach where php provides the html component, or alternatively php provides json and the client utilizes angularjs to manipulate it.

Personally, I have had no issues with my lightning quick one-page bookmark service on the Internet, which was written utilizing php and javascript (jQuery).
  •  

LaurenShawn

To choose the most suitable language for your project, consider the knowledge of your friends, colleagues, or mentors. Starting from scratch is not ideal, and relying solely on the Toaster's answer may not lead to the perfect solution.

Your task is common, and there are multiple solutions available. Research popular server languages such as PHP, Python, Ruby, and JS, and create a small program in each to evaluate your preference. Since the client Ajax part must be done in JS, it may be simpler to use Node.js for the server portion.
  •  

Crevand

Before, I wrote code in Pearl and became fond of it while working with Java. I navigated through XML data and this method worked for three years.
However, I had to continue using Pearl due to the lack of Java support for executing devices, specifically 60 Linux routers from one provider. The server was a billing system written in Java. I also utilized cpan on Pearl and jakarta axis while programming in Java.
  •  

naizsmile

I would strongly recommend using Node.js with the React framework as the optimal solution for your single-page application (SPA) project that requires quickly downloading and displaying a large amount of data from a database using AJAX, as well as integrating OAuth authentication.

Node.js for the Backend
Node.js is a powerful and versatile JavaScript runtime environment that allows you to run JavaScript on the server-side. This makes it an excellent choice for building the backend of your application, as you can leverage a single language (JavaScript) across both the frontend and backend components. Node.js is known for its speed, scalability, and efficient non-blocking I/O model, making it well-suited for handling large amounts of data and AJAX requests.

For the backend, you can use a lightweight and flexible web framework like Express.js, which provides a robust set of features for building web applications and APIs. Express.js will handle the server-side logic, routing, and the processing of AJAX requests from your React frontend. Additionally, you can utilize Node.js's vast ecosystem of third-party libraries and modules to integrate with your database, handle authentication (including OAuth), and implement other server-side functionalities.

React for the Frontend
React is a highly performant and efficient JavaScript library for building user interfaces. It's a fantastic choice for the frontend of your SPA, as it provides a component-based architecture and a Virtual DOM (dоcument Object Model) that allows for fast and seamless updates to the UI. This is crucial for your requirement of quickly displaying large datasets.

With React, you can build modular and reusable UI components that will efficiently handle the rendering and updating of your data. React's virtual DOM and efficient diffing algorithm ensure that only the necessary parts of the UI are updated, resulting in a smooth and responsive user experience, even when dealing with large amounts of data.

Integrated OAuth Support
One of the key advantages of using Node.js and React is the availability of well-established and mature OAuth libraries and frameworks that can be easily integrated into your application. For example, you can use Passport.js, a popular authentication middleware for Node.js, to handle the OAuth authentication flow. Passport.js provides a wide range of authentication strategies, including OAuth 2.0, making it a reliable and flexible solution for your authentication requirements.

On the React side, you can utilize libraries like react-oauth2 to seamlessly integrate the OAuth functionality into your frontend components, providing a smooth and secure authentication experience for your users.

Scalability and Flexibility
Both Node.js and React are highly scalable and flexible solutions that can accommodate your needs for quickly downloading and displaying large datasets. Node.js's non-blocking I/O model and efficient event-driven architecture allow it to handle a large number of concurrent connections, making it well-suited for your data-intensive application. React's component-based design and virtual DOM also contribute to the overall scalability and maintainability of your frontend application.

Development Ecosystem and Community
Node.js and React both have extensive and active developer communities, providing you with a wealth of resources, libraries, and tools to accelerate your development process. The combination of Node.js and React is a widely adopted stack, with a large number of tutorials, dоcumentation, and community support available. This will ensure that you have the necessary guidance and resources to build your SPA efficiently and effectively.
  •  

najibwatson

I'd recommend considering Node.js, Python, or Ruby for your single-page application. Node.js, being a JavaScript runtime, is well-suited for real-time web applications and has excellent support for OAuth through libraries like Passport.js. Python, with its robust libraries like Django and Flask, can also handle the task efficiently. Ruby, with its Ruby on Rails framework, provides a solid foundation for building web applications.

However, I'd caution against using PHP, considering its security concerns and lack of scalability. C# is also not a feasible option due to hosting costs.
  •  


If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...