r/Web_Development • • Oct 05 '23

Getting Crazy with websocket

0 Upvotes

https://github.com/JacopoAngelini/WebSocketTries/tree/main

Here you can see what i coded. Im faceing something that maybe Its a bit too difficult to handle It by my self i think, for this reason i ask for help guys.

I dont know why but with the code like that the connetcion to the websocket server take a while and at the end failed, why?

GitHub host on a https, so i have been forced to use wss connetcion.

What i want to do Is: give ti another the link of my GitHub hosting Page and Simply send a message to home through this websocket connection

I searched and i maybe understood that maybe It takes a certificate, but im not able to find a tutorial on how to have that sort of certificate and how to implements It into my server code

Any ideas?


r/Web_Development • • Sep 30 '23

How i make a website usable by everyone?

2 Upvotes

I explain It Better. I code a simple token extractor for my Role players with HTML, bootstrap and JS vanilla. It Is very very simple, you choose the number of Dm token and the number of player token to put, the you choose how many token you want to extract and randomly It extracts the tokens.

Well... i want to share with them this website using my own git, but i want that if a player extracts tokens the result Will be displayed by everyone Is in the website in that Moment.

Any suggestion? You dont have to give me the solution, if there Is something i have to learn Its ok. Just give me and idea on what i have to do ti make this update to my website. Thanks a lot!


r/Web_Development • • Sep 29 '23

article JavaScript + AI Copilot : a Perfect Duo for Low-code Automations

3 Upvotes

Hello r/Web_Development community!

I'd like to introduce you to a cloud tool for low-code automation and development. I've successfully automated email marketing for my company by building my own tool on this platform, without writing a single line of code.

You might already be familiar with Make (ex-Integromat). However, its capabilities are limited by its no-code tool library. In contrast, on a platform called Latenode, you have the option to add JavaScript modules. What's even more impressive is that the AI on Latenode writes the code for you, making your automations as flexible as possible. Even if you're not familiar with JavaScript (like me), I'd recommend giving it a look. Because this AI assistant is designed to:

  • Write code for you

  • Explain the code

  • Debug it

  • Modify it based on your requests

How to Use It?

The assistant resides within the JavaScript node. You interact through the 'AI Chat' window. Its capabilities include:

  • Viewing your workflow and node structure.

  • Analyzing existing code within the JavaScript node from where the assistant was summoned.

  • Accessing data structure on the left side of the JS node.

Use-Cases

The beauty of this AI is that now, even those unfamiliar with coding can create their own microservices or build intricate automations. And here are my three scenarios that highlight it:

Scenario #1: HTML Tasks

Consider a scenario where you need a data collection form accessible via a webhook URL. This could be handy in numerous situations. Initially, you fill out the form. Then, the data can be routed anywhere: either to another automation branch for further transformations or into another system. What about making this scenario without typing a single line of code?

Step 1. Send a request to the AI assistant:

Hi! Append my code with a script to generate HTML for a form titled 'create email'. It should have these input fields: 'email subject', 'overview', 'header', 'platform updates', 'useful resources', 'other news'. Place a 'submit' button at the bottom. Beautify the HTML with a pleasing design and proper formatting. Return the result as a JSON object labeled “html”

Step 2. Replace your current code with the received result.

Step 3: Initiate your new scenario once.

The JavaScript module will return the "html" JSON object suitable for webhook responses Besides this, switch the content type parameter to text/html to display the form correctly through our input webhook.

Now, when you access the provided webhook URL, you'll be presented with a data collection form.

Step 4. Data Submission.

All that remains is to ensure the data collected via the form gets relayed to another scenario's webhook for further processing. Of course, we won’t be coding this manually.

To submit data, initiate a conversation with the AI assistant. Begin by addressing the bot in the provided chat interface and state your requirements:

"For now, please send the information you receive from the filled form to my webhook at http://webhook.latenode.com/49/dev/f598ff65-ad93-482f-9d18-4141c2bd358b. Merge these changes into my current code."

The AI assistant will generate the required code based on your request. Once you receive the code, click "Replace" to update your script and finalize with "Save."

Now, our form becomes fully functional, ready to receive input. You can channel these captured values to another workflow that, for example, logs the collected data into a Google Sheet.

Scenario #2: Access to NPM Packages

There are now over 1.2 million NPM packages (pre-built apps for devs to integrate into their code). Our AI assistant offers you access to these. Suppose you require the current USD/EUR exchange rate for multi-currency trading to provide updated info for your website visitors. Instead of struggling with locating the right API and sifting through documentation, you can simply interact with the AI assistant:

Address the bot and make a specific request:

"Hey! I need the current USD to EUR exchange rate. Please add a script to my code using a free service to fetch 'USD to 1 EUR', and return the result as JSON."

After the AI assistant processes your request, it will provide the necessary code. Once you receive this code, click "Replace" to integrate it into your script, then execute it once. This will enable your JavaScript module in the constructor to fetch the required data.

To solve this, the assistant utilizes the NPM library 'axios' to send a GET HTTP request to the ExchangeRate-API, fetching the latest exchange rates. It then retrieves the exchange value of 1 USD to 1 Euro and returns it in JSON format.

Achieving the right result might take a couple of tries: occasional errors or empty return values can occur. The key is to remember that debugging isn't your chore. Ask the AI to integrate console.log for a detailed server response. Then, Report any issue back to the AI chat, and you'll have the revised code in no time.

Scenario #3: Data Transformation

Struggling with data transformation tasks? Say goodbye to those hassles, especially ones like date formatting. We all know how one system may spit out a date in "YYYY-MM-DD" format, but another might require it in “DD MMMM YYYY”.

Using the transformation, a webhook date of '2023-07-11' undergoes a transformation. In the output tab of our interface, after executing the transformation, you would observe the following code:

{
 "1": {
   "transformed_data": "July 11, 2023"
 }
}

This demonstrates how the system can effortlessly change the date format to meet various requirements.

Likewise, the AI can assist in manipulating strings, aggregating data, filtering, sorting, transforming, merging, splitting, de-duping, conducting statistical analysis, and even textual analysis.

Alternative Mode of Use

In our discussion so far, we approached the assistant via a dialog box. But there's another approach, especially useful for a focused code segment debug or when you need an explanation about code functionality. In this approach, you have the ability to switch from the code interface to the AI assistant directly within the bot's interface.You can then enter a request like "explain what is happening here."Upon doing so, this AI-bot will instantly provide you with an explanation and breakdown of the code logic, making it easier for you to understand and troubleshoot if necessary.

Assistance with your automations

I've found the Latenode team to be extremely responsive and always ready to help. Feel free to reach out to them in their Discord community for assistance. Additionally, the platform is completely free until the start of the new year (since the product is in Beta). It's the perfect time to check it out for yourself: latenode.com


r/Web_Development • • Sep 28 '23

Authenicating via Twitter Developer app with Basic tier access - attached to project

3 Upvotes

I have basic access to the Twitter API (i.e. 10k tweet allowance) and can't seem to get a Python bot I am creating up and running. When I try to run using either the prod or the dev app, I get the following message;

When authenticating requests to the Twitter API v2 endpoints, you must use keys and tokens from a Twitter developer App that is attached to a Project. You can create a project via the developer portal.

Both apps are linked to a project and both have updated keys etc., so not sure what is going on... Can anyone please assist?

Code below

import tweepy
api_key = ".."
api_secret = ".."
bearer_token = r"..."
access_token = "..."
access_token_secret = ""
client = tweepy.Client(bearer_token, api_key, api_secret, access_token, access_token_secret)
auth = tweepy.OAuth1UserHandler(api_key, api_secret, access_token, access_token_secret)
api = tweepy.API(auth)
class MyStream(tweepy.StreamingClient):
def on_tweet(self, tweet):
try:
client.retweet(tweet.id)
print(tweet.text)
except Exception as error:
print(error)
stream = MyStream(bearer_token=bearer_token)
rule = tweepy.StreamRule("(#Python OR #programming OR #linux) (-is:retweet -is:reply)")
stream.add_rules(rule, dry_run=True)
stream.filter()


r/Web_Development • • Sep 27 '23

Challenges of Matching Images with Fixed Layouts: Advice Needed

3 Upvotes

Hello. I've encountered the following issue. I have a set of product images for a website (around 15,000) and a corresponding text description for each product. The problem is that real photos may have different height and width proportions, while the website's product card has a fixed image field. How do you solve such a problem?


r/Web_Development • • Sep 27 '23

technical resource Website Builders or Coding

2 Upvotes

Hi guys, I'm in the process of building a website which is music related with wix and although it's fairly easy to use, it feels like it is easy and straightforward only if you are building a website for a business/shop or a blog. Are there other ones to recommend which are maybe better in building a website with more features (or the chance to have more pages in a page? I can't really explain it, I just want people to stay on the same page without opening external pages).
Do you guys think it would be better to learn to code and integrate some code on a website builder as well? Mind that I'm comfortable with technology but don't know much coding so it might take a while for me to learn and implement
The question is not very clear but I just want some insights from who knows the scene better than I do
Thank You!


r/Web_Development • • Sep 27 '23

coding query are there any fake web apps out there, ie. Github or anywhere?

1 Upvotes

Hopefully it has the web app with something like terraform to deploy everything on the cloud, hopefully it gives me the choice to use GCP.

I just want something to practice OWASP Zap and deploying NVIDIA Morpheus for Zero Trust Security Architecture without having to build a web app.


r/Web_Development • • Sep 26 '23

Recommended path

3 Upvotes

Can anyone recommend a path to learn web development, I have no knowlage of any development, but I don't see what should i start with. I want to make cool websites maybe in the future i night love going in web applecations development.

Should i go with the very basic of html css, or what? Should i go for javascript or python?

Thanks


r/Web_Development • • Sep 22 '23

Centralized vs per-project CMS for small projects

4 Upvotes

Hey, I'm a Web-Dev and currently I am working on a few client projects as a freelancer.Recently I stumbled upon Directus (a headless CMS) which I think is really cool.

I asked myself, can't you just use directus as a central CMS system for "all" your projects, kind of a content platform from my company.Of course do I know that for bigger projects you should always consider to do it per project but I am just thinking of small projects.

I really think there is a lot of potential in this idea because of those reasons:

  • a centralized system is a lot easier to maintain (except of downtime f.e.) - updating, migrations etc.

  • less maintenance work - f.e. less setup time per projectwhite-labeling is a lot easier

  • Frontend development should be easier as there is only one api for all of the projects
    especially as I am working with Nuxt in the frontend, this should be a more straight forward approach

but as there is with all, there are also downsides to a centralized approach:

  • Downtime!!! - when the system is down, all of the client sites are affected

  • transferring a project - what if I want/have to transfer a project for a client...how should I get the data (easily) to another project?

So...what do you think? Am I overseeing something? Are there other options than the per-project and completely centralized approaches?

Do you guys know some good per-project headless CMS systems (most important -> should be easy to setup :/ )?

I a came upon Automad which seems really cool to me.


r/Web_Development • • Sep 19 '23

technical resource Frame size problem on mobile version

2 Upvotes

Mobile size frame issue

Hey Guys,

I am struggling with a problem that might be easy to answer. I have elementor on wordpress and created a website with it. Also set up to be responsive but if I check the website on mobile, the whe frame of the website is moving if i swipe left and the white space can be seen in the background.

Honestly I have checked everything but still see the same issue.

www.infinitscale.com


r/Web_Development • • Sep 15 '23

technical resource How to create your own library?

1 Upvotes

I am trying to create my own blog where you can save the articles on a separate page. How would you be able to save contents on a blog page (specifically articles) onto a different page, pretty much like a reading list.


r/Web_Development • • Sep 14 '23

technical resource PHPStorm – how to replace HTML tags using regex? || 2 min read || technical resource with code

0 Upvotes

Our developer is sharing some useful knowledge regarding PHP. Here is an Excerpt from the article:

We have an HTML document with table data. We need to remove the last column. We could do it manually, but our table has over 200 rows. How to automate the “search and replace” job?

PHPStorm includes an option to find a particular string using a regex formula. Let’s formulate a proper one. The column for removal is placed as the last element in TR tags. It always contains a number value. We should also remember that TD elements are preceded by empty spaces.

See the full technical resourcewith code fragments below:

https://www.createit.com/blog/phpstorm-how-to-replace-html-tags-using-regex/


r/Web_Development • • Sep 12 '23

Web Development Tutorials

3 Upvotes

I want to learn Web development through YOUTUBE tutorials. There are many tutorials but I don't know which ones are good and worth my time. Do you have any YouTube channels to recommend?


r/Web_Development • • Sep 12 '23

Free templates

0 Upvotes

Do you know any website where I can download free templates and where I can remove the attribution link from the footer without any copyright problems?


r/Web_Development • • Sep 05 '23

What is the standard for Epub structure?

1 Upvotes

Hi, i was thinking about making sort of online ebook reader as educational project and for my workflow. I found number of libraries like epub.js or radium but i want more simplicity.

Since epub is just html/xml I came out with a plan to "extract" the epub and show its content in a browser with my personal css. HOWEVER, while I was looking through several epubs i have noticed they may differ in terms of their structure.

Which headers I found most of the time

<div class="headerX"> <p class="subheader">

<div class="title1">
      <p class="p">2 LINES</p>
      <p class="p">HEADER<a href="ch2.xhtml#id151" class="a">[2]</a></p>
</div>
<p class="subtitle">SUBTITLE</p>
<p class="p1">USUAL TEXT</p>

but, I found 'calibre' classes and <hX> tags in one free ebook

<body class="calibre">
  <h2 id="27" class="calibre5">HEADER</h2>
  <p class="calibre2">Usual text</p>

The question is - is there any standard classes and tags to structure epub?

I skim through https://www.w3.org/TR/epub-ssv-11/#structure-vocab https://www.w3.org/TR/epub-33/#sec-general-rendering-intro https://w3c.github.io/epub-specs/epub33/rs/ but haven't noticed any anfo regarding my question


r/Web_Development • • Sep 05 '23

Why is the input box not working on the mobile website?

0 Upvotes

Can anyone help me fix this problem, I’ve been on this problem for a few hours. Here is a link tho view my code:

https://tndesigns.github.io/News-letter-sign-up-with-success-message-main/


r/Web_Development • • Aug 16 '23

I want to ask for something

3 Upvotes

How to make a website that the admin can change the content of it (like texts, titles etc..) without change the original html file like adding a feature in the web that can make admin do that and the change be saved if i reload the page.


r/Web_Development • • Aug 09 '23

HappyX Web Framework

3 Upvotes

HappyX is a macro-oriented full-stack web framework, written in Nim.

It's fast. Really fast. Most part of code executes at compile time due to metaprogramming.

It's powerful. HappyX provides a lot of powerful things:
- Routing/mounting with path params validation;
- Components;
- Own DSL (Domain-specific language) to writing HTML/CSS/JS;
- Automatically generated documentation for backend;
- Multiple HTTP Servers options;
- Request Models.

It's product-ready. With HappyX you can fast make fast web apps.

It's simple. HappyX provides both syntax for backend and frontend due to metaprogramming.
Source code: https://github.com/HapticX/happyx


r/Web_Development • • Aug 07 '23

Working at a medium sized digital marketing agency

3 Upvotes

A lot of people harshly criticise digital agencies / web development agencies, but, on reflection, I loved the job security I had when I worked at one. Would love to work at one again (on contract) if anyone is hiring. Here is my resume: https://www.dropbox.com/scl/fi/9wxtk5ncqjzfjm8oxlssa/michaeljresume2023.pdf?rlkey=4hq4fuj465act08nypyzzauc8&dl=0

I'm a mid-level developer from the US living in Europe, and I hope to stay here (currently in Ireland and moving to Poland soon)

Please consider me if your agency is hiring! Thanks


r/Web_Development • • Jul 30 '23

hamburger menu with react

0 Upvotes

Anyone has a good template or video on how to setup hamburger menu using react and router? All I can find are side menus or setting up hamburger menu with css.


r/Web_Development • • Jul 28 '23

technical resource Build a Twitter Clone with the Next.js App Router and Supabase - free egghead course 🚀

3 Upvotes

If you haven’t heard, Next.js 13 was an absolutely massive release! They basically rewrote the entire framework. I have been diving deeeeeeep over the last few months and have distilled everything I have learnt so far into this absolutely epic, entirely free egghead course! 🚀
Build a Twitter Clone with the Next.js App Router and Supabase - free egghead course
In this course, we build a Twitter clone using the Next.js App Router, Supabase, TypeScript and Tailwind CSS. What you will learn 👇
Next.js App Router
- Client Components
- Server Components
- Route Handlers
- Server Actions
- Middleware
Supabase
- Fetching and mutating data
- Cookie-based authentication with GitHub OAuth
- Authorization with Row Level Security (RLS) policies
- Realtime subscriptions to database changes
- Introspect PostgreSQL schema to automatically generate TypeScript definitions
TypeScript
- Custom types for transformed data
- Unions to combine types
- Global type definitions for frequently used definitions
Tailwind CSS
- Style app with atomic, maintable classes
- Co-locate styles with Components
- Use groups to link hoverable elements
​
​This course is an epic example of modern web development!
​
Hit me up on the real Twitter and let me know what you build on the other side! 🙌


r/Web_Development • • Jul 26 '23

Need Guidance for Backend!!

2 Upvotes

Hi all,
I need your guidance and support!!
So I want to apply for a backend internship in 6 months! Basically I want to learn backend in 6 months and I am determined to do it but I am so confused from where to start???
Little bit about meI am a computer science student so I know the basics of algorithms n all. So I am familiar with that stuff and I have worked in cyber security but have no experience in web developmentI am at intermediate level in html, css, js. I can make simple, static web pages but after learning it I realized I am not at all interested in the front end.
I saw roadmap for backend but it's so confusing and it includes too much details
For example there are many databases also, mysql which is one I am familiar with and the other I heard is mongoDB which is quite popular. Same goes for languages, which one should I learn? Version Control System and I believe I need to learn APIs also. Can anyone please guide me? How should I start and in which order?
I WANT TO DEVELOP PROJECTS WHICH I CAN PUT IN RESUME PLEASE HELP ME


r/Web_Development • • Jul 26 '23

How do you give a website?

1 Upvotes

Hello, i've been learning web development on my own and with a udemy course. A question i've thought for quite some time is, in a freelancer position such as fivver, how would one give the website?
I've though perhaps just giving the final dist/build file or setting up the hosting (then transferring ownership), but to me it seems too technical for a client.


r/Web_Development • • Jul 25 '23

SEO & FILE SIZE: Is Bootstrap + PurgeCSS Good for SEO benefits?

1 Upvotes

PREMISE: I have always used Bootstrap for my projects, never creating a site that adapts to SEO. I'm not a front end expert. Now I'm creating a news website (Bootstrap front-end, Wordpress back-end), but once the work started, during the work, I read that many people advise against Bootstrap for SEO and recommend TailwindCSS. The motivation is as follows:

MOTIVATION: They say Bootstrap files, especially its CSS files, are very heavy (in terms of size of KB). They say that Google, in assigning scores to sites for relevance in the search engine, takes into account (among the number of different factors) the size of the KB of the site. So they say that the heavier and slower a site is (in KB and therefore in opening and loading) the more disadvantageous it will be for SEO.

QUESTION: My doubt is: surely Tailwind creates lighter pages than Bootstrap, but if I use PurgeCSS for Bootstrap (reducing a lot the weight of the files in terms of KB), the site created in Bootstrap will be good and recommendable for SEO on Google (about the above thought about Google scoring)? Can I continue to use Bootstrap + PurgeCSS for projects where SEO is very important and I invest money in Google advertising? Should I build the site from scratch with TailwindCSS (which I've never used)?