Skip to content

sarahdavies186/travel-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Travel Map App

Overview

This is a React-based travel map application built with Vite, allowing users to track cities they have visited by adding, viewing, and deleting them on an interactive map. It uses React Context and useReducer for state management and integrates the Leaflet library for map functionality.

Features

  • Add and remove cities on the map
  • Interactive map with zoom and pan
  • Global state management with Context API and useReducer

Technologies Used

  • React (functional components, hooks)
  • Vite (fast front-end build tool with Hot Module Replacement)
  • React Context API + useReducer
  • Leaflet for interactive maps
  • CSS Modules for styling

Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn package manager

Installation & Running

  1. Clone the repository:
git clone https://github.com/sarahdavies186/travel-map.git
  1. Navigate to the project directory:
cd travel-map
  1. Install dependencies:
npm install
  1. Open two terminal windows or tabs:

In the first terminal, start the front-end development server:

npm run dev
  1. In the second terminal, start the fake backend server (simulating API calls):
npm run server
  1. Open your browser and go to http://localhost:3000 to use the app.

Project Structure

/src/components — React components

/src/context — Context and reducer files for state management

/src/styles — CSS Modules for styling

/src/utils — Utility functions

Notes

  • The backend server is a simple fake/mock server that stores data in a local file, simulating API calls.

  • The app focuses on clean, modular front-end architecture.

  • State management is centralized using Context API and useReducer to facilitate scalability.

  • Leaflet was chosen for its easy-to-use map integration and interactive features.

Future Improvements

  • Add user authentication and persistent cloud data storage

  • Implement filtering or categorizing of cities

  • Enhance accessibility features and keyboard navigation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors