Mada za sehemu hiiIdentifying and setting up a web development environmentMada 4
- Identifying web frameworks
- Setting up web development tools
- Performing installation and configuration of a framework
- Creating a basic project
Setting Up Web Development Tools
Before building websites or web applications using frameworks, you must prepare your computer by installing the necessary tools. These tools help you write, manage, organise, and test your code effectively. Without them, web development becomes difficult and disorganised.
There are five important tools that every web developer needs:
1. Code Editors
A code editor is a program used to write code in a readable and organised way. It provides features like colour-coded syntax (making code easier to read), auto-completion, and error highlighting.
Examples: Visual Studio Code (VS Code), Notepad++, Sublime Text
2. Package Managers
A package manager is a tool that installs and manages code libraries or modules needed for a project. These libraries contain pre-written code that saves you time.
- npm (Node Package Manager): Used for JavaScript frameworks like React and ExpressJS
- pip: Used for Python frameworks like Django and FastAPI
3. Version Control Systems
A version control system tracks code changes over time and allows team collaboration. It helps you save different versions of your project and revert to previous versions if needed.
Git is the most popular version control system, often used with online platforms like GitHub and GitLab.
4. Web Browsers
Modern browsers like Chrome and Firefox include developer tools for testing, debugging, and analyzing front-end performance. These tools help you see how your website looks and behaves.
5. Local Web Servers and Databases
These tools enable developers to run and test web applications on their own machines before deploying them to the internet.
Example: XAMPP (bundles Apache, MySQL, and PHP)
Installing Visual Studio Code (VS Code)
Follow these steps to install VS Code on your computer:
- Visit the VS Code official website and download the installer for your operating system.
- Find the downloaded file in the Downloads folder and double-click it to start installation.
- Follow the on-screen instructions. You can keep the default settings.
- After installing, practice basic actions: opening a folder, creating a file, writing code, and saving the file.
Installing Package Managers
For JavaScript Projects (Node.js and npm)
- Visit the Node.js website and download the installer.
- Install it using the default settings. This also installs npm.
For Python Projects (Python and pip)
- Go to the Python website and download the installer.
- During installation, make sure to select "Add Python to PATH".
- Python comes with pip pre-installed.
Verification: After installation, open the command prompt and type:
node -vto check Node.js versionnpm -vto check npm versionpython --versionto check Python version
Installing and Configuring Git
-
Go to the official Git site and download the Git for Windows installer.
-
Run the installer, keeping default settings unless you need to change something.
-
Check if Git is working by opening the command prompt and typing:
git --versionYou should see the installed Git version.
-
Open Git Bash by searching for it in the Windows Start menu. This tool lets you run Git commands in a Unix-style terminal.
Basic Git Commands
| Command | Description |
|---|---|
git init | Start a new Git repository in your project folder |
git clone <repo_url> | Copy a project from a remote repository to your local machine |
git status | Check which files have changed |
git add -A | Add all changed files to the staging area |
git commit -m "message" | Save your changes with a description |
git push | Upload local changes to the remote repository |
git pull | Download latest changes from the remote repository |
Installing XAMPP
- Navigate to the official XAMPP website and select the appropriate version for your operating system.
- Download and run the installer.
- XAMPP bundles Apache (web server), MySQL (database), and PHP in one package.
Setting Up a Project Folder
Each web application should be in its own development folder. Follow these steps:
- Create a folder for your website in your desired location and name it MyWebsite.
- Open it in VS Code.
- Create sample files such as:
index.html(for your website content)style.css(for styling)script.js(for adding interactivity)
Command Not Found
This means the tool is not added to the system's PATH. Solution: Reinstall the tool and ensure "Add to PATH" is checked, or manually add the tool's location to Environment Variables.
Port Already in Use
This happens when the default port (8000, 3000) is already in use. Solution: Run your server on a different port.
- Django:
python manage.py runserver 8001 - Laravel:
php artisan serve --port=8080
Missing Dependencies
This occurs when required libraries were not installed. Solution:
- Python:
pip install <package-name> - Node.js:
npm install <package-name> - Laravel:
composer install
Permission Denied
This occurs when commands need administrator rights. Solution: Right-click Command Prompt or VS Code and select "Run as Administrator."
In Activity 3.1, you will:
- Install VS Code, Git, and either Node.js or Python on your computer.
- Create and open a sample project folder using VS Code.
- Work with peers to compare steps and troubleshoot challenges.
After completing the setup, record one challenge you faced and one helpful tip you learned through collaboration.
A Form 3 student in Tanzania can use these web development tools to create a simple school notice board website where teachers can post announcements and students can view class schedules. For example, using VS Code and a local server like XAMPP, a student could build a website for their school's science club to share meeting times and event notices, practicing the same tools professional web developers use in Dar es Salaam's growing tech industry.
Jinsi utakavyotathminiwaTathmini ya mchakato · Tathmini ya matokeo · Tathmini ya maarifa
Tathmini ya mchakato
- Install and configure tools like editors,package managers, and version control.
- Use tools to manage basic projects.
Tathmini ya matokeo
Fully configured development environment, including installed tools and initial settings.
Tathmini ya maarifa
Detailed knowledge of:
Method used: The student should explain
- popular development tools and their functionalities.
Principles: The student should explain the principles of:
- cross-platform compatibility and ease of use.
Theories: The student should explain:
- the concepts of web development tools
- role of version control and dependency management in team-based projects.
Circumstantial knowledge:
Detailed knowledge about:
- environment compatibility issues and solutions (e.g., Docker).
Swali
Which of the following is a package manager used for installing and managing JavaScript libraries?
Ingia ili kuwasilisha jibu lako na lihesabiwe katika umahiri wako.
Ingia ili kufanya mazoeziMwalimu
Umekwama? Niulize chochote kuhusu mada hii.
Ingia ili kumuuliza Mwalimu wa AI wa Sonza kuhusu swali hili.
Ingia ili kuulizaMajadiliano
Hakuna maswali bado