0xVantrex / 0xVantrex/DevHub-JS

Initialize the App (js/app.js)

Abierto Apto para principiantes
#8 0 comentarios 0 reacciones 1 asignado Reclamado por @Supplete Ver en GitHub
good first issue
Lenguaje dominante
HTML
Estrellas
0
Forks
0
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Goal

This person sets up the app’s starting point — connects all modules together (search, stats, storage, theme, profiles).
Basically makes everything run when the page loads.

File Ownership

You fully own:
/js/app.js

This file is the main entry point for the entire app.
Everyone else’s code will depend on your imports working.

Learning Concepts

JS module imports/exports

Function execution order

DOMContentLoaded event

Data initialization

Functional Requirements
1. Import All Modules

At the top of your file:

import { loadProfiles, saveProfiles } from "./storage.js";
import { updateStats } from "./stats.js";
import { setupSearch } from "./search.js";
import { initThemeToggle } from "./theme.js";

If more modules come later (like profiles.js or github.js), you’ll import those too.

2. Main App Function

You’ll create and run an initialization function that sets up everything in order:

function initApp() {
// 1. Load profiles from localStorage
let profiles = loadProfiles();

// 2. Initialize search functionality
setupSearch(profiles);

// 3. Update stats on load
updateStats(profiles);

// 4. Initialize theme toggle
initThemeToggle();

// 5. Log for confirmation
console.log("App initialized successfully ");
}

3. Run App After Page Loads

Make sure everything starts only after the DOM is ready:

document.addEventListener("DOMContentLoaded", initApp);

4. Export Nothing

This file is the root, not a module — no exports needed.

Definition of Done

App initializes without any console errors

All imported modules run correctly

Logs “App initialized successfully ” when loaded

Search, theme, and stats all work as intended

Code is clean, modular, and readable

Bonus

Add a small loading spinner before initialization

Catch and log any initialization errors:

try {
initApp();
} catch (error) {
console.error("App failed to start:", error);

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

The work is in /js/app.js, the main entry point. Start by reading the existing code to see if any imports or initialization are already present. Follow the functional requirements to import modules, write the initApp function, and attach it to DOMContentLoaded. Test by opening the app in a browser and checking the console for the success log and errors.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript
Área
frontend
Tipo de issue
Nueva funcionalidad
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
75/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.