AI Hackathon tutorial: How to use Github for your hackathon project

Friday, February 03, 2023 by ezzcodeezzlife
AI Hackathon tutorial: How to use Github for your hackathon project

What is a Github and why do I need it for my AI Hackathon project?

Tutorial accompaniment image

Github is an amazing platform, where you can share your code with the world and collaborate with other developers on all of the submitted projects. It is also a great tool for AI hackathons, because many times you will work with people from all around the world, so you need to have easy access to your code from every place on earth.

Lablab.ai is a community of builders, creators and innovators from all around the world and our AI Hackathons and we encourage you to join it and shape the future with the help of artificial intelligence - doesn;t matter if you use ChatGPT api, you build with Stable Diffusion API or any other generative AI - the goal is always to innovate and solve the problems.

In this tutorial, I will show you how to use Github for your hackathon project. We will show you how to create a repository, how to add collaborators, and how to use Streamlit, Replit or Vercel to host your project. Furthermore you will learn about .gitignore files and how to use them to hide your private keys in an .env file. But one thing at a time: Let's start with the basics.

How to create a Github repository?

A Github repository is a place where you can store your code. It is basically a folder where you can store your code and other files. You can also create subfolders in your repository. You can think of a repository as a project folder.

To create a Github repository, you first need to create a Github account. You can do this here. After a new account is set up, you can create a new repository by simply clicking on the "+" icon in the top right corner and then on "New repository". You can then enter a name for your repository and click on the "Create repository" button.

Congratulations - you can now start adding files to your repository! You can do this by clicking on "Add file" and then on "Upload files". You can also use GIT to add files to your repository. If you want to learn more about GIT, you can check out this tutorial here.

How to add collaborators to your Github repository?

You can add your team members as collaborators in your repository so they can work on your project with you. You must navigate to your repository and select "Settings" to do this. Next, select "Manage access" before selecting "Invite a colleague."

Tutorial accompaniment image

Then, after entering the team member's username, select "Add collaborator." An email invitation to your repository will then be sent to your team member. They will be able to access your repository and collaborate with you once they have accepted the invitation.

Use .gitignore to hide your private keys!

You never should add a private key to your repository. Mainly because your private key is like a password and the first lesson you learnt using the internet was not to share any of your passwords with anyone online, as it will be publicly available and anyone can use it. But there’s a workaround - you can use a .gitignore file.

A .gitignore file is a file that tells Github which files you want to ignore. You can create a .gitignore file by clicking on "Add file" and then on "Create new file". Rename it ".gitignore" and then in this file add the file’s name you want to be ignored.

For example - to ignore a file called "env", you simply add "env" to your .gitignore file. You can also use wildcards to ignore multiple files. For example, to ignore all files that end with ".env", you can add "*.env" to your .gitignore file.

You can also use the .gitignore file to ignore entire folders. For example, if you want to ignore a folder called "node_modules", you can add "node_modules" to your .gitignore file.

Tutorial accompaniment image

How to use Streamlit, Replit and Vercel to host your project?

These all are great tools to be used during an AI hackathon, but It's just important to choose the right tool for your project, as all of them are dedicated to different problems / matters If you’re creating a web app with Python, use Streamlit. Ro run your code online, use Replit. Use Vercel to host your web app online.

All of the tools are free and you can use them to host your AI Hackathon project online to easily collaborate on them, and of course present them to the world, as we all want to create during a 7-days event a working prototype to be the foundation of our future startup. Right?

Thank you!

If you enjoyed this tutorial you can find more and continue reading on our tutorial page - Fabian Stehle, Developer at New Native