Folder Structure | For Building Website Analytics System

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.


Diagram showing the organized folder structure for a web analytics project, including website, backend, dashboard and database folders, managed with Git.

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.

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

  2. 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/.

  3. Create Empty Folders for Other Components:

    Inside SankalanAnalytics/ Project create these three new empty folders:

    • backend
    • dashboard
    • database
  4. 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/
  5. 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
    *~
  6. 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.

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


Previous Topic==> S/W Requirement and Installations ||  Next Topics==> Testing Project Locally


SQL All topics Wise Interview Questions    Employee Salary Management SQL FAQ!.   C FAQ   Top 25 PL/SQL Interview Questions

Joins With Group by Having  Equi Join  Joins with Subqueries  Self Join  Outer Join 


Website Analytics Project: Phases and Action Steps

  • Home
  • 🟢 Live App: Web Analytics Simulator
  • Phase 0: Project Setup & Problem Definition
  • 0.1 Define Project Goals & Challenges
  • 0.2 Select Tools, Tech Stack & Data Sources
  • 0.3 Software Requirements & Installation
  • 0.4 Folder Structure & GitHub Repo
  • 0.5 Testing Project Locally
  • Phase 1: Planning for Analytics
  • 1.1 Website Analytics Project Overview
  • 1.2 Define KPIs, Bounce Rate, Engagement
  • 1.3 Identify Target Users & Pain Points
  • Phase 2: Data Collection
  • 2.1 Setup Google Analytics 4 (GA4)
  • 2.2 Export GA4 Data to BigQuery/CSV
  • 2.3 Design SQL Schema for Web Analytics
  • Phase 3: Data Cleaning & Feature Engineering
  • 3.1 Clean Website Data with Python & Pandas
  • 3.2 Create Custom Metrics (Session, Bounce, etc.)
  • Phase 4: Exploratory Data Analysis (EDA)
  • 4.1 Analyze Website Traffic Trends
  • 4.2 Behavior by Device, Source, Location
  • 4.3 Top Pages & High Bounce Pages
  • 4.4 Diagnose Low Traffic & User Drop
  • Phase 5: Business Insights
  • 5.1 Funnel Analysis & Drop-Off Points
  • 5.2 New vs Returning Users
  • 5.3 Time Spent & Scroll Depth
  • Phase 6: SQL for Business
  • 6.1 SQL for Business Insights
  • 6.2 Combine Web Data Using SQL
  • 6.3 Find Problematic Pages Using SQL
  • Phase 7: Machine Learning
  • 7.1 Segment Users with Clustering
  • 7.2 Predict Bounce Rate with ML
  • 7.3 Recommend Pages or Content
  • Phase 8: Dashboards & Visualization
  • 8.1 Dashboard with Streamlit
  • 8.2 Visualize KPIs with Python
  • 8.3 Page-Level Metrics & Drop Heatmaps
  • Phase 9: Final Analytics Story
  • 9.1 Summary Report & Findings
  • Phase 10: Hosting & Portfolio Presentation
  • 10.1 Host Website Project Online
  • 10.2 Add to GitHub with ReadMe
  • 10.3 Pitch Project in Interview
  • Other Topics
  • SQL Interview Questions
  • SQL Case Study: Account Management
  • Python Interview Questions
  • Why C Language

Get in touch

  • tech2dsm@gmail.com

© Sankalan Data Tech. All rights reserved.