0xVantrex / 0xVantrex/DevHub-JS

Initialize the App (js/app.js)

Aperta Adatta ai principianti
#8 0 commenti 0 reazioni 1 assegnatario Rivendicata da @Supplete Vedi su GitHub
good first issue
Lingua principale
HTML
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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);

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
frontend
Tipo di issue
Funzionalità
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
75/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.