Uber
Build a full-stack Uber Clone Application with Expo’s latest features and lightning-fast edge-ready Postgres database in React Native.
Install / Use
/learn @adrianhajdin/UberREADME
📋 <a name="table">Table of Contents</a>
- 🤖 Introduction
- ⚙️ Tech Stack
- 🔋 Features
- 🤸 Quick Start
- 🕸️ Snippets (Code to Copy)
- 🖇️ Links
- 📦 Assets
- 🚀 More
🚨 Tutorial
This repository contains the code corresponding to an in-depth tutorial available on our YouTube channel, <a href="https://www.youtube.com/@javascriptmastery/videos" target="_blank"><b>JavaScript Mastery</b></a>.
If you prefer visual learning, this is the perfect resource for you. Follow our tutorial to learn how to build projects like these step-by-step in a beginner-friendly manner!
<a href="https://youtu.be/kmy_YNhl0mw" target="_blank"><img src="https://github.com/sujatagunale/EasyRead/assets/151519281/1736fca5-a031-4854-8c09-bc110e3bc16d" /></a>
<a name="introduction">🤖 Introduction</a>
Built with React Native for handling the user interface, Google Maps for rendering maps with directions, stripe for handling payments, serverless Postgres for managing databases, and styled with TailwindCSS, Uber Clone is a perfect mobile app. The primary goal is to demonstrate how to develop full-stack mobile applications to showcase the developer's skills in a unique manner that creates a lasting impact.
If you're getting started and need assistance or face any bugs, join our active Discord community with over 34k+ members. It's a place where people help each other out.
<a href="https://discord.com/invite/n6EdbFJ" target="_blank"><img src="https://github.com/sujatagunale/EasyRead/assets/151519281/618f4872-1e10-42da-8213-1d69e486d02e" /></a>
<a name="tech-stack">⚙️ Tech Stack</a>
- React Native
- Expo
- Stripe
- PostgreSQL
- Google Maps
- zustand
- Clerk
- Tailwind CSS
<a name="features">🔋 Features</a>
👉 Onboarding Flow: Seamless user registration and setup process.
👉 Email Password Authentication with Verification: Secure login with email verification.
👉 oAuth Using Google: Easy login using Google credentials.
👉 Authorization: Secure access control for different user roles.
👉 Home Screen with Live Location & Google Map: Real-time location tracking with markers on a map.
👉 Recent Rides: View a list of recent rides at a glance.
👉 Google Places Autocomplete: Search any place on Earth with autocomplete suggestions.
👉 Find Rides: Search for rides by entering 'From' and 'To' locations.
👉 Select Rides from Map: Choose available cars near your location from the map.
👉 Confirm Ride with Detailed Information: View complete ride details, including time and fare price.
👉 Pay for Ride Using Stripe: Make payments using multiple methods like cards and others.
👉 Create Rides After Successful Payment: Book a ride after confirming payment.
👉 Profile: Manage account details in the profile screen.
👉 History: Review all rides booked so far.
👉 Responsive on Android and iOS: Optimized for both Android and iOS devices.
and many more, including code architecture and reusability
<a name="quick-start">🤸 Quick Start</a>
Follow these steps to set up the project locally on your machine.
Prerequisites
Make sure you have the following installed on your machine:
Cloning the Repository
git clone https://github.com/JavaScript-Mastery-Pro/uber.git
cd uber
Installation
Install the project dependencies using npm:
npm install
Set Up Environment Variables
Create a new file named .env in the root of your project and add the following content:
EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=
EXPO_PUBLIC_PLACES_API_KEY=
EXPO_PUBLIC_DIRECTIONS_API_KEY=
DATABASE_URL=
EXPO_PUBLIC_SERVER_URL=https://uber.dev/
EXPO_PUBLIC_GEOAPIFY_API_KEY=
EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY=
STRIPE_SECRET_KEY=
Replace the placeholder values with your actual Clerk, Stripe, NeonDB, Google Maps, andgeoapify credentials. You can obtain these credentials by signing up on the Clerk, Stripe, NeonDB, Google Maps and geoapify websites respectively.
Running the Project
npx expo start
Download the Expo Go app and Scan the QR code on your respective device to view the project.
<a name="snippets">🕸️ Snippets</a>
Here are some code snippets from the project to help you get started quickly.
Setup
<details> <summary><code>.vscode/settings.json</code></summary>{
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}
</details>
<details>
<summary><code>tailwind.config.js</code></summary>
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./app/**/*.{js,jsx,ts,tsx}", "./components/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {
fontFamily: {
Jakarta: ["Jakarta", "sans-serif"],
JakartaBold: ["Jakarta-Bold", "sans-serif"],
JakartaExtraBold: ["Jakarta-ExtraBold", "sans-serif"],
JakartaExtraLight: ["Jakarta-ExtraLight", "sans-serif"],
JakartaLight: ["Jakarta-Light", "sans-serif"],
JakartaMedium: ["Jakarta-Medium", "sans-serif"],
JakartaSemiBold: ["Jakarta-SemiBold", "sans-serif"],
},
colors: {
primary: {
100: "#F5F8FF",
200: "#EBF4FF",
300: "#C3D9FF",
400: "#9BBFFF",
500: "#0286FF",
600: "#6A85E6",
700: "#475A99",
800: "#364573",
900: "#242B4D",
},
secondary: {
100: "#F8F8F8",
200: "#F1F1F1",
300: "#D9D9D9",
400: "#C2C2C2",
500: "#AAAAAA",
600: "#999999",
700: "#666666",
800: "#4D4D4D",
900: "#333333",
},
success: {
100: "#F0FFF4",
200: "#C6F6D5",
300: "#9AE6B4",
400: "#68D391",
500: "#38A169",
600: "#2F855A",
700: "#276749",
800: "#22543D",
900: "#1C4532",
},
danger: {
100: "#FFF5F5",
200: "#FED7D7",
300: "#FEB2B2",
400: "#FC8181",
500: "#F56565",
600: "#E53E3E",
700: "#C53030",
800: "#9B2C2C",
900: "#742A2A",
},
warning: {
100: "#FFFBEB",
200: "#FEF3C7",
300: "#FDE68A",
400: "#FACC15",
500: "#EAB308",
600: "#CA8A04",
700: "#A16207",
800: "#854D0E",
900: "#713F12",
},
general: {
100: "#CED1DD",
200: "#858585",
300: "#EEEEEE",
400: "#0CC25F",
500: "#F6F8FA",
600: "#E6F3FF",
700: "#EBEBEB",
800: "#ADADAD",
},
},
},
},
plugins: [],
};
</details>
<details>
<summary><code>types/type.d.ts</code></summary>
import {TextInputProps, TouchableOpacityProps} from "react-native";
declare interface Driver {
driver_id: number;
first_name: string;
last_name: string;
profile_image_url: string;
car_image_url: string;
car_seats: number;
rating: number;
}
declare interface MarkerData {
latitude: number;
longitude: number;
id: number;
title: string;
profile_image_url: string;
car_image_url: string;
car_seats: number;
rating: number;
first_name: string;
last_name: string;
time?: number;
price?: string;
}
declare interface MapProps {
destinationLatitude?: number;
destinationLongitude?: number;
onDriverTimesCalculated?: (driversWithTimes: MarkerData[]) => void;
selectedDriver?: number | null
