Welcome to Phase 0.5
Welcome to Phase 0.5 of building our custom web analytics system for sankalandtech.com! After organizing our project folders and setting up Git, the next crucial step is to make sure our local website files are working correctly. This involves running a simple local web server and checking that your selected pages (like your homepage and C tutorial pages) load properly in your browser.
This phase is all about verifying your local development environment. It's like turning on the lights and making sure everything looks right before you start building the complex machinery of your analytics system.
Why We Need to Test Locally
Before we start writing backend analytics code or creating dashboards, we need to confirm that the local copy of our site is functioning as expected. Here's why this matters:
Early Error Detection: Running the site locally helps catch broken links, missing assets, or HTML errors before they become bigger issues.
Local Workflow: Testing locally ensures your edits are reflected immediately, making development much faster and safer.
Foundation Check: A working website structure is essential, since all our analytics scripts will be integrated into these pages.
Environment Confidence: Confirming everything loads correctly gives us confidence that our local development environment mirrors the live site.
Important Note: Keep the Server Running!
For your local website to remain accessible in your browser, the Python HTTP server needs to keep running in your Command Prompt window. Do not close that CMD window until you are finished testing or developing your website locally. If you close it, your local website will no longer be available.
Steps to Test Your Website Locally
We'll use Python’s built-in simple HTTP server to quickly launch your local website for testing. Follow the steps below to make sure everything is set up correctly.
Step 1: Open your Command Prompt (CMD). If your previous window is closed or already in use, make sure to start a new one so you're working in a clean environment.
Step 2: Navigate to your website/
folder. This is the folder that contains your index.html
file (if included) and the Tutorials/C/
subfolder. You need to be inside this folder to serve its contents properly. Use the following command to navigate: cd E:\SankalanAnalytics\website\
. Be sure to adjust the path if your SankalanAnalytics
project is saved in a different location.
Step 3: Start the Python Simple HTTP Server. Once you're inside the website/
folder, run this command: python -m http.server 8000
. This will start a local web server using port 8000. After running the command, you should see output like this in the Command Prompt: Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
. Leave this window open, as closing it will stop the server and your website will no longer be accessible locally.
Step 4: Open your web browser. You can use any modern browser like Chrome, Firefox, or Microsoft Edge.
Step 5: In the browser’s address bar, type http://localhost:8000/ and press Enter. Your browser should now display the contents of your website/
folder. If you have an index.html
file, it will load automatically. If not, you’ll see a directory listing, and you can click on the Tutorials/C/
folder to access your C tutorial pages.
Step 6: Verify that your pages are working as expected. Browse through your site and check that the text appears correctly, styles from your CSS files are being applied, images are loading properly, and any basic JavaScript is functioning. If everything looks good, your local development environment is ready for use.
When you're done testing, go back to the Command Prompt window and stop the server by pressing Ctrl+C. That’s it — your local setup is complete and you’re ready to move forward!