├── README.md
├── swiggy-x-backend
├── Paytm
│ ├── Checksum.py
│ ├── PaymentViews.py
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── Checksum.cpython-310.pyc
│ │ ├── PaymentViews.cpython-310.pyc
│ │ ├── __init__.cpython-310.pyc
│ │ ├── admin.cpython-310.pyc
│ │ ├── apps.cpython-310.pyc
│ │ ├── models.cpython-310.pyc
│ │ ├── urls.cpython-310.pyc
│ │ └── views.cpython-310.pyc
│ ├── admin.py
│ ├── apps.py
│ ├── migrations
│ │ ├── 0001_initial.py
│ │ ├── __init__.py
│ │ └── __pycache__
│ │ │ ├── 0001_initial.cpython-310.pyc
│ │ │ └── __init__.cpython-310.pyc
│ ├── models.py
│ ├── templates
│ │ └── paytm
│ │ │ ├── ReactNativeCustomPayment.html
│ │ │ ├── paymentstatus.html
│ │ │ └── redirect.html
│ ├── tests.py
│ ├── urls.py
│ └── views.py
├── db.sqlite3
├── manage.py
├── static
│ └── img
│ │ └── pleasewait.gif
└── swiggyx
│ ├── __init__.py
│ ├── __pycache__
│ ├── __init__.cpython-310.pyc
│ ├── settings.cpython-310.pyc
│ ├── urls.cpython-310.pyc
│ └── wsgi.cpython-310.pyc
│ ├── asgi.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
└── swiggy-x-frontend
├── App.js
├── Routes.js
├── assets
├── animations
│ ├── cooking.json
│ ├── failed.json
│ ├── foodapp.json
│ ├── scanner.json
│ └── success.json
└── images
│ ├── bread.png
│ ├── coffee.png
│ ├── fast-food.png
│ ├── food-app-1.png
│ ├── food-app-2.png
│ ├── food-app-3.png
│ ├── food-app-4.png
│ ├── food-app-5.png
│ ├── food-app-6.png
│ ├── pizza.png
│ └── soft-drink.png
├── babel.config.js
├── components
├── home
│ ├── Category.js
│ ├── Footer.js
│ ├── Header.js
│ ├── Restaurant.js
│ └── SearchBar.js
└── restaurant
│ ├── About.js
│ ├── MenuItem.js
│ ├── OrderItem.js
│ └── ViewCart.js
├── constants
└── index.js
├── package-lock.json
├── package.json
├── pages
├── Account.js
├── Home.js
├── Order.js
└── RestaurantDetail.js
└── redux
├── reducers
├── browseReducer.js
├── cartReducer.js
└── orderReducer.js
└── store.js
/README.md:
--------------------------------------------------------------------------------
1 | # Food-Delivery-App ( React Native + Django )
2 |
3 |
8 |
9 |
14 |
15 | Changes you have to made to backend.
16 | 1. In backend edit PaymentViews.py file and write your own Paytm MERCHANT_ID and MERCHANT_KEY
17 | 2. In the same file your have to write your own website url http://example.com/
18 |
19 | Changes you have to made to frontend.
20 | 1. Open constant/index.js and write you website url where you have hosted your backend project like "http://example.com/paytm"
21 |
22 | # Frontend Only
23 | You can also run only frontend part . Simple clone and run npm install . Howenver backend has been used only for payment purpose..
24 |
25 | # Note :-
26 | React native axios request will give error while creating order as localhost is not allowed in react-native-axios you can connect your localhost port to a public url using ngrok easily using command - ngrok.exe http 8000 > hit Enter and then metioned that url in Constants.js . Check this out you will love it , otherwise you need a domain name , or you can host backend on free platform like pythonanywhere.com etc...
27 |
28 | # Enjoy 🥳🥳🥳🥳
29 |
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/Checksum.py:
--------------------------------------------------------------------------------
1 | # pip install pycryptodome
2 | import base64
3 | import string
4 | import random
5 | import hashlib
6 |
7 | from Crypto.Cipher import AES
8 |
9 |
10 | IV = "@@@@&&&###$$$$"
11 | BLOCK_SIZE = 16
12 |
13 | # This code is provided by paytm to create a checksum
14 |
15 | def generate_checksum(param_dict, merchant_key, salt=None):
16 | params_string = __get_param_string__(param_dict)
17 | salt = salt if salt else __id_generator__(4)
18 | final_string = '%s|%s' % (params_string, salt)
19 |
20 | hasher = hashlib.sha256(final_string.encode())
21 | hash_string = hasher.hexdigest()
22 |
23 | hash_string += salt
24 |
25 | return __encode__(hash_string, IV, merchant_key)
26 |
27 | def generate_refund_checksum(param_dict, merchant_key, salt=None):
28 | for i in param_dict:
29 | if("|" in param_dict[i]):
30 | param_dict = {}
31 | exit()
32 | params_string = __get_param_string__(param_dict)
33 | salt = salt if salt else __id_generator__(4)
34 | final_string = '%s|%s' % (params_string, salt)
35 |
36 | hasher = hashlib.sha256(final_string.encode())
37 | hash_string = hasher.hexdigest()
38 |
39 | hash_string += salt
40 |
41 | return __encode__(hash_string, IV, merchant_key)
42 |
43 |
44 | def generate_checksum_by_str(param_str, merchant_key, salt=None):
45 | params_string = param_str
46 | salt = salt if salt else __id_generator__(4)
47 | final_string = '%s|%s' % (params_string, salt)
48 |
49 | hasher = hashlib.sha256(final_string.encode())
50 | hash_string = hasher.hexdigest()
51 |
52 | hash_string += salt
53 |
54 | return __encode__(hash_string, IV, merchant_key)
55 |
56 |
57 | def verify_checksum(param_dict, merchant_key, checksum):
58 | # Remove checksum
59 | if 'CHECKSUMHASH' in param_dict:
60 | param_dict.pop('CHECKSUMHASH')
61 |
62 | # Get salt
63 | paytm_hash = __decode__(checksum, IV, merchant_key)
64 | salt = paytm_hash[-4:]
65 | calculated_checksum = generate_checksum(param_dict, merchant_key, salt=salt)
66 | return calculated_checksum == checksum
67 |
68 | def verify_checksum_by_str(param_str, merchant_key, checksum):
69 | # Remove checksum
70 | #if 'CHECKSUMHASH' in param_dict:
71 | #param_dict.pop('CHECKSUMHASH')
72 |
73 | # Get salt
74 | paytm_hash = __decode__(checksum, IV, merchant_key)
75 | salt = paytm_hash[-4:]
76 | calculated_checksum = generate_checksum_by_str(param_str, merchant_key, salt=salt)
77 | return calculated_checksum == checksum
78 |
79 |
80 |
81 | def __id_generator__(size=6, chars=string.ascii_uppercase + string.digits + string.ascii_lowercase):
82 | return ''.join(random.choice(chars) for _ in range(size))
83 |
84 |
85 | def __get_param_string__(params):
86 | params_string = []
87 | for key in sorted(params.keys()):
88 | if("REFUND" in params[key] or "|" in params[key]):
89 | respons_dict = {}
90 | exit()
91 | value = params[key]
92 | params_string.append('' if value == 'null' else str(value))
93 | return '|'.join(params_string)
94 |
95 |
96 | __pad__ = lambda s: s + (BLOCK_SIZE - len(s) % BLOCK_SIZE) * chr(BLOCK_SIZE - len(s) % BLOCK_SIZE)
97 | __unpad__ = lambda s: s[0:-ord(s[-1])]
98 |
99 |
100 | def __encode__(to_encode, iv, key):
101 | # Pad
102 | to_encode = __pad__(to_encode)
103 | # Encrypt
104 | c = AES.new(key.encode('utf-8'), AES.MODE_CBC, iv.encode('utf-8'))
105 | to_encode = c.encrypt(to_encode.encode('utf-8'))
106 | # Encode
107 | to_encode = base64.b64encode(to_encode)
108 | return to_encode.decode("UTF-8")
109 |
110 |
111 | def __decode__(to_decode, iv, key):
112 | # Decode
113 | to_decode = base64.b64decode(to_decode)
114 | # Decrypt
115 | c = AES.new(key.encode('utf-8'), AES.MODE_CBC, iv.encode('utf-8'))
116 | to_decode = c.decrypt(to_decode)
117 | if type(to_decode) == bytes:
118 | # convert bytes array to str.
119 | to_decode = to_decode.decode()
120 | # remove pad
121 | return __unpad__(to_decode)
122 |
123 |
124 | if __name__ == "__main__":
125 | params = {
126 | "MID": "mid",
127 | "ORDER_ID": "order_id",
128 | "CUST_ID": "cust_id",
129 | "TXN_AMOUNT": "1",
130 | "CHANNEL_ID": "WEB",
131 | "INDUSTRY_TYPE_ID": "Retail",
132 | "WEBSITE": "xxxxxxxxxxx"
133 | }
134 |
135 | print(verify_checksum(
136 | params, 'xxxxxxxxxxxxxxxx',
137 | "CD5ndX8VVjlzjWbbYoAtKQIlvtXPypQYOg0Fi2AUYKXZA5XSHiRF0FDj7vQu66S8MHx9NaDZ/uYm3WBOWHf+sDQAmTyxqUipA7i1nILlxrk="))
138 |
139 | # print(generate_checksum(params, "xxxxxxxxxxxxxxxx"))
140 |
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/PaymentViews.py:
--------------------------------------------------------------------------------
1 | import environ
2 | from django.shortcuts import render
3 | from rest_framework.decorators import api_view
4 | from rest_framework.response import Response
5 |
6 | from .models import FoodOrder
7 | from . import Checksum
8 |
9 | env = environ.Env()
10 |
11 | environ.Env.read_env()
12 |
13 |
14 | @api_view(['POST'])
15 | def start_payment(request):
16 | OrderID = request.data['OrderID']
17 |
18 | ValidOrderId = OrderID.split('-')
19 |
20 | order = FoodOrder.objects.get(id=int(ValidOrderId[-1]))
21 |
22 | param_dict = {
23 | 'MID': 'MERCHANT_ID', # WRITE YOUR OWN PAYTM MERCHANT ID...... ! IMPORTANT
24 | 'ORDER_ID': 'Order-ID-' + str(order.id),
25 | 'TXN_AMOUNT': str(order.Amount),
26 | 'CUST_ID': 'Customer-ID-' + str(order.id),
27 | 'INDUSTRY_TYPE_ID': 'Retail',
28 | 'WEBSITE': 'WEBSTAGING',
29 | 'CHANNEL_ID': 'WEB',
30 | 'CALLBACK_URL': 'http://xyz.com/paytm/handlepayment/', # In my Case it was http://anjali1196.pythonanywhere.com/paytm/handlepayment/
31 | }
32 |
33 | param_dict['CHECKSUMHASH'] = Checksum.generate_checksum(
34 | param_dict, "MERCHANT_KEY") # Your merchant key...
35 |
36 | return render(request, 'paytm/redirect.html', {
37 | 'MID': param_dict.get('MID'),
38 | 'ORDER_ID': param_dict.get('ORDER_ID'),
39 | 'TXN_AMOUNT': param_dict.get('TXN_AMOUNT'),
40 | 'CUST_ID': param_dict.get('CUST_ID'),
41 | 'INDUSTRY_TYPE_ID': param_dict.get('INDUSTRY_TYPE_ID'),
42 | 'WEBSITE': param_dict.get('WEBSITE'),
43 | 'CHANNEL_ID': param_dict.get('CHANNEL_ID'),
44 | 'WEB': param_dict.get('WEB'),
45 | 'CALLBACK_URL': param_dict.get('CALLBACK_URL'),
46 | 'CHECKSUMHASH': param_dict.get('CHECKSUMHASH')
47 | })
48 |
49 |
50 | @api_view(['POST'])
51 | def handlepayment(request):
52 | checksum = ""
53 | form = request.POST
54 |
55 | response_dict = {}
56 | order = None
57 |
58 | for i in form.keys():
59 | response_dict[i] = form[i]
60 | if i == 'CHECKSUMHASH':
61 | checksum = form[i]
62 |
63 | if i == 'ORDERID':
64 | id=form[i]
65 | ExtractID = id.split('-')
66 | fdorder = FoodOrder.objects.get(id=int(ExtractID[-1]))
67 | fdorder.isPaid = True
68 | fdorder.save()
69 |
70 | verify = Checksum.verify_checksum(
71 | response_dict, "MERCHANT_KEY", checksum) # WRITE YOUR OWN MERCHANT KEY...
72 |
73 | if verify:
74 | if response_dict['RESPCODE'] == '01':
75 | print('order successful')
76 | return render(request, 'paytm/paymentstatus.html', {'response': response_dict})
77 | else:
78 | print('order was not successful because' +
79 | response_dict['RESPMSG'])
80 | return render(request, 'paytm/paymentstatus.html', {'response': response_dict})
81 |
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/Paytm/__init__.py
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/__pycache__/Checksum.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/Paytm/__pycache__/Checksum.cpython-310.pyc
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/__pycache__/PaymentViews.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/Paytm/__pycache__/PaymentViews.cpython-310.pyc
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/__pycache__/__init__.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/Paytm/__pycache__/__init__.cpython-310.pyc
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/__pycache__/admin.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/Paytm/__pycache__/admin.cpython-310.pyc
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/__pycache__/apps.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/Paytm/__pycache__/apps.cpython-310.pyc
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/__pycache__/models.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/Paytm/__pycache__/models.cpython-310.pyc
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/__pycache__/urls.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/Paytm/__pycache__/urls.cpython-310.pyc
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/__pycache__/views.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/Paytm/__pycache__/views.cpython-310.pyc
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 |
3 | from Paytm.models import FoodOrder,FoodOrderItem
4 |
5 | admin.site.register(FoodOrder)
6 | admin.site.register(FoodOrderItem)
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class PaytmConfig(AppConfig):
5 | default_auto_field = 'django.db.models.BigAutoField'
6 | name = 'Paytm'
7 |
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/migrations/0001_initial.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 3.2.8 on 2022-01-21 05:20
2 |
3 | from django.db import migrations, models
4 | import django.db.models.deletion
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | initial = True
10 |
11 | dependencies = [
12 | ]
13 |
14 | operations = [
15 | migrations.CreateModel(
16 | name='FoodOrder',
17 | fields=[
18 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
19 | ('RestaurantID', models.CharField(max_length=100)),
20 | ('RestaurantName', models.CharField(max_length=100)),
21 | ('Amount', models.FloatField()),
22 | ('isPaid', models.BooleanField(default=False)),
23 | ('OrderDate', models.DateTimeField(auto_now=True)),
24 | ],
25 | ),
26 | migrations.CreateModel(
27 | name='FoodOrderItem',
28 | fields=[
29 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
30 | ('FoodId', models.CharField(max_length=100)),
31 | ('FoodImage', models.CharField(max_length=1000)),
32 | ('FoodTitle', models.CharField(max_length=100)),
33 | ('FoodPrice', models.IntegerField()),
34 | ('FoodQuantity', models.IntegerField()),
35 | ('RatingCount', models.FloatField()),
36 | ('orderID', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Paytm.foodorder')),
37 | ],
38 | ),
39 | ]
40 |
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/migrations/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/Paytm/migrations/__init__.py
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/migrations/__pycache__/0001_initial.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/Paytm/migrations/__pycache__/0001_initial.cpython-310.pyc
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/migrations/__pycache__/__init__.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/Paytm/migrations/__pycache__/__init__.cpython-310.pyc
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 | # Create your models here.
3 |
4 |
5 | class FoodOrder(models.Model):
6 | RestaurantID = models.CharField(max_length=100)
7 | RestaurantName = models.CharField(max_length=100)
8 | Amount = models.FloatField()
9 | isPaid = models.BooleanField(default=False)
10 | OrderDate = models.DateTimeField(auto_now=True)
11 |
12 |
13 | class FoodOrderItem(models.Model):
14 | FoodId = models.CharField(max_length=100)
15 | FoodImage = models.CharField(max_length=1000)
16 | FoodTitle = models.CharField(max_length=100)
17 | FoodPrice = models.IntegerField()
18 | FoodQuantity = models.IntegerField()
19 | RatingCount = models.FloatField()
20 | orderID = models.ForeignKey(FoodOrder, on_delete=models.CASCADE)
21 |
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/templates/paytm/ReactNativeCustomPayment.html:
--------------------------------------------------------------------------------
1 | {% load static %}
2 |
3 |
4 |
5 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/templates/paytm/paymentstatus.html:
--------------------------------------------------------------------------------
1 | {% load static %}
2 |
3 |
4 |
5 |
6 |
7 |
8 | {% if response.STATUS == "TXN_SUCCESS" %} Transaction Successful {% else %} Transaction Failed {% endif %}
9 |
10 |
40 |
41 |
42 |
43 |
44 |
45 |

46 |
47 |
48 |
49 |
50 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Paytm Pay
11 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |

48 |
49 |
50 |
51 |
63 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/urls.py:
--------------------------------------------------------------------------------
1 | from django.urls import path
2 | from Paytm import PaymentViews, views
3 |
4 |
5 | urlpatterns = [
6 | # Payments urls
7 |
8 | # Creating Order
9 | path('create-order/',views.CreateOrder,name='create-order'),
10 |
11 | # First Step
12 | path('ReactNativeCustomPayment/',views.ReactNativeCustomPayment,name='ReactNativeCustomPayment'),
13 |
14 | # Second Step When ReactNativeCustomPayment Form Will Be Submited.
15 | path('pay/', PaymentViews.start_payment, name="start_payment"),
16 |
17 | # If Second Step Succed It Will Push To THis URL Which Will Send To Paytm Payment GateWay.
18 | path('handlepayment/', PaymentViews.handlepayment, name="handlepayment"),
19 |
20 | ]
--------------------------------------------------------------------------------
/swiggy-x-backend/Paytm/views.py:
--------------------------------------------------------------------------------
1 | from django.shortcuts import render
2 | from django.http import JsonResponse
3 | from .models import FoodOrder, FoodOrderItem
4 | import json
5 |
6 |
7 | def CreateOrder(request):
8 | tree = request.GET.get('FoodData')
9 | FoodData = json.loads(tree)
10 |
11 | Restaurant = FoodData.get('RestaurantDetail')
12 | Amount = FoodData.get('TotalAmount')
13 | FoodItems = FoodData.get('FoodItems')
14 |
15 | order = FoodOrder.objects.create(
16 | RestaurantID=Restaurant.get('Res_id'),
17 | RestaurantName=Restaurant.get('Res_Name'),
18 | Amount=Amount
19 | )
20 |
21 | for i in FoodItems:
22 | FoodOrderItem.objects.create(
23 | FoodId = i.get('FoodId'),
24 | FoodImage = i.get('FoodImage'),
25 | FoodTitle = i.get('FoodTitle'),
26 | FoodPrice = i.get('FoodPrice'),
27 | FoodQuantity = i.get('FoodQuantity'),
28 | RatingCount = i.get('RatingCount'),
29 | orderID = FoodOrder(order.id)
30 | )
31 |
32 | return JsonResponse({"OrderID": f"FoodOrderID-{order.id}"})
33 |
34 | def ReactNativeCustomPayment(request):
35 | return render(request,'paytm/ReactNativeCustomPayment.html')
--------------------------------------------------------------------------------
/swiggy-x-backend/db.sqlite3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/db.sqlite3
--------------------------------------------------------------------------------
/swiggy-x-backend/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | """Django's command-line utility for administrative tasks."""
3 | import os
4 | import sys
5 |
6 |
7 | def main():
8 | """Run administrative tasks."""
9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'swiggyx.settings')
10 | try:
11 | from django.core.management import execute_from_command_line
12 | except ImportError as exc:
13 | raise ImportError(
14 | "Couldn't import Django. Are you sure it's installed and "
15 | "available on your PYTHONPATH environment variable? Did you "
16 | "forget to activate a virtual environment?"
17 | ) from exc
18 | execute_from_command_line(sys.argv)
19 |
20 |
21 | if __name__ == '__main__':
22 | main()
23 |
--------------------------------------------------------------------------------
/swiggy-x-backend/static/img/pleasewait.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/static/img/pleasewait.gif
--------------------------------------------------------------------------------
/swiggy-x-backend/swiggyx/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/swiggyx/__init__.py
--------------------------------------------------------------------------------
/swiggy-x-backend/swiggyx/__pycache__/__init__.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/swiggyx/__pycache__/__init__.cpython-310.pyc
--------------------------------------------------------------------------------
/swiggy-x-backend/swiggyx/__pycache__/settings.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/swiggyx/__pycache__/settings.cpython-310.pyc
--------------------------------------------------------------------------------
/swiggy-x-backend/swiggyx/__pycache__/urls.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/swiggyx/__pycache__/urls.cpython-310.pyc
--------------------------------------------------------------------------------
/swiggy-x-backend/swiggyx/__pycache__/wsgi.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-backend/swiggyx/__pycache__/wsgi.cpython-310.pyc
--------------------------------------------------------------------------------
/swiggy-x-backend/swiggyx/asgi.py:
--------------------------------------------------------------------------------
1 | """
2 | ASGI config for swiggyx project.
3 |
4 | It exposes the ASGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.asgi import get_asgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'swiggyx.settings')
15 |
16 | application = get_asgi_application()
17 |
--------------------------------------------------------------------------------
/swiggy-x-backend/swiggyx/settings.py:
--------------------------------------------------------------------------------
1 | """
2 | Django settings for swiggyx project.
3 |
4 | Generated by 'django-admin startproject' using Django 3.2.8.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/3.2/topics/settings/
8 |
9 | For the full list of settings and their values, see
10 | https://docs.djangoproject.com/en/3.2/ref/settings/
11 | """
12 |
13 | from pathlib import Path
14 | import os
15 | # Build paths inside the project like this: BASE_DIR / 'subdir'.
16 | BASE_DIR = Path(__file__).resolve().parent.parent
17 |
18 |
19 | # Quick-start development settings - unsuitable for production
20 | # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
21 |
22 | # SECURITY WARNING: keep the secret key used in production secret!
23 | SECRET_KEY = 'django-insecure-c@r62!)$h%qpmx47cy&84z#t2#-47#ifuv13yn^o2+vf^=eu80'
24 |
25 | # SECURITY WARNING: don't run with debug turned on in production!
26 | DEBUG = True
27 |
28 | CORS_ALLOW_ALL_ORIGINS = True
29 |
30 | ALLOWED_HOSTS = []
31 |
32 |
33 | # Application definition
34 |
35 | INSTALLED_APPS = [
36 | 'django.contrib.admin',
37 | 'django.contrib.auth',
38 | 'django.contrib.contenttypes',
39 | 'django.contrib.sessions',
40 | 'django.contrib.messages',
41 | 'django.contrib.staticfiles',
42 | 'Paytm',
43 | 'corsheaders',
44 | 'rest_framework'
45 | ]
46 |
47 | MIDDLEWARE = [
48 | 'corsheaders.middleware.CorsMiddleware',
49 | 'django.middleware.security.SecurityMiddleware',
50 | 'django.contrib.sessions.middleware.SessionMiddleware',
51 | 'django.middleware.common.CommonMiddleware',
52 | 'django.middleware.csrf.CsrfViewMiddleware',
53 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
54 | 'django.contrib.messages.middleware.MessageMiddleware',
55 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
56 | ]
57 |
58 | ROOT_URLCONF = 'swiggyx.urls'
59 |
60 | TEMPLATES = [
61 | {
62 | 'BACKEND': 'django.template.backends.django.DjangoTemplates',
63 | 'DIRS': [],
64 | 'APP_DIRS': True,
65 | 'OPTIONS': {
66 | 'context_processors': [
67 | 'django.template.context_processors.debug',
68 | 'django.template.context_processors.request',
69 | 'django.contrib.auth.context_processors.auth',
70 | 'django.contrib.messages.context_processors.messages',
71 | ],
72 | },
73 | },
74 | ]
75 |
76 | WSGI_APPLICATION = 'swiggyx.wsgi.application'
77 |
78 |
79 | # Database
80 | # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
81 |
82 | DATABASES = {
83 | 'default': {
84 | 'ENGINE': 'django.db.backends.sqlite3',
85 | 'NAME': BASE_DIR / 'db.sqlite3',
86 | }
87 | }
88 |
89 |
90 | # Password validation
91 | # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
92 |
93 | AUTH_PASSWORD_VALIDATORS = [
94 | {
95 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
96 | },
97 | {
98 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
99 | },
100 | {
101 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
102 | },
103 | {
104 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
105 | },
106 | ]
107 |
108 |
109 | # Internationalization
110 | # https://docs.djangoproject.com/en/3.2/topics/i18n/
111 |
112 | LANGUAGE_CODE = 'en-us'
113 |
114 | TIME_ZONE = 'UTC'
115 |
116 | USE_I18N = True
117 |
118 | USE_L10N = True
119 |
120 | USE_TZ = True
121 |
122 |
123 | # Static files (CSS, JavaScript, Images)
124 | # https://docs.djangoproject.com/en/3.2/howto/static-files/
125 |
126 | STATIC_URL = '/static/'
127 | STATICFILES_DIRS = [
128 | os.path.join(BASE_DIR, "static")
129 | ]
130 |
131 | # Default primary key field type
132 | # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
133 |
134 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
135 |
--------------------------------------------------------------------------------
/swiggy-x-backend/swiggyx/urls.py:
--------------------------------------------------------------------------------
1 | """swiggyx URL Configuration
2 |
3 | The `urlpatterns` list routes URLs to views. For more information please see:
4 | https://docs.djangoproject.com/en/3.2/topics/http/urls/
5 | Examples:
6 | Function views
7 | 1. Add an import: from my_app import views
8 | 2. Add a URL to urlpatterns: path('', views.home, name='home')
9 | Class-based views
10 | 1. Add an import: from other_app.views import Home
11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12 | Including another URLconf
13 | 1. Import the include() function: from django.urls import include, path
14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15 | """
16 | from django.contrib import admin
17 | from django.urls import path, include
18 |
19 | urlpatterns = [
20 | path('admin/', admin.site.urls),
21 |
22 | # Payments urls
23 | path('paytm/', include('Paytm.urls'))
24 | ]
25 |
--------------------------------------------------------------------------------
/swiggy-x-backend/swiggyx/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for swiggyx project.
3 |
4 | It exposes the WSGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.wsgi import get_wsgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'swiggyx.settings')
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------
/swiggy-x-frontend/App.js:
--------------------------------------------------------------------------------
1 | import { React, useEffect, useState } from 'react';
2 | import { View } from 'react-native'
3 | import RootNavigation from "./Routes";
4 | import LottieView from 'lottie-react-native';
5 |
6 |
7 |
8 | export default function App() {
9 |
10 | const [loading, setLoading] = useState(true)
11 |
12 | useEffect(() => {
13 | setTimeout(() => {
14 | setLoading(false)
15 | }, 1000)
16 | }, [])
17 |
18 | return (
19 | <>
20 | {
21 | loading ?
22 |
28 |
38 |
39 | :
40 |
41 | }
42 | >
43 | );
44 | }
45 |
46 |
--------------------------------------------------------------------------------
/swiggy-x-frontend/Routes.js:
--------------------------------------------------------------------------------
1 | import { createStackNavigator } from '@react-navigation/stack';
2 | import { NavigationContainer } from '@react-navigation/native';
3 | import { Provider } from 'react-redux';
4 | import { store } from './redux/store';
5 | import RestaurantDetail from './pages/RestaurantDetail';
6 | import Home from './pages/Home';
7 | import Order from './pages/Order';
8 | import Account from './pages/Account';
9 | import React from 'react';
10 |
11 |
12 | const RootNavigation = () => {
13 |
14 | const Stack = createStackNavigator()
15 |
16 | const screenOptions = {
17 | headerShown: false
18 | }
19 |
20 | return (
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | )
32 | }
33 |
34 |
35 | export default RootNavigation;
--------------------------------------------------------------------------------
/swiggy-x-frontend/assets/animations/failed.json:
--------------------------------------------------------------------------------
1 | {"v":"5.7.13","fr":60,"ip":0,"op":70,"w":324,"h":394,"nm":"negative verify","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[162,197,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-58,-58.5],[58,58.75]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":15,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.35],"y":[1]},"o":{"x":[0.06],"y":[0.037]},"t":39,"s":[44]},{"t":59,"s":[100]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.35],"y":[1]},"o":{"x":[0.049],"y":[-0.015]},"t":41,"s":[44]},{"t":59,"s":[0]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":300,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[162,197,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[91.875,-91.375],[-58,58.625]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":15,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.35],"y":[1]},"o":{"x":[0.016],"y":[0.02]},"t":41,"s":[0]},{"t":59,"s":[23.8]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.218],"y":[1]},"o":{"x":[0.104],"y":[0.049]},"t":32,"s":[0]},{"t":59,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":300,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"circulo","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[162,197,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[262,262],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":15,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.35],"y":[1]},"o":{"x":[0.65],"y":[0]},"t":0,"s":[0]},{"t":35,"s":[100]}],"ix":2},"o":{"a":1,"k":[{"i":{"x":[0.35],"y":[1]},"o":{"x":[0.65],"y":[0]},"t":0,"s":[0]},{"t":32,"s":[44]}],"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":300,"st":0,"bm":0}],"markers":[]}
--------------------------------------------------------------------------------
/swiggy-x-frontend/assets/animations/scanner.json:
--------------------------------------------------------------------------------
1 | {"v":"5.1.16","fr":24,"ip":108,"op":252,"w":1500,"h":1500,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 10","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":324,"s":[50],"e":[0]},{"t":468}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[762.117,737.883,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":324,"s":[0,0,100],"e":[807.8,807.8,100]},{"t":468}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[183,183],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-1.5,1.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":4,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":324,"op":804,"st":324,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 9","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":288,"s":[50],"e":[0]},{"t":432}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[762.117,737.883,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":288,"s":[0,0,100],"e":[807.8,807.8,100]},{"t":432}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[183,183],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-1.5,1.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":4,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":288,"op":768,"st":288,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Shape Layer 8","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":252,"s":[50],"e":[0]},{"t":396}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[762.117,737.883,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":252,"s":[0,0,100],"e":[807.8,807.8,100]},{"t":396}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[183,183],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-1.5,1.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":4,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":252,"op":732,"st":252,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Shape Layer 7","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":252,"s":[50],"e":[0]},{"t":360}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[762.117,737.883,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":216,"s":[0,0,100],"e":[807.8,807.8,100]},{"t":360}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[183,183],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-1.5,1.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":4,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":216,"op":696,"st":216,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"Shape Layer 6","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":216,"s":[50],"e":[0]},{"t":324}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[762.117,737.883,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":180,"s":[0,0,100],"e":[807.8,807.8,100]},{"t":324}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[183,183],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-1.5,1.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":4,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":180,"op":660,"st":180,"bm":0},{"ddd":0,"ind":6,"ty":4,"nm":"Shape Layer 5","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":180,"s":[50],"e":[0]},{"t":288}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[762.117,737.883,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":144,"s":[0,0,100],"e":[807.8,807.8,100]},{"t":288}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[183,183],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-1.5,1.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":4,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":144,"op":624,"st":144,"bm":0},{"ddd":0,"ind":7,"ty":4,"nm":"Shape Layer 4","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":144,"s":[50],"e":[0]},{"t":252}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[762.117,737.883,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":108,"s":[0,0,100],"e":[807.8,807.8,100]},{"t":252}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[183,183],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-1.5,1.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":4,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":108,"op":588,"st":108,"bm":0},{"ddd":0,"ind":8,"ty":4,"nm":"Shape Layer 3","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":108,"s":[50],"e":[0]},{"t":216}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[762.117,737.883,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":72,"s":[0,0,100],"e":[807.8,807.8,100]},{"t":216}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[183,183],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-1.5,1.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":4,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":72,"op":552,"st":72,"bm":0},{"ddd":0,"ind":9,"ty":4,"nm":"Shape Layer 2","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":72,"s":[50],"e":[0]},{"t":180}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[762.117,737.883,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":36,"s":[0,0,100],"e":[807.8,807.8,100]},{"t":180}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[183,183],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-1.5,1.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":4,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":36,"op":516,"st":36,"bm":0},{"ddd":0,"ind":10,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":36,"s":[50],"e":[0]},{"t":144}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[762.117,737.883,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"n":["0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167","0p833_0p833_0p167_0p167"],"t":0,"s":[0,0,100],"e":[807.8,807.8,100]},{"t":144}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[183,183],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.745,0.431,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-1.5,1.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":4,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":480,"st":0,"bm":0}],"markers":[]}
--------------------------------------------------------------------------------
/swiggy-x-frontend/assets/animations/success.json:
--------------------------------------------------------------------------------
1 | {"v":"4.10.1","fr":30,"ip":0,"op":40,"w":80,"h":80,"nm":"Success Checkmark","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Check Mark","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[40,40,0],"ix":2},"a":{"a":0,"k":[-1.312,6,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-15.75,8],[-8,16],[13.125,-4]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":25,"s":[0],"e":[100]},{"t":33}],"ix":1},"e":{"a":0,"k":0,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":2,"lj":2,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":40,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Circle Flash","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":25,"s":[0],"e":[98]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":30,"s":[98],"e":[0]},{"t":38}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[40,40,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":25,"s":[0,0,100],"e":[100,100,100]},{"t":30}],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":0,"k":[64,64],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.529866635799,0.961458325386,0.448091417551,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":40,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Circle Stroke","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[39.022,39.022,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":16,"s":[100,100,100],"e":[80,80,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":22,"s":[80,80,100],"e":[120,120,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":25,"s":[120,120,100],"e":[100,100,100]},{"t":29}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[60,60],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":0,"s":[0],"e":[100]},{"t":16}],"ix":1},"e":{"a":0,"k":0,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[0.427450984716,0.800000011921,0.35686275363,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":2,"lj":2,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0.978,0.978],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":40,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Circle Green Fill","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":21,"s":[0],"e":[98]},{"t":28}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[40,40,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":21,"s":[0,0,100],"e":[100,100,100]},{"t":28}],"ix":6}},"ao":0,"shapes":[{"d":1,"ty":"el","s":{"a":0,"k":[64,64],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.427450984716,0.800000011921,0.35686275363,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false}],"ip":0,"op":40,"st":0,"bm":0}]}
--------------------------------------------------------------------------------
/swiggy-x-frontend/assets/images/bread.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-frontend/assets/images/bread.png
--------------------------------------------------------------------------------
/swiggy-x-frontend/assets/images/coffee.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-frontend/assets/images/coffee.png
--------------------------------------------------------------------------------
/swiggy-x-frontend/assets/images/fast-food.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-frontend/assets/images/fast-food.png
--------------------------------------------------------------------------------
/swiggy-x-frontend/assets/images/food-app-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-frontend/assets/images/food-app-1.png
--------------------------------------------------------------------------------
/swiggy-x-frontend/assets/images/food-app-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-frontend/assets/images/food-app-2.png
--------------------------------------------------------------------------------
/swiggy-x-frontend/assets/images/food-app-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-frontend/assets/images/food-app-3.png
--------------------------------------------------------------------------------
/swiggy-x-frontend/assets/images/food-app-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-frontend/assets/images/food-app-4.png
--------------------------------------------------------------------------------
/swiggy-x-frontend/assets/images/food-app-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-frontend/assets/images/food-app-5.png
--------------------------------------------------------------------------------
/swiggy-x-frontend/assets/images/food-app-6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-frontend/assets/images/food-app-6.png
--------------------------------------------------------------------------------
/swiggy-x-frontend/assets/images/pizza.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-frontend/assets/images/pizza.png
--------------------------------------------------------------------------------
/swiggy-x-frontend/assets/images/soft-drink.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooner115/FoodDeliveryApp-react_native-django/8fd243ad98e0b3d4b0ebb355f5a86f498b370ec2/swiggy-x-frontend/assets/images/soft-drink.png
--------------------------------------------------------------------------------
/swiggy-x-frontend/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = function(api) {
2 | api.cache(true);
3 | return {
4 | presets: ['babel-preset-expo'],
5 | };
6 | };
7 |
--------------------------------------------------------------------------------
/swiggy-x-frontend/components/home/Category.js:
--------------------------------------------------------------------------------
1 | import { View, Text, Image, ScrollView, StyleSheet, Pressable } from 'react-native';
2 | import { Axios } from '../../constants';
3 | import React from 'react';
4 |
5 |
6 | const Category = ({ setRestaurant, isDataFetched }) => {
7 |
8 | const handleCategory = (category) => {
9 | isDataFetched(false)
10 | Axios.get(`api/v2.1/search?q=${category}`)
11 | .then((res) => {
12 | setRestaurant(res.data.restaurants)
13 | isDataFetched(true)
14 | })
15 | .catch((err) => {
16 | console.log(err)
17 | })
18 | }
19 |
20 | return (
21 |
22 |
23 | {
24 | items.length ?
25 | items.map((item, index) => {
26 | return (
27 | handleCategory(item.category)}>
28 |
29 |
33 |
34 | {item.text}
35 |
36 |
37 |
38 | )
39 | })
40 | :
41 | (<>>)
42 | }
43 |
44 |
45 | )
46 | }
47 |
48 | const styles = StyleSheet.create({
49 | CategoryStyle: {
50 | marginTop: 5,
51 | backgroundColor: '#fff'
52 | },
53 | CategoryContainerStyle: {
54 | alignItems: 'center',
55 | paddingVertical: 5,
56 | paddingHorizontal: 10
57 | },
58 | CategoryImageStyle: {
59 | width: 70,
60 | height: 60,
61 | resizeMode: 'contain'
62 | },
63 | CategoryTextStyle: {
64 | fontWeight: "bold"
65 | }
66 | })
67 |
68 |
69 | const items = [
70 | {
71 | image: require('../../assets/images/fast-food.png'),
72 | text: "Fast Foods",
73 | category: 'fast-food'
74 | },
75 | {
76 | image: require('../../assets/images/soft-drink.png'),
77 | text: "Soft Drinks",
78 | category: 'drinks'
79 | },
80 | {
81 | image: require('../../assets/images/pizza.png'),
82 | text: "Pizza",
83 | category: 'pizza'
84 | },
85 |
86 | {
87 | image: require('../../assets/images/coffee.png'),
88 | text: "Tea & Coffee",
89 | category: 'coffee'
90 | },
91 | {
92 | image: require('../../assets/images/bread.png'),
93 | text: "Bakery Item",
94 | category: 'bakery'
95 | },
96 |
97 |
98 | ]
99 |
100 | export default Category;
101 |
--------------------------------------------------------------------------------
/swiggy-x-frontend/components/home/Footer.js:
--------------------------------------------------------------------------------
1 | import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
2 | import { useDispatch } from 'react-redux';
3 | import { React } from 'react';
4 | import { updateBrowseStatus } from '../../redux/reducers/browseReducer';
5 | import { updateHomeCounter } from '../../redux/reducers/browseReducer';
6 | import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
7 |
8 |
9 | const Footer = (props) => {
10 |
11 | // dispatch for State Update
12 | const dispatch = useDispatch()
13 |
14 |
15 | return (
16 |
17 | {
18 | dispatch(updateHomeCounter())
19 | props.navigation.navigate('Home')
20 | }}>
21 |
25 |
26 | {
27 | dispatch(updateBrowseStatus())
28 | props.navigation.navigate('Home')
29 | }}>
30 |
34 |
35 | props.navigation.navigate('Order', { TransactionStatus: "OrderRoute" })}>
36 |
40 |
41 | props.navigation.navigate('Account')}>
42 |
46 |
47 |
48 | )
49 | }
50 |
51 | const Icon = (props) => {
52 |
53 | return (
54 |
55 |
60 |
61 | {props.text}
62 |
63 |
64 | )
65 | }
66 |
67 | const styles = StyleSheet.create({
68 | FooterContainerStyle: {
69 | flexDirection: 'row',
70 | margin: 10,
71 | marginHorizontal: 30,
72 | justifyContent: 'space-between'
73 | },
74 | FooterIconStyle: {
75 | marginBottom: 3,
76 | alignSelf: 'center',
77 | color: '#000000'
78 | }
79 | })
80 |
81 | export default Footer;
--------------------------------------------------------------------------------
/swiggy-x-frontend/components/home/Header.js:
--------------------------------------------------------------------------------
1 | import { React } from 'react';
2 | import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
3 | import { useDispatch } from 'react-redux';
4 | import { updateHomeCounter } from '../../redux/reducers/browseReducer';
5 |
6 |
7 | const Header = ({ activetab, setActivetab }) => {
8 |
9 | return (
10 |
11 |
16 |
21 |
22 | )
23 | }
24 |
25 | const HeaderButton = (props) => {
26 |
27 | const BtnStyle = StyleSheet.create({
28 | HeaderButtonStyle: {
29 | backgroundColor: props.activeTab === props.text ? "#FF4500" : "#FFFFFF",
30 | paddingHorizontal: 18,
31 | paddingVertical: 7,
32 | borderRadius: 50,
33 | },
34 | HeaderButtonTextStyle: {
35 | color: props.activeTab === props.text ? "#FFFFFF" : "#FF4500",
36 | fontSize: 15,
37 | fontWeight: "bold"
38 | }
39 | })
40 |
41 | // dispatch for State Update
42 | const dispatch = useDispatch()
43 |
44 | return (
45 | {
46 | props.setActiveTab(props.text)
47 | dispatch(updateHomeCounter())
48 | }}>
49 |
50 | {props.text}
51 |
52 |
53 | )
54 | }
55 |
56 | const styles = StyleSheet.create({
57 | HeaderStyle: {
58 | flexDirection: 'row',
59 | justifyContent: 'center',
60 | }
61 | });
62 |
63 | export default Header;
--------------------------------------------------------------------------------
/swiggy-x-frontend/components/home/Restaurant.js:
--------------------------------------------------------------------------------
1 | import { View, Text, Image, TouchableOpacity, StyleSheet, Pressable } from "react-native";
2 | import { Placeholder, PlaceholderMedia, ShineOverlay, PlaceholderLine } from "rn-placeholder";
3 | import { React } from "react";
4 | import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
5 | import AntDesign from 'react-native-vector-icons/AntDesign';
6 |
7 | const Restaurant = ({ restaurant, isDataFetched, navigation, ...props }) => {
8 |
9 | // handleRestaurant Click
10 | const handleRestaurantNavigate = (restaurant) => {
11 | const detailObject = restaurant.restaurant
12 | const detail = {
13 | id: detailObject.id,
14 | featured_image: detailObject.featured_image,
15 | name: detailObject.name,
16 | user_rating: detailObject.user_rating,
17 | cuisines: detailObject.cuisines,
18 | location: detailObject.location
19 | }
20 | navigation.navigate('RestaurantDetail', detail)
21 | }
22 |
23 | return (
24 | <>
25 | {
26 |
27 | restaurant.map((restaurant, index) => {
28 | return (
29 |
30 | {
31 | isDataFetched ?
32 | handleRestaurantNavigate(restaurant)}
35 | >
36 |
37 |
41 |
46 |
47 |
48 | :
49 |
50 | (
53 |
59 | )}
60 | />
61 |
65 |
66 |
67 |
70 |
71 |
72 |
73 | }
74 |
75 | )
76 | })
77 | }
78 | >
79 | )
80 | }
81 |
82 | const RestaurantImage = (props) => {
83 | return (
84 |
85 |
91 |
92 |
93 | 54 min | 6 km
94 |
95 |
96 |
97 |
102 |
103 |
104 | )
105 | }
106 |
107 | const RestaurantImageInfo = (props) => {
108 | return (
109 |
110 |
111 |
115 | {props.name}
116 |
117 |
121 | {props.cuisines}
122 |
123 |
124 |
125 |
127 |
132 | {props.rating}
133 |
134 |
135 |
136 |
137 | )
138 | }
139 |
140 | const styles = StyleSheet.create({
141 | RestaurantContainerStyle: {
142 | backgroundColor: '#ffffff',
143 | marginTop: 10,
144 | padding: 15
145 | },
146 | RestaurantImageStyle: {
147 | width: '100%',
148 | height: 180
149 | },
150 | RestaurantImageTimeIconStyle: {
151 | position: 'absolute',
152 | bottom: 10,
153 | left: 10,
154 | paddingVertical: 2,
155 | paddingHorizontal: 5,
156 | borderRadius: 7,
157 | backgroundColor: '#FF4500'
158 | },
159 | RestaurantImageIconStyle: {
160 | position: 'absolute',
161 | top: 20,
162 | right: 20
163 | },
164 | RestaurantInfoContainerStyle: {
165 | flexDirection: 'row',
166 | justifyContent: 'space-between',
167 | marginTop: 10
168 | },
169 | RestaurantRatingStyle: {
170 | flexDirection: 'row',
171 | backgroundColor: "#008000",
172 | height: 30,
173 | width: 55,
174 | alignItems: "center",
175 | justifyContent: "center",
176 | borderRadius: 10
177 | }
178 | })
179 |
180 | export default Restaurant;
--------------------------------------------------------------------------------
/swiggy-x-frontend/components/home/SearchBar.js:
--------------------------------------------------------------------------------
1 | import { View, StyleSheet, Text, Image, TouchableOpacity, Pressable, TextInput, FlatList } from 'react-native';
2 | import { Placeholder, PlaceholderMedia, PlaceholderLine, ShineOverlay } from "rn-placeholder";
3 | import { React, useState, useEffect, useRef, useCallback } from 'react';
4 | import { Divider } from 'react-native-elements';
5 | import { Axios } from '../../constants';
6 | import { useSelector } from 'react-redux';
7 | import Feather from 'react-native-vector-icons/Feather';
8 | import Entypo from 'react-native-vector-icons/Entypo'
9 |
10 |
11 | // Important Note For Debouncing if using let keyword for timeoutId declare debounce funtion outside React Component and if using var keyword for timeoutId you can declare debouce funtion within React COmponent....
12 |
13 | var timeOutId;
14 |
15 | const SearchBar = ({ navigation }) => {
16 |
17 | // isSearchFocued redux state
18 | const isSearchFocued = useSelector(state => state.Browse.SearchFocus);
19 | const Counter = useSelector(state => state.Browse.Counter)
20 |
21 | // Search Recommendataion
22 | const [ResultData, setResultData] = useState([])
23 |
24 | // Seach Text
25 | const [SearchQuery, setSearchQuery] = useState("")
26 |
27 | // setRestaurant
28 | const [restaurant, setRestaurant] = useState([]);
29 |
30 | // isDataFetched
31 | const [isDataFetched, setDataFetched] = useState(false);
32 |
33 | // inputFocusRef
34 | const inputFocus = useRef()
35 |
36 | // SearchRequest
37 | const handleSearch = () => {
38 | setDataFetched(false)
39 | Axios.get(`api/v2.1/search?q=${SearchQuery}&count=8`)
40 | .then((res) => {
41 | let startsWith = [], notStartsWith = []
42 | res.data.restaurants.map((result) => {
43 | result.restaurant.name.toLowerCase().startsWith(SearchQuery.toLowerCase().slice(0, 4)) ?
44 | startsWith.push(
45 | result.restaurant.name + "@information" +
46 | result.restaurant.featured_image + "@information" +
47 | result.restaurant.id
48 | )
49 | :
50 | notStartsWith.push(
51 | result.restaurant.name + "@information" +
52 | result.restaurant.featured_image + "@information" +
53 | result.restaurant.id
54 | )
55 | })
56 | setResultData(startsWith.concat(notStartsWith))
57 | setRestaurant(res.data.restaurants)
58 | setDataFetched(true)
59 | })
60 | .catch((error) => {
61 | console.log(error)
62 | })
63 | }
64 |
65 |
66 | const debounce = (func, delay) => {
67 | return (...args) => {
68 | timeOutId ? clearTimeout(timeOutId) : null;
69 | timeOutId = setTimeout(() => func.apply(null, args), delay);
70 | };
71 | };
72 |
73 | const debounceSearch = debounce(handleSearch, 500);
74 |
75 | // handleSubmitSearch
76 | const handleSearchSubmit = (item) => {
77 | restaurant.map((res) => {
78 | if (res.restaurant.id === item.split('@information')[2]) {
79 |
80 | const detailObject = res.restaurant
81 |
82 | const detail = {
83 | id: detailObject.id,
84 | featured_image: detailObject.featured_image,
85 | name: detailObject.name,
86 | user_rating: detailObject.user_rating,
87 | cuisines: detailObject.cuisines,
88 | location: detailObject.location
89 | }
90 |
91 | navigation.navigate('RestaurantDetail', detail)
92 | }
93 | })
94 | }
95 |
96 | // renderItem
97 | const renderItem = ({ item }) => {
98 | return (
99 | <>
100 | {
101 | isDataFetched ?
102 | handleSearchSubmit(item)}>
103 |
104 |
113 |
118 | {item.split('@information')[0]}
119 |
120 |
121 |
122 | :
123 |
124 | (
127 |
136 | )}
137 | Right={props => (
138 |
139 | )}
140 | />
141 |
142 | }
143 | >
144 | )
145 | }
146 |
147 | useEffect(() => {
148 | // First Clear Text Focus and again Do TextInput Focus
149 | if (Counter !== 0) {
150 | inputFocus.current.blur()
151 | inputFocus.current.focus()
152 | }
153 | }, [isSearchFocued])
154 |
155 |
156 |
157 | return (
158 | <>
159 |
160 |
161 |
162 | setSearchQuery(text)}
165 | value={SearchQuery}
166 | onChange={debounceSearch}
167 | placeholder='Search Restaurant'
168 | ref={inputFocus}
169 | />
170 |
171 |
172 |
173 | {
174 | SearchQuery.length && ResultData.length ?
175 | item}
180 | renderItem={renderItem}
181 | ItemSeparatorComponent={() => }
182 | />
183 | :
184 | (<>>)
185 | }
186 | >
187 | )
188 | }
189 |
190 | // SearchBar Left Icon
191 | const RenderLeftButton = (props) => {
192 | return (
193 |
194 |
199 |
200 | )
201 | }
202 |
203 | // SearchBar Right Icon
204 | const RenderRightButton = (props) => {
205 | const EmptySuggestion = () => {
206 | props.setSuggestion([])
207 | props.setQuery("")
208 | }
209 | return (
210 |
211 |
212 |
217 |
218 |
219 | )
220 | }
221 |
222 | const styles = StyleSheet.create({
223 | SearchBarStyle: {
224 | marginTop: 10,
225 | backgroundColor: '#eee',
226 | borderRadius: 50,
227 | borderWidth: 1,
228 | marginBottom: 4,
229 | borderColor: '#b9b9b9',
230 | alignItems: 'center',
231 | flexDirection: 'row', // Important
232 | justifyContent: 'space-between'
233 | },
234 | LeftButtonStyle: {
235 | marginLeft: 15
236 | },
237 | InputContainerStyle: {
238 | borderRadius: 50,
239 | margin: 7.5
240 | },
241 | RightButtonStyle: {
242 | marginRight: 10,
243 | backgroundColor: '#ffffff',
244 | paddingHorizontal: 11,
245 | paddingVertical: 2,
246 | borderRadius: 50
247 | },
248 | SuggestionStyleList: {
249 | flexDirection: 'row',
250 | alignItems: 'center',
251 | paddingHorizontal: 10,
252 | paddingVertical: 6
253 | },
254 | })
255 |
256 | export default SearchBar;
257 |
--------------------------------------------------------------------------------
/swiggy-x-frontend/components/restaurant/About.js:
--------------------------------------------------------------------------------
1 | import { Placeholder, PlaceholderMedia, ShineOverlay } from "rn-placeholder";
2 | import { View, Text, Image, StyleSheet } from 'react-native';
3 | import { React } from 'react';
4 | import AntDesign from 'react-native-vector-icons/AntDesign';
5 |
6 |
7 | const About = (props) => {
8 |
9 | return (
10 |
11 |
12 |
13 |
17 |
18 |
19 |
23 |
24 |
28 |
29 | )
30 | }
31 |
32 |
33 | const RestaurantImage = (props) => {
34 |
35 | const onLoading = () => {
36 | return (
37 | (
40 |
46 | )}
47 | />
48 | )
49 | }
50 |
51 | return (
52 | <>
53 |
61 | >
62 | )
63 | }
64 |
65 | const RestaurantTitle = (props) => {
66 | return (
67 |
68 | {props.title}
69 |
70 | )
71 | }
72 |
73 | const RestaurantDescription = (props) => {
74 | return (
75 |
76 |
77 | {props.cuisines}
78 |
79 |
80 | {props.location}
81 |
82 |
83 | )
84 | }
85 |
86 | const RestaurantRating = (props) => {
87 | return (
88 | <>
89 |
90 |
92 |
99 | {props.rating}
100 |
101 |
102 |
103 |
104 | {props.reviewCount} Reviews
105 |
106 |
107 | >
108 | )
109 | }
110 |
111 | const styles = StyleSheet.create({
112 | ImageStyle: {
113 | width: '100%',
114 | height: 150
115 | },
116 | RestaurantDetailContainerStyle: {
117 | flexDirection: 'row',
118 | alignItems: 'center',
119 | paddingHorizontal: 15
120 | },
121 | TitleStyle: {
122 | fontSize: 20,
123 | fontWeight: "600"
124 | },
125 | DescriptionStyle: {
126 | paddingHorizontal: 15,
127 | marginBottom: 5,
128 | },
129 | RestaurantRatingStyle: {
130 | flexDirection: 'row',
131 | backgroundColor: "#008000",
132 | height: 22,
133 | marginTop: 5,
134 | width: 50,
135 | alignItems: "center",
136 | justifyContent: "center",
137 | borderRadius: 10
138 | }
139 | })
140 |
141 | export default About;
--------------------------------------------------------------------------------
/swiggy-x-frontend/components/restaurant/MenuItem.js:
--------------------------------------------------------------------------------
1 | import { Placeholder, PlaceholderMedia, PlaceholderLine, ShineOverlay } from "rn-placeholder";
2 | import { Text, View, StyleSheet, Image, ScrollView, Button } from 'react-native';
3 | import { updateFoodCartStatus } from '../../redux/reducers/cartReducer';
4 | import { handleQuantity } from '../../redux/reducers/cartReducer';
5 | import { useDispatch, useSelector } from 'react-redux';
6 | import { Divider } from 'react-native-elements';
7 | import { MenuList } from '../../constants';
8 | import { Rating } from 'react-native-ratings';
9 | import { React, useState, useEffect } from 'react';
10 | import NumericInput from 'react-native-numeric-input';
11 |
12 |
13 | const MenuItem = (props) => {
14 |
15 | // FoodCart State from Redux
16 | const cart = useSelector(state => state.Cart.FoodCart);
17 |
18 | // State for shuffling MenuItems
19 | const [isShuffled, setIsShuffled] = useState(false);
20 |
21 | // FoodMenuList
22 | const [MenuItemList, setMenuItemList] = useState(Array.from({ length: 10 }));
23 |
24 | // dispatch for State Update
25 | const dispatch = useDispatch();
26 |
27 | // This will shuffle MenuFoodList
28 | const shuffle = (array) => {
29 | let currentIndex = array.length, randomIndex;
30 | while (currentIndex != 0) {
31 | randomIndex = Math.floor(Math.random() * currentIndex);
32 | currentIndex--;
33 | [array[currentIndex], array[randomIndex]] = [
34 | array[randomIndex], array[currentIndex]];
35 | }
36 | return array;
37 | }
38 |
39 | useEffect(() => {
40 | // Shuffle MenuFoodList and gave 20 Foods only
41 | setMenuItemList(shuffle(MenuList).slice(0, 20))
42 | setIsShuffled(true)
43 | }, [])
44 |
45 |
46 | // Will Add to FoodItem to React-Redux FoodCart
47 | const AddToCart = (fd) => {
48 | dispatch(updateFoodCartStatus({
49 | RestaurantDetail: {
50 | Res_id: props.restaurant.id,
51 | Res_Name: props.restaurant.name
52 | },
53 | Item: {
54 | FoodId: fd.id,
55 | FoodImage: fd.item_image_url,
56 | FoodTitle: fd.name,
57 | FoodPrice: fd.min_price,
58 | FoodQuantity: 1,
59 | RatingCount: fd.rating.value
60 | }
61 | }));
62 | }
63 |
64 | // Conditionally rendering button check if food item already in react-redux foodcart
65 | const renderButton = (fd) => {
66 | let IsInCart = false
67 | let Quantity = 0
68 |
69 | if (cart.RestaurantDetail.Res_id === props.restaurant.id) {
70 | for (let i = 0; i < cart.Items.length; i++) {
71 | if (cart.Items[i].FoodId === fd.id) {
72 | IsInCart = true
73 | Quantity = cart.Items[i].FoodQuantity
74 | break
75 | }
76 | }
77 | return (
78 | <>
79 | {
80 | IsInCart ?
81 | {
85 | dispatch(handleQuantity({
86 | FoodId: fd.id,
87 | value: value > Quantity ? Quantity + 1 : Quantity - 1
88 | }));
89 | }}
90 | totalWidth={130}
91 | totalHeight={37}
92 | iconSize={25}
93 | step={1}
94 | valueType='real'
95 | rounded={false}
96 | textColor='#000000'
97 | iconStyle={{ color: 'white' }}
98 | borderColor='#FF4500'
99 | rightButtonBackgroundColor='#FF4500'
100 | leftButtonBackgroundColor='#FF4500' />
101 | :
102 |