Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 142 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,162 @@
# Getting Started with Create React App
# TripGo - Your Ultimate Travel Planning Application 🌍✈️

## Overview

TripGo is a modern, feature-rich travel planning application built with React and TypeScript. It helps users discover and explore beautiful tourist destinations across India with an intuitive and engaging user interface.

![TripGo Interface](public/images/README.md)

## ✨ Features

### 🏛️ City-wise Tourist Spots
- Comprehensive database of tourist destinations
- High-quality images and detailed information
- Local tips and recommendations
- Seasonal visit guides
- Popular local experiences

### 🎯 Easy Navigation
- Intuitive user interface
- Smart search functionality
- Quick filters for destinations
- Interactive maps
- User-friendly design

### 👤 Personalized Experience
- User authentication and profiles
- Favorite destination lists
- Custom travel plans
- Travel preference settings
- Personal travel diary

### 📱 Mobile Friendly
- Responsive design for all devices
- Fast loading pages
- Offline content access
- Easy sharing features
- Touch-friendly interface

## 🚀 Getting Started

### Prerequisites
- Node.js (v14 or higher)
- npm or yarn
- Git

### Installation

1. Clone the repository:
\`\`\`bash
git clone https://github.com/shrutu0929/TripGo.git
\`\`\`

2. Navigate to the project directory:
\`\`\`bash
cd TripGo
\`\`\`

3. Install dependencies:
\`\`\`bash
npm install
\`\`\`

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4. Start the development server:
\`\`\`bash
npm start
\`\`\`

## Available Scripts
The application will open in your default browser at `http://localhost:3000`.

In the project directory, you can run:
## 🛠️ Built With

### `npm start`
- **React** - Frontend framework
- **TypeScript** - Programming language
- **Supabase** - Backend and authentication
- **CSS Modules** - Styling
- **React Router** - Navigation
- **React Icons** - Icon library

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
## 📁 Project Structure

The page will reload if you make edits.\
You will also see any lint errors in the console.
\`\`\`
tripgo/
├── public/
│ └── images/
├── src/
│ ├── components/
│ ├── config/
│ ├── data/
│ ├── pages/
│ └── styles/
├── package.json
└── README.md
\`\`\`

### `npm test`
## 🎨 Key Components

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### Pages
- **Home** - Landing page with featured destinations
- **CityDetails** - Detailed information about each city
- **About** - Information about TripGo
- **Contact** - Contact form and information
- **Login/SignUp** - User authentication pages

### Features
- Animated backgrounds with star effects
- Professional curtain animations
- Interactive search functionality
- Responsive design
- User authentication
- City and tourist spot details
- Contact form with validation

## 🔐 Authentication

TripGo uses Supabase for user authentication, providing:
- Secure user registration and login
- Password recovery
- Session management
- Protected routes

## 🎯 Future Enhancements

- [ ] Add booking functionality
- [ ] Implement user reviews and ratings
- [ ] Add multi-language support
- [ ] Integrate weather information
- [ ] Add travel itinerary planner
- [ ] Implement social sharing features

### `npm run build`
## 🤝 Contributing

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
Contributions are welcome! Please feel free to submit a Pull Request.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
1. Fork the project
2. Create your feature branch (\`git checkout -b feature/AmazingFeature\`)
3. Commit your changes (\`git commit -m 'Add some AmazingFeature'\`)
4. Push to the branch (\`git push origin feature/AmazingFeature\`)
5. Open a Pull Request

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
## 📄 License

### `npm run eject`
This project is licensed under the MIT License - see the LICENSE file for details.

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
## 👥 Authors

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
- **Shruti Kulkarni** - *Initial work* - [shrutu0929](https://github.com/shrutu0929)

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
## 🙏 Acknowledgments

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
- Thanks to all contributors who have helped shape TripGo
- Special thanks to the React and TypeScript communities
- Image credits to respective photographers

## Learn More
## 📞 Contact

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
For any queries or suggestions, please reach out through:
- GitHub Issues
- Project Email: [your-email@example.com]

To learn React, check out the [React documentation](https://reactjs.org/).
---

Made with ❤️ by Shruti Kulkarni
5 changes: 5 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import About from './pages/About';
import Contact from './pages/Contact';
import Login from './pages/Login';
import SignUp from './pages/SignUp';
import VerifyEmail from './pages/VerifyEmail';
import FeatureDetails from './components/FeatureDetails';
import CurtainAnimation from './components/CurtainAnimation';
import { supabase } from './config/supabaseClient';
Expand Down Expand Up @@ -143,6 +144,10 @@ function App() {
)
}
/>
<Route
path="/verify"
element={<VerifyEmail />}
/>
<Route
path="/features/:featureId"
element={
Expand Down
121 changes: 121 additions & 0 deletions src/components/OTPVerification.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import React, { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { supabase } from '../config/supabaseClient';
import Loader from './Loader';
import '../styles/Login.css';

interface OTPVerificationProps {
email: string;
}

const OTPVerification: React.FC<OTPVerificationProps> = ({ email }) => {
const [otp, setOtp] = useState('');
const [error, setError] = useState('');
const [isLoading, setIsLoading] = useState(false);
const navigate = useNavigate();

const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();

if (!otp) {
setError('Please enter the OTP');
return;
}

try {
setIsLoading(true);
setError('');

console.log('Verifying OTP for email:', email);

console.log('Verifying OTP for email:', email);

// Verify OTP
const { data, error: verifyError } = await supabase.auth.verifyOtp({
email,
token: otp,
type: 'magiclink'
});

console.log('Verification response:', data);

if (verifyError) {
console.error('Verification error:', verifyError);
throw verifyError;
}

// If verification successful, redirect to login
navigate('/login');
} catch (error) {
setError(error instanceof Error ? error.message : 'Failed to verify OTP');
} finally {
setIsLoading(false);
}
};

const handleResendOTP = async () => {
try {
setIsLoading(true);
setError('');

console.log('Requesting new OTP for email:', email);

// Resend OTP
const { error: resendError } = await supabase.auth.signInWithOtp({
phone: email, // Using email instead of phone
options: {
channel: 'sms',
shouldCreateUser: false
}
});

if (resendError) {
console.error('Error resending OTP:', resendError);
throw resendError;
}

console.log('New OTP email sent successfully');

alert('New OTP has been sent to your email');
} catch (error) {
setError(error instanceof Error ? error.message : 'Failed to resend OTP');
} finally {
setIsLoading(false);
}
};

return (
<>
{isLoading && <Loader />}
<div className="login-box">
<h2>
<span className="title-trip">Trip</span>
<span className="title-go">Go</span>
</h2>
<p className="subtitle">Verify Your Email</p>
{error && <div className="error-message">{error}</div>}
<form onSubmit={handleSubmit}>
<div className="form-group">
<label htmlFor="otp">Enter OTP</label>
<input
type="text"
id="otp"
value={otp}
onChange={(e) => setOtp(e.target.value)}
placeholder="Enter OTP from your email"
required
/>
</div>
<button type="submit" className="login-button">
Verify OTP
</button>
</form>
<p className="signup-link">
Didn't receive OTP? <button onClick={handleResendOTP} className="resend-button">Resend OTP</button>
</p>
</div>
</>
);
};

export default OTPVerification;
Loading