Getting Your Web Analytics Project Organized with Folders and Git
Welcome to Phase 0.4
Welcome to Phase 0.4 of building our custom web analytics system for sankalandtech.com! In the previous steps, we decided on our tools and installed all the necessary software. Now, it's time to set up the foundation for our project a clear, organized folder structure on our local system and to introduce Git for powerful version control.
Think of this phase as setting up your construction site and bringing in the blueprint vault. A well-organized project makes development smoother, especially for a complex system like web analytics and helps us manage our code professionally.
Why We Need a Good Folder Structure
Even though our website (www.sankalandtech.com) is already live, we need a local copy and a well defined folder structure for our entire analytics project. Here's why:
Organization & Clarity: Keeping all parts of our analytics system (website source, backend, dashboard, database scripts) neatly separated makes the project easy to understand and navigate.
Development Environment: We write and test all our new code (Flask, Streamlit, custom JavaScript) on our local computer before it ever goes live. This is safe, fast and efficient.
Website Management: Your local website/
folder is the "master copy" for any changes you want to make to sankalandtech.com. You make edits locally, track them and then upload the updated files.
Integration: The custom analytics code we write will live inside our website/
files to talk to our backend. A clear structure helps manage this connection.
Introducing Git and GitHub
Git is a powerful tool for version control and GitHub is a website that hosts Git projects online. Here's why they are essential for our project:
Why Git & GitHub Matter for This Project
Your Project's Time Machine: Git takes "snapshots" (called commits) of your entire project as you make changes. If something breaks, you can easily go back to any previous working version. It's like having an unlimited "undo" button for your whole project.
Proof of Work & Professionalism: When you put your project on GitHub, recruiters can see not just your final code, but the entire history of how you built it your problem solving, your coding habits and your progress over time. This is a highly valued professional skill.
Backup & Sharing: GitHub provides an online backup of your code. If anything happens to your local computer, your project is safe. It also makes it easy to share your project with others or even deploy parts of it later.
Industry Standard: Almost every professional software project uses Git. Learning to use it well is a fundamental skill for any developer aiming for top roles.
Important Note: Public vs. Private GitHub Repositories
When we connect our local project to GitHub we will create a private repository. This means your code will be safely backed up online but only you (and anyone you explicitly invite) will be able to see or download it.
Your live website content on sankalandtech.com is already public but your underlying source code does not have to be if you prefer to keep it private.
Also remember that you do not need to include all pages of your live website in your local website/
folder. A representative sample of 10–15 key pages like your homepage and pages with different layouts or functionality along with their shared CSS JavaScript and image assets is perfectly sufficient for development and testing purposes.
Our Project's Folder Structure
This is how our main project folder SankalanAnalytics
Project will be organized on your local system. This structure will also be reflected in our Git repository.
SankalanAnalyticsProject/ # The main project folder and Git repository root
├── venv/ # Your Python virtual environment (ignored by Git)
├── .git/ # The hidden Git repository folder (Git's brain)
├── .gitignore # Tells Git which files and folders to ignore
├── README.md # Overall project overview and instructions
├── website/ # Your www.sankalandtech.com content renamed. Source code
│ ├── index.html
│ └── (other selected website pages, CSS, JS, images)
├── backend/ # Where your Python Flask application code will live
│ └── app.py # Will be created here later
├── dashboard/ # Where your Python Streamlit dashboard code will live
│ └── dashboard_app.py # Will be created here later
└── database/ # Where your SQL scripts and database-related files will live
└── schema.sql # Will be created here later
Steps to Set Up Locally
You've already created some parts of this. Let's ensure everything is in place.
-
Create the New Top-Level Project Folder:
In your File Explorer go to a suitable location like your Documents or Projects folder. Create a new empty folder and name it: SankalanAnalytics
Project
-
Move Your Existing Content into the New Structure:
Move your entire www.sankalandtech.com
folder into SankalanAnalytics
Project.
Then rename www.sankalandtech.com
to website
. This website
folder should contain your 10–15 selected pages and all their necessary assets.
Move your venv
folder (if it's not already) into SankalanAnalytics/
Project. It should be a sibling of website/
.
-
Create Empty Folders for Other Components:
Inside SankalanAnalytics/
Project create these three new empty folders:
backend
dashboard
database
-
Initialize Git in the New Top Level Folder:
Open your Command Prompt. Navigate to your SankalanAnalytics
Project folder using:
cd C:\Users\YourName\Documents\SankalanAnalytics
(Adjust the path as needed.) Then run:
git init
You should see:
Initialized empty Git repository in E:/SankalanAnalytics/.git/
-
Create a .gitignore File:
In your File Explorer inside SankalanAnalytics/
Projectcreate a new text file named .gitignore
(no extension, confirm any OS warnings). Paste the following content into it and save:
# Python
__pycache__/
*.pyc
.pytest_cache/
.mypy_cache/
.ipynb_checkpoints/
# Virtual environment
venv/
.env
/env
# Database specific
*.db
*.sqlite3
*.mdf
*.ldf
*.bak
# OS and editor specific
.DS_Store
Thumbs.db
.vscode/
*.log
*~
-
Add All Current Files to Git's Staging Area:
Go back to your Command Prompt (still in SankalanAnalytics
) Project and type:
git add .
You won't see much output which is normal.
-
Make Your First Commit:
Still in CMD type:
git commit -m "Initial project structure for Sankalan Web Analytics System"
You'll see a summary of all the files and folders Git has now tracked.
Once you have completed these steps and confirmed your commit your local project will be perfectly organized and under Git version control. This is the solid foundation from which we'll build the rest of custom analytics system.