Project: Bander Snatch
Duration: ~7-8 minutes
Hello and welcome to the Labs DS Setup tutorial. I'm going to walk you through the process of pulling the Labs DS project locally and getting everything configured for Unit 1, Sprint 2. By the end of this video, you'll have a fully functional development environment ready to start coding.
Let's begin by accessing the starter repository. Navigate to Unit 1, Sprint 2, and find Module 1: Onboarding and Planning. Scroll down until you see the Local Setup section. You'll find a link to the Bander Snatch Starter repository—click that to open it in GitHub.
Now we need to create your own copy of this project. Click the Fork button in the upper right corner of the GitHub page. Select your GitHub account from the dropdown.
You have the option to rename the repository if you'd like—for example, you might call it "bandersnatch-starter" followed by your name. This helps keep things organized if you're working on multiple projects.
Once you're ready, click Create Fork. GitHub will process this for a moment, and you'll now have a complete copy of the project in your own account. This means you can make changes without affecting the original repository.
Now let's get this project onto your local machine. First, create a folder where you'll keep your Labs DS work. I recommend calling it something like "LabsDS" so it's easy to find.
Open that folder in File Explorer. Here's a handy tip: click in the address bar at the top, type "cmd" and press Enter. This opens a Command Prompt already navigated to your folder.
Now we'll clone the repository. Type:
git clone
followed by the URL of your forked repository. You can copy this from GitHub by clicking the green Code button and copying the HTTPS URL.
Note for Windows users: If you don't have Git installed, you can use WSL—Windows Subsystem for Linux. Just type "wsl" first to enter the Linux environment, then run your git clone command.
The project will download to your machine. This may take a minute depending on your internet connection.
Once cloning is complete, navigate into the project folder by typing:
cd bandersnatch-starter-yourname
Replace "yourname" with whatever you named your fork.
Now let's open this in Visual Studio Code. Simply type:
code .
The period is important—it tells VS Code to open the current directory.
VS Code will launch and may ask if you trust the authors of this folder. Click "Yes, I trust the authors" to proceed.
The first file you should always check in a new project is the README. Click on README.md in the file explorer, and you can use the preview mode to see it formatted nicely.
Take a moment to skim through this. You'll see the project introduction, the folder structure, the Sprint tickets you'll be working on, and importantly, the setup instructions. We're going to follow the "Setup Environment" section step by step.
Let's set up our Python virtual environment. You can use VS Code's integrated terminal—go to Terminal menu and select New Terminal, or use the command prompt you opened earlier.
Type this command:
python -m venv venv
This creates a folder called "venv" which will contain an isolated Python environment. This is important because it keeps your project dependencies separate from your system Python installation.
Now we need to activate it. On Windows, type:
venv\Scripts\activate
If you're on macOS or Linux, you'd use:
source venv/bin/activate
You'll know it worked when you see "(venv)" appear at the beginning of your command prompt. That indicates you're now working inside the virtual environment.
Now let's upgrade pip and install our project requirements. First, upgrade pip, setuptools, and wheel by running:
python -m pip install --upgrade pip setuptools wheel
This ensures you have the latest package management tools.
Next, install all the project dependencies:
pip install -r requirements.txt
This reads the requirements file and installs everything the project needs—Flask, pandas, pymongo, and other libraries. This process may take a few minutes depending on your internet speed. You'll see a lot of output as packages are downloaded and installed.
Excellent! Now let's see if everything works. Start the Flask development server by typing:
python -m app.main
You should see some startup messages, and importantly, you should see something like: "Running on http://127.0.0.1:5000"
Hold down Control and click that URL, or copy and paste it into your browser.
You should now see the Bander Snatch application with the heading "Sprint Zero: Proof of Setup."
Don't worry if the Data, View, and Model sections don't do anything yet—that's completely expected. We're just verifying that the application runs.
Let's keep the server running but minimize that terminal window. Keep both your browser and VS Code visible so you can see changes in real time.
Back in the README, scroll down to "Setting Up the Database."
The first step is creating an environment file. In VS Code, create a new file in the project root directory—not in any subfolder—and name it exactly ".env" with the dot at the beginning.
In this file, you'll add your MongoDB connection string. It should look like this:
DB_URL=mongodb+srv://username:[email protected]/bandersnatch?retryWrites=true&w=majority
To get your MongoDB URL:
- Sign up for a free account at MongoDB Atlas
- Create a new Shared Cluster—this is the free tier
- In the security settings, add your current IP address to the whitelist
- Create a database user with a username and password
- Copy the connection string they provide
- Replace the username and password placeholders with your actual credentials
Save the .env file once you've added your connection string.
Now we're ready to begin Sprint 1. Open the README again and find the Sprint 1 Tickets section.
The objective for Ticket Number 1 is to implement several functions in the data.py file. Specifically, you'll be implementing:
- seed()
- reset()
- count()
- get_dataframe()
- get_html_table()
These functions handle database operations and data display.
To activate Sprint 1, we need to change a setting in the code. Open app/main.py from the file explorer.
Look for this line near the top:
SPRINT = "sprint_zero"Change it to:
SPRINT = "sprint_one"Save the file with Control+S or Command+S on Mac.
Now we need to restart the Flask server to pick up this change. Go back to your terminal where the server is running.
Press Control+C to stop the server. You'll see it shut down gracefully.
Now start it again:
python -m app.main
Go back to your browser and refresh the page. You should now see "Sprint One" in the heading instead of "Sprint Zero."
The data section will show "Count: None"—that's normal. Once you implement the count function, this will display the actual number of records in your database.
Now you're ready to code! Open app/data.py in VS Code.
Here's my recommended workflow:
- Read through Ticket Number 1 completely. Understand the objectives and deliverables before writing any code.
- Implement each function one at a time. Don't try to do everything at once.
- After implementing each function, refresh your browser to test it immediately. This helps you catch errors early.
- Use the Flask server output in your terminal to debug any issues that come up.
The functions build on each other, so implement them in the order they're listed in the ticket.
And that's it! You now have:
- A forked copy of the project in your GitHub account
- The project cloned to your local machine
- A working Python virtual environment
- All dependencies installed
- The Flask application running successfully
- Your database configured
- And Sprint 1 ready for you to start coding
If you run into any issues or have questions, don't hesitate to ask in the team-labs-current channel. The community is there to help.
Thanks for watching, and happy coding! Good luck with Sprint 1.
[End of Script]
Total Duration: ~7:30