My journey of open-sourcing 2024

2024-11-06

Introduction 👋

Hello Devs! I am Priyanshu Verma, a aspiring Technologist and Open-source developer. I have recently participated in bunch of events in October.

I have participated in events:

This October 2024 was my busiest year in open-source.

GitHub Stats

Hacktoberfest 2024

This is my 2nd year of participating in Hacktoberfest and this year I broke my record of pulling requests.

Hacktoberfest Stats

I have contributed in bunch of repositories will tell in next sections.

Devfest 2024

This is my 1st year of participating in Devfest and got in TOP 30. Didn't selected for swags but contributed in repositories like:

GSSOC 2024

This was my 1st year of participating in GSSOC (GirlScript Summer Of Code Extended). I was selected as contributor and contributed in several repositories you can see all stats here.

The major contributions I done in repositories are:

Some of the Project Migrated in Prisma or Drizzle are:

  1. Truth Tunnel
  2. CodeCache
  3. Med-o-Next
function navigate(event, path) {
  event.preventDefault(); // Prevent the default anchor behavior
  history.pushState(null, "", path); // Change the URL without reloading the page
  loadContent(path); // Load the content dynamically
  toggleAnonymousChatbotButton();
}
 
async function loadContent(path) {
  const appDiv = document.getElementById("main-content"); // Main content area
  const urlMap = {
    "/": "/landing",
    "/dashboard": "/dashboard",
    "/profile": "/profile",
    "/login": "/login",
    "/signup": "/signup",
    "/chatbot": "/chatbot",
    "/anonymous": "/anonymous",
   ...more
  };
 
  let url = urlMap[path] || null;
 
  // Handle /chatbot/<id>
  const profiletMatch = path.match(/\/profile\/(\d+)/);
  if (profiletMatch) {
    const profileId = profiletMatch[1];
    url = `/profile/${profileId}`; // Update URL for the chatbot page
  }
 
 
 
  if (!url) {
    appDiv.innerHTML = "<h1>404 Page is not registered</h1>";
    removeScripts(); // Clean up scripts if path is not found
    return;
  }
 
  try {
    const response = await fetch(`${url}?full=false`);
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
 
    const content = await response.text(); // Fetch HTML content
    appDiv.innerHTML = content; // Inject HTML into the main content area
    removeScripts(); // Remove existing scripts
 
 
      injectScript(`/static/js${url}.js`); // Load the corresponding script
 
  } catch (error) {
    console.error("Failed to load content:", error);
    appDiv.innerHTML = "<h1>Failed to load content</h1>";
  }
}
 
function injectScript(src) {
  // Check if the script is already loaded to avoid duplicates
  if (document.querySelector(`script[src="${src}"]`)) return;
 
  const script = document.createElement("script");
  script.src = src;
  script.async = true; // Load script asynchronously
 
  script.onload = () => console.log(`${src} loaded successfully.`);
  script.onerror = () => console.error(`Failed to load script: ${src}`);
 
  document.body.appendChild(script); // Append script to body
}
 
function removeScripts() {
  const scripts = document.querySelectorAll("script");
  scripts.forEach((script) => {
    if (script.src && script.src.includes("/static/js")) {
      script.parentNode.removeChild(script); // Remove the script from the DOM
    }
  });
}
 
// Handle back/forward button
window.onpopstate = function () {
  loadContent(window.location.pathname);
};
 
// Load the initial content
window.onload = function () {
  loadContent(window.location.pathname);
};
 

You see the basic flow. I am not diving deep as it is not technical blog. You can Message me if you want to HERE.

SDKs

I have created some SDKs for MindsDB Hacktoberfest. There are two of them:

Minds Dart SDK It is not well maintained and I didn't took it serious. You guys and contribute in it to make it perfect.

Minds C# SDK It is C# SDK which I took serious and I will try to maintain it as it is online on Nugut and well maintained Production level code is written.

Yes, I did more then these contributions that are some but effective will tell about them later.

Conclusion

At the end I learned a lot in this October many this. I got many ideas about different things. You will see more exciting projects soon. I am working on some awesome Packages and Projects.

You guys can follow me up on social media and connect with me. I will be very happy with that.

Thanks for reading...

Read article on dev.to