This section is part of the Full Stack OpenοΏΌ course. In Part 2οΏΌ, the focus is on building more dynamic React applications.
π We learned how to render lists using the map() function, handle user input with HTML forms, use the useEffect hook for data fetching, and apply basic styling with CSS.
βΈ»
π Projects Included
- Countries
Displays country data and allows users to explore information dynamically.
- Courseinfo
Renders course information and exercises using reusable components.
- Phonebook
A CRUD-style app that allows adding, deleting, and filtering contacts. This project includes a fake backend using db.json.
βΈ»
π Getting Started
Each project is independent. Navigate into the desired folder:
bash
cd countries
# or
cd courseinfo
# or
cd phonebook
Install dependencies
bash
npm install
Run the app with:
bash
npm run dev
ποΈ Fake Backend (Phonebook Only)
The phonebook project uses a fake REST API powered by JSON Server.
Important:
β’ db.json is only used by the phonebook project
β’ The backend must be running to add, delete, or update contacts
Run the backend server
bash
cd phonebook
npm run server
The API will be available at:
code
http://localhost:3001
π Example Structure
root/
βββ countries/
βββ courseinfo/
βββ phonebook/
βββ db.json
βββ src/
βββ package.json
For Countries project fetches weather data from an external API. You must subscribe at least to the free plan (version 3.0), which has a very limited number of requests, for more requests yo can explore others plans
Setup Example:
Create a .env file inside the countries folder:
VITE_SOME_KEY=your_api_key_here
and you can export it from the code just like this
code
const api_key = import.meta.env.VITE_SOME_KEY