Skip to content

nishatayub/Travelgram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ—บ๏ธ TravelGram โ€” Explore & Share Beautiful Places

A social map-based photo-sharing platform where travelers connect, share experiences, and discover the world through each other's lens.

Next.js Supabase Mapbox TypeScript


๐Ÿš€ Project Overview

TravelGram blends social networking with travel exploration, creating an interactive platform where every photo tells a story and every location sparks wanderlust.

Users can authenticate with Google, upload stunning travel photos, and pin them to exact locations on an interactive world map. Each post becomes part of a global tapestry of experiencesโ€”viewable both as a dynamic feed and as markers on a Mapbox-powered map.

Whether you're sharing your latest adventure or discovering hidden gems through others' journeys, TravelGram transforms travel memories into an engaging, visual experience.


โœจ Features

Feature Description
๐Ÿ” Google Authentication Seamless sign-in via Supabase Auth
๐Ÿ–ผ๏ธ Photo Uploads Secure storage with Supabase Storage
๐Ÿ—บ๏ธ Interactive Map Clickable location markers powered by Mapbox GL JS
๐Ÿ’ฌ Rich Posts Captions, place tags, and geolocation data
โค๏ธ Like System Appreciate and engage with other travelers
๐Ÿ•“ Smart Timestamps Relative time display (e.g., "5 minutes ago")
โšก Blazing Fast Next.js App Router with optimized performance
๐ŸŒ Production Ready Fully deployable on Vercel

๐Ÿงฐ Tech Stack

Category Technologies
Frontend Next.js 15 (App Router), React, TypeScript, Tailwind CSS
Backend Supabase (PostgreSQL, Auth, Storage, Realtime)
Map Integration Mapbox GL JS, react-map-gl
State Management SWR for data fetching & caching
Utilities clsx, dayjs

โš™๏ธ Setup Instructions

1๏ธโƒฃ Clone the Repository

git clone https://github.com/nishatayub/Projecttttt.git
cd Projecttttt/trial-mode

2๏ธโƒฃ Install Dependencies

npm install

3๏ธโƒฃ Set Up Environment Variables

Create a .env.local file in the root directory:

NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
NEXT_PUBLIC_MAPBOX_TOKEN=your_mapbox_access_token

๐Ÿ”‘ Obtain your keys:

  • Supabase: Dashboard โ†’ Settings โ†’ API
  • Mapbox: Account โ†’ Access tokens

4๏ธโƒฃ Database Setup

Execute the following SQL in your Supabase SQL Editor:

-- Create profiles table
create table profiles (
  id uuid references auth.users on delete cascade primary key,
  username text,
  avatar_url text,
  created_at timestamp with time zone default timezone('utc'::text, now()) not null
);

-- Create posts table
create table posts (
  id bigint generated by default as identity primary key,
  user_id uuid references auth.users not null,
  image_path text not null,
  image_url text not null,
  caption text,
  place_name text,
  lat double precision,
  lng double precision,
  created_at timestamp with time zone default timezone('utc'::text, now()) not null
);

-- Create likes table
create table likes (
  id bigint generated by default as identity primary key,
  user_id uuid references auth.users on delete cascade,
  post_id bigint references posts on delete cascade,
  created_at timestamp with time zone default timezone('utc'::text, now()) not null,
  unique (user_id, post_id)
);

-- Enable Row Level Security
alter table profiles enable row level security;
alter table posts enable row level security;
alter table likes enable row level security;

-- Policies
create policy "Public profiles are viewable by everyone"
  on profiles for select
  using ( true );

create policy "Users can update own profile"
  on profiles for update
  using ( auth.uid() = id );

create policy "Posts are viewable by everyone"
  on posts for select
  using ( true );

create policy "Users can create own posts"
  on posts for insert
  with check ( auth.uid() = user_id );

create policy "Users can delete own posts"
  on posts for delete
  using ( auth.uid() = user_id );

create policy "Likes are viewable by everyone"
  on likes for select
  using ( true );

create policy "Users can manage own likes"
  on likes for all
  using ( auth.uid() = user_id );

5๏ธโƒฃ Configure Supabase Storage

  1. Go to Storage in your Supabase dashboard
  2. Create a new bucket called travel-photos
  3. Set it to Public

6๏ธโƒฃ Start Development Server

npm run dev

๐ŸŽ‰ Visit: http://localhost:3000


๐Ÿ“ Folder Structure

trial-mode/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ page.tsx              # Home page with post feed
โ”‚   โ”œโ”€โ”€ layout.tsx            # Root layout with auth provider
โ”‚   โ””โ”€โ”€ globals.css           # Global styles
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ AuthButtons.tsx       # Google sign-in/sign-out
โ”‚   โ”œโ”€โ”€ NewPostForm.tsx       # Photo upload form
โ”‚   โ”œโ”€โ”€ PostCard.tsx          # Individual post display
โ”‚   โ””โ”€โ”€ MapView.tsx           # Interactive Mapbox map
โ”œโ”€โ”€ lib/
โ”‚   โ”œโ”€โ”€ supabaseClient.ts     # Client-side Supabase
โ”‚   โ””โ”€โ”€ supabaseAdmin.ts      # Server-side Supabase
โ”œโ”€โ”€ public/
โ”‚   โ””โ”€โ”€ assets/               # Static images & icons
โ”œโ”€โ”€ .env.local                # Environment variables
โ”œโ”€โ”€ next.config.ts            # Next.js configuration
โ”œโ”€โ”€ tailwind.config.ts        # Tailwind CSS config
โ””โ”€โ”€ tsconfig.json             # TypeScript config

๐Ÿ”ฎ Future Enhancements

  • ๐Ÿ—จ๏ธ Comments System โ€” Engage in conversations on posts
  • ๐Ÿ‘ฅ Follow/Unfollow โ€” Build your travel community
  • ๐Ÿงญ Location Search โ€” Find posts by specific places
  • ๐Ÿ•’ Realtime Updates โ€” See new posts as they happen
  • ๐Ÿ“ Trip Routes โ€” Visualize complete travel journeys
  • ๐ŸŒˆ User Profiles โ€” Showcase personal travel history
  • ๐ŸŒ™ Dark Mode โ€” Eye-friendly theme options
  • ๐Ÿ“ฑ Mobile App โ€” Native iOS & Android experience
  • ๐Ÿ”” Notifications โ€” Stay updated on likes and comments
  • ๐Ÿ† Achievements โ€” Gamify travel experiences

๐ŸŒ Deployment

Deploy effortlessly on Vercel:

  1. Push your code to GitHub
  2. Import the repository in Vercel
  3. Add environment variables in project settings
  4. Deploy! ๐Ÿš€

Deploy with Vercel


๐Ÿ‘ฉโ€๐Ÿ’ป Author

Nishat Ayub
Frontend Developer & UI/UX Designer

GitHub LinkedIn


๐Ÿ“„ License

This project is open source and available under the MIT License.


๐Ÿ™ Acknowledgments

  • Supabase for the incredible backend infrastructure
  • Mapbox for stunning map visualizations
  • Vercel for seamless deployment
  • The open-source community for amazing tools and inspiration

Built with โค๏ธ and a passion for travel
Happy exploring! ๐ŸŒโœˆ๏ธ๐Ÿ“ธ

About

๐Ÿ—บ๏ธ A social map-based photo-sharing platform where travelers connect, share experiences, and discover the world through each other's lens.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages