Skip to main content
This guide walks you through setting up SemiCode Analyzer on your local machine and running your first semiconductor analysis.

Prerequisites

Before you begin, ensure you have:
  • Node.js 18.x or higher installed
  • npm package manager (comes with Node.js)
  • Git for cloning the repository
  • A modern web browser (Chrome, Firefox, Safari, or Edge)

Installation

1

Clone the repository

Clone the SemiCode Analyzer repository to your local machine:
git clone https://github.com/Bryborj/SemiCode-Analyzer.git
2

Navigate to the project directory

Change into the project folder:
cd SemiCode-Analyzer
3

Install dependencies

Install all required npm packages:
npm install
This will install:
  • Astro 5.17.1
  • Tailwind CSS 4.1.18
  • @tailwindcss/vite 4.1.18
4

Start the development server

Launch the Astro development server:
npm run dev
The server will start on port 4321 by default.
5

Open the application

Navigate to the application in your browser:
http://localhost:4321/
You should see the SemiCode Analyzer interface with input fields for atomic numbers.
If port 4321 is already in use, Astro will automatically select the next available port. Check your terminal output for the actual URL.

Running your first analysis

Once the application is running, you can analyze semiconductor combinations:
1

Enter the host element atomic number

In the “Número Atómico Elemento A (Host)” field, enter an atomic number. For example:
  • Enter 14 for Silicon (Si)
Silicon is the most common semiconductor material with 4 valence electrons.
2

Enter the dopant element atomic number

In the “Número Atómico Elemento B (Dopante)” field, enter a dopant atomic number:
  • Enter 13 for Aluminum (Al) to create a P-type semiconductor
  • Or enter 15 for Phosphorus (P) to create an N-type semiconductor
3

Calculate the material type

Click the “Calcular Material” button.The application will:
  1. Calculate electronic configurations for both elements
  2. Determine valence electrons for each element
  3. Classify the resulting semiconductor type
  4. Display the material type (Intrinsic, N-type, or P-type)
4

Explore the visualizations

Scroll down to view:
  • Atomic diagrams: Visual representation of electron shells for both elements
  • Energy band diagram: Shows the Fermi level position relative to conduction and valence bands
  • Crystal lattice structure: 3x3 grid showing the dopant atom integrated into the host crystal with free electrons (e-) or holes (h+) marked

Example combinations

Try these common semiconductor combinations:

N-type semiconductor (excess electrons)

Host: 14 (Silicon, Si)
Dopant: 15 (Phosphorus, P)
Result: Tipo N (Exceso de electrones)
Phosphorus has 5 valence electrons. When it replaces a Silicon atom (4 valence electrons), one extra electron becomes a free charge carrier.

P-type semiconductor (excess holes)

Host: 14 (Silicon, Si)
Dopant: 13 (Aluminum, Al)
Result: Tipo P (Exceso de huecos)
Aluminum has 3 valence electrons. When it replaces a Silicon atom, it creates a “hole” — a missing electron that acts as a positive charge carrier.

Intrinsic semiconductor

Host: 14 (Silicon, Si)
Dopant: 32 (Germanium, Ge)
Result: Intrínseco (Aislante)
Both Silicon and Germanium have 4 valence electrons, so no doping occurs.
The application expects atomic numbers between 1 and 118. Entering invalid values will trigger a browser alert.

Understanding the output

The results display includes:

Electronic configuration

For Silicon (Z=14):
1s2 2s2 2p6 3s2 3p2 (4 e- valencia)
This notation shows how electrons fill orbitals following the Aufbau principle. The “4 e- valencia” indicates 4 electrons in the outermost shell (3s² 3p²).

Material classification

The application determines material type based on valence electron differences:
~/workspace/source/src/utils/chemistry.js
export const determineMaterial = (el1, el2) => {
  const v1 = el1.valenceElectrons;
  const v2 = el2.valenceElectrons;

  if (v1 === 4 && v2 === 4) return "Intrínseco (Aislante)";
  if ((v1 === 4 && v2 === 5) || (v1 === 5 && v2 === 4)) return "Tipo N (Exceso de electrones)";
  if ((v1 === 4 && v2 === 3) || (v1 === 3 && v2 === 4)) return "Tipo P (Exceso de huecos)";
  return "Ninguno de los anteriores";
};

Next steps

Now that you have SemiCode Analyzer running:
  • Experiment with different element combinations
  • Study how valence electrons affect semiconductor behavior
  • Observe how the Fermi level shifts in the energy band diagram
  • Examine the crystal lattice visualization to understand doping at the atomic level

Troubleshooting

Port already in use

If you see an error about port 4321 being in use:
npm run dev -- --port 3000
This starts the server on port 3000 instead.

Module not found errors

Ensure all dependencies are installed:
rm -rf node_modules package-lock.json
npm install

Periodic table data not loading

Verify that public/periodicTable.json exists in the project root. This file contains element data required for displaying element names and symbols.

Build docs developers (and LLMs) love