Family Travel Tracker is a web application that allows families to keep track of countries they have visited. Users can add family members, each with their own unique color, and track which countries they've visited on a color-coded world map.
- Add Visited Countries: Users can input the name of a country they have visited, and it will be highlighted on the world map.
- Family Member Profiles: Multiple family members can be added, each with their own color to represent their visited countries.
- Map Visualization: Visited countries are highlighted on a world map with the family member's chosen color.
- Error Handling: The app handles cases where the country does not exist in the database or has already been added.
- Frontend: Next.js, React, TypeScript, Tailwind CSS
- Backend: Next.js API Routes
- Database: Supabase (PostgreSQL)
- State Management: React Context API
- Data Visualization: D3.js, SVG
- UI Components: Custom components with Tailwind CSS
-
Clone the repository:
git clone https://github.com/RUBBOSS/family-travel-tracker.git cd family-travel-tracker -
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile with the following:# Supabase Database SUPABASE_HOST=your-supabase-host SUPABASE_DB=postgres SUPABASE_USER=postgres SUPABASE_PASSWORD=your-password SUPABASE_URL=your-supabase-url SUPABASE_KEY=your-supabase-key # For deployment PORT=3000 NODE_ENV=development -
Set up Supabase:
- Create a Supabase project
- Run the SQL in
supabase-setup.sqlin the Supabase SQL Editor
-
Start the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:3000.
- Create a Vercel account at vercel.com
- Install Vercel CLI:
npm i -g vercel
- Deploy:
vercel
- Add environment variables in the Vercel dashboard
- Create a Netlify account at netlify.com
- Connect your GitHub repository
- Set the following:
- Build Command:
npm run build - Publish Directory:
.next
- Build Command:
- Add environment variables from your
.envfile - Deploy
-
Add a Family Member:
- Click "Add Family Member" and fill out the form with the person's name and preferred color.
-
Track Visited Countries:
- Select a family member and enter the name of a country they have visited.
- The country will be highlighted on the world map with their color.
-
View Total Countries:
- The total number of countries visited by the selected family member is displayed at the bottom of the page.
-
Users Table:
id: Integer, Primary Keyname: Text, Name of the family membercolor: Text, Color associated with the family member
-
Countries Table:
id: Integer, Primary Keycountry_code: Text, Two-letter country codecountry_name: Text, Name of the country
-
Visited Countries Table:
id: Integer, Primary Keycountry_id: Integer, Foreign Key referencing thecountriestableuser_id: Integer, Foreign Key referencing theuserstable
If you'd like to contribute to this project, please fork the repository and submit a pull request. All contributions are welcome!
This project was created as part of a coding challenge to demonstrate basic full-stack web development skills using Node.js, Express, and PostgreSQL.