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.
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.
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."
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.
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.
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.