# pipapo workfile
## Aggregator
### To Do
1. Aggregator Worker
2.
### Done
1. Lofi
2. Event data structure
```
Country -> enum of countries
City -> enum of cities
Currency -> enum of currency
type CID = string
type timestamp = number
type URL = string
Location {
country: Country
city: City
}
Event {
name: string
organizer: string
startDate: timestamp
endDate: timestamp
description: string
location: Location
image: CID
video: CID
isOnline: boolean
lat: number | null
long: number | null
socialMedia:
isActive: bool
beginPeriod: timestamp
endPeriod: timestamp
sold: number
supply: number
basePrice: number | null
basePriceCurrency: Currency | null
secondaryMarketLink: string | null
primaryMarketLink: URL
}
```
example
```
{
name: 'TOSKA KEMAS UI 2023',
organizer: 'Kemas UI',
start_date: 1673173725,
end_date: 1673173725,
...
}
```
4. Get event aggregator API
a. sermorpheus -> https://fireprod.sermorpheus.com/v2/product/list?search=&type=1&page=1&limit=10
#### Sample data
```
{
id: 49,
name_event: 'TOSKA KEMAS UI 2023',
organizer: 'Kemas UI',
event_date: '2023-01-29 08:30:00',
event_end_date: '2023-01-29 08:30:00',
description: 'TOSKA KEMAS UI 2023, kembali hadir di Sumatera Selatan untuk mensosialisasikan secara offline tentang fakultas, jurusan, dan kehidupan kampus di Universitas Indonesia.',
location_id: '["1"]',
category: 1,
image: [
'https://storage.googleapis.com/prod-ser-morpheus/events/bennerToskaKemasUI2023.png?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=ser-morpheus-engineer%40ser-morpheus.iam.gserviceaccount.com%2F20230108%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20230108T102649Z&X-Goog-Expires=901&X-Goog-SignedHeaders=host&X-Goog-Signature=3b2be4cf525778ae402cf149a6b64c3b00733cf285cc07a5547c5e4bf9162efd14591f335f8e264511908309f50238f4f71701df83357b8392c1c35de8a632036d353e4715d91591e4bb77b33f167498c10c79d0b4bea06868ba22e527badc6f63912f8e37a1504c07cd923cf21484212af0a322a9ced3a030f067196d3aa7b477b915648dfa69ae497513fd8f288198abdbf89a4636730213e1e1a1f03fc9e8a52afb2a29b09de51b41af20b4ba8884e77be9a7dfdbc399b577fd289bfda680be4b9047f49a385bea6b52072d58ba9cba89f63a6c809b76ecc232177c880b0fc3656198b1faacf5eaaf4cabdae7f7f00b576ca3d799bbe86984738294f055ad'
],
video_url: 'https://www.jgtc-festival.com/videos/landing/Teaser-44th-JGTC.mp4',
avatar_picture: 'https://storage.googleapis.com/prod-ser-morpheus/avatars/logoToskaKemasUI2023.png?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=ser-morpheus-engineer%40ser-morpheus.iam.gserviceaccount.com%2F20230108%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20230108T102650Z&X-Goog-Expires=900&X-Goog-SignedHeaders=host&X-Goog-Signature=a198a9f547ae3a04d18b2ccd634f28007026d7c465454f1dfa65acb46ad16e58210f8bb4f4f2808012fa438aefdf6da26779380805ca145596e373d047a634c5a06ddaa67d6cd3c6e5a8619aeaff8aa8f6b6b84b10b50539cb47e59379d5284c5f65717e9fb7454fabcd87add725df9fdefe85745f7b4b5876404375373288d036852b9f6a942c6606e6f4782c26585de43b99ded8a2c840d2809066bf8a4c503ab794abaa444673366c514b2dbadb6e4af2b62abc0cbba6831107d70b4bd8a308141958ff60bfc2f68fc757aa83ead9d79f3de5b7ded7178a150b3e7762cf30ff5065ac7146f9f7518eb9c5f889be3c800c26eb6fd0f46eb753712621a8770a',
seat_position: 'https://storage.googleapis.com/prod-ser-morpheus/seats/seatToskaKemasUI2023.png?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=ser-morpheus-engineer%40ser-morpheus.iam.gserviceaccount.com%2F20230108%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20230108T102650Z&X-Goog-Expires=900&X-Goog-SignedHeaders=host&X-Goog-Signature=100d02cc38f993b5821bc798eff4cb49f1a53fb67a80efa6cfbf0e904ccfb04ad21d453287da3aa03bbc299e74a499d744ec09253c7d2b69ab51b5f8e97282020949a6c569bcd90a201b36f13ffb2fb5f0606dfa086b4ea0271ba44ec2dd7a34e5ca56907119dd3455a37ca744095ce4d28b6a92c11bc445663757c454b657f43c178b9a3872ddb928577535320eb0c40e751d5dd83b0258a3f9ae826e039093ae87803a301e152d1c049e439381df2fca5eae4a8de23ed22947005169181ca77aa5a6e130304703e71fa80996cc3d01955004ff79ae3fa4a9804bd2a55d6c9424d1d18d5f46a6f01a4ba460adc748bf5c8b14f1e1bbdd698de1ada1fb57f872',
seat_description: null,
lat: '-3.000656002812389',
long: '104.73090914232769',
base_price: 35000,
maximum_ticket: 10,
isActive: 1,
isActiveSecondaryMarket: 0,
instagram_link: 'https://www.instagram.com/toskakemasui/ ',
twitter_link: null,
begin_period: '2022-12-29 19:00:00',
end_period: '2023-01-14 23:59:00',
isWhitelistedOnly: 0,
product_type: [ { type: 'Ticketing' } ],
total_sold: '26',
total_supply: 1200,
secondary_market: { total_supply_ticket_secondary_market: 0, start_from_price: 0 }
}
```
b. tiket.com -> https://www.tiket.com/to-do/api/filtered-products?startingPriceInCentsFrom=0&pageNumber=1&sortAttributes=popularityScore&sortDirection=DESC&pageSize=12&excludes=operationalHours%2Csections%2Cfeatures%2Cpackages&productCategoryCodes=EVENT&lang=id
```
{
id: '63b788f9bcd4b55ad611404b',
title: 'LifeFest',
timeZoneId: 'Asia/Jakarta',
currencyCode: 'IDR',
exchangeRate: 1,
url: 'life-fest-2023',
city: 'JAKARTA PUSAT',
cityId: '',
area: 'PLAZA PARKIR TIMUR SENAYAN',
region: 'JAKARTA',
regionId: 'jakarta-108001534490276204',
discountInPercent: 0,
country: 'INDONESIA',
countryId: 'indonesia',
latitude: -6.218632500000001,
longitude: 106.806492,
isOnlineExperience: false,
tiketClean: false,
tiketFlexi: false,
specialCondition: '',
media: [
{
type: 'image',
thumb: 'https://s-light.tiket.photos/t/01E25EBZS3W0FY9GTG6C42E1SE/rsfit186124gsm/events/2023/01/06/fb55db5d-6666-4efb-8462-835a24cf00ad-1672972156560-e98b28e7aacc1c9e75c070bef743c5be.jpg',
medium: 'https://s-light.tiket.photos/t/01E25EBZS3W0FY9GTG6C42E1SE/rsfit621414gsm/events/2023/01/06/c2fc69e5-f8e2-4085-a60c-f138b554ef92-1672972156509-fdf7f0c334926edfbacc0b34d6ded52a.jpg',
label: '',
alt: 'Banner-Tiket-whitebg (2).jpg',
isHidden: false,
uuid: '7JZcjk7jp'
}
],
sponsors: [],
discountVoucher: {},
mainCategory: 'EVENT',
primaryCategory: 'EVENT',
isEvent: true,
salesStartDate: '2023-01-06T09:01:26+07:00',
salesEndDate: '2023-02-26T12:00:00+07:00',
startAvailableDate: '2023-02-25T23:59:59+07:00',
categories: [ 'EVENT' ],
primaryProductCategory: {
code: 'EVENT',
name: 'Event',
url: 'category/event',
icon: 'https://s-light.tiket.photos/t/01E25EBZS3W0FY9GTG6C42E1SE/rsfit9696gsm/events/2022/12/16/74758305-4646-49a4-9de4-1352c7070135-1671128096010-436fed775533d6e0833563a9422d258b.png',
alt: 'tds_ic_subproduct_event.png'
},
productCategories: [
{
code: 'EVENT',
name: 'Event',
url: 'category/event',
icon: 'https://s-light.tiket.photos/t/01E25EBZS3W0FY9GTG6C42E1SE/rsfit9696gsm/events/2022/12/16/74758305-4646-49a4-9de4-1352c7070135-1671128096010-436fed775533d6e0833563a9422d258b.png',
alt: 'tds_ic_subproduct_event.png'
}
],
partners: [],
fullAddress: 'JAKARTA PUSAT, JAKARTA, INDONESIA',
locationGuide: null,
startMarketPrice: 250000,
startPrice: 250000,
startGimmickPrice: 0,
showStrikeThroughPrice: false,
strikeThroughPrice: 250000,
earliestSaleDateTime: '2023-01-06T09:01:26+07:00',
latestSaleDateTime: '2023-02-26T12:00:00+07:00',
earliestAvailabilityDateTime: '2023-02-25T23:59:59+07:00',
latestAvailabilityDateTime: '2023-02-26T23:59:59+07:00',
saleStatus: 'AVAILABLE',
startingCrossedPrice: 250000,
startingFinalPrice: 250000,
openDayTimes: [],
atlasLocation: {
countryCode: 'indonesia',
regionCode: 'jakarta-108001534490276204',
cityCode: null,
areaCode: null
},
image: 'https://s-light.tiket.photos/t/01E25EBZS3W0FY9GTG6C42E1SE/rsfit621414gsm/events/2023/01/06/c2fc69e5-f8e2-4085-a60c-f138b554ef92-1672972156509-fdf7f0c334926edfbacc0b34d6ded52a.jpg',
promoLabel: null,
extraBenefit: null,
sectionFlexiNClean: [],
avgRating: 0,
commentCount: 0,
currencyRate: 1,
isEnableCaptcha: false,
availabilityStatus: 'BOOKABLE'
}
```
## env pipapo-aggregator
API_KEY_FIREBASE=AIzaSyDBXOcR6EygaQFDeZ6yvv9iVSPvYJQyr_0
AUTH_DOMAIN_FIREBASE=am-ticket-app.firebaseapp.com
PROJECT_ID_FIREBASE=am-ticket-app
STORAGE_BUCKET_FIREBASE=am-ticket-app.appspot.com
MESSAGING_SENDER_ID_FIREBASE=127733324446
APP_ID_FIREBASE=1:127733324446:web:0f37763f6c33d2d084798f
MEASUREMENT_ID_ANALYTICS=G-R06RT1ZFKE
MONGO_URL=mongodb+srv://am_ticket:b93-w304@clusteramticket.uixeer3.mongodb.net/am-ticket-aggregator
NEXT_PUBLIC_CLOUDINARY_API_URL=https://api.cloudinary.com
NEXT_PUBLIC_CLOUDNAME_CLOUDINARY=dbcmvymir
APIKEY_CLOUDINARY=557117658917172
APISECRET_CLOUDINARY=brExbq2kfshWI4csnwtXLXt0YvY
APP_ENV=development
NEXT_PUBLIC_API_URL=http://localhost:3000
PRIVATE_KEY_ADMIN_FIREBASE=-----BEGIN PRIVATE KEY-----MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD3/mKxKP3VKzPFH6MXnGhuwTiUz72sI8nhF0dLaZRHnaM04cGUGIWscGSV5+iFbrGUqgQP/PmMv9Laq1+1/Fl9hOcbn6KLQ2RLjcf36y+gn4SEtU/HNtWCOZ2Xj3FfSYuKNArHthhHHkcsiJ5Q0Scj56iMZePNVYYIUt8wtqX/P1P45lEZz5kZPlPHuzUo03AQbp60cS3yzEoudGb4GnfGUgJyL4D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0DUJ/sZWHgLSlZq5p1wao0YFcAA2BY68yoHL3xHh7VRSZsVlrj/heHKPi+kKpEjSGT7XJ7F+A7IirWqZBubAoGBAPrir2BKdAIncyJ0RwIqOQicG7SGp5/t7gGpSoFiHidcDMF9AS3dwNmz/rRBkwI0z0M3Md1jpiWcXMxKjrcAS6ENA+L3/70sb/Muqv7R1TROqxOxWmHpIav+Wn4ffXMXKsPV5CMd1YEe0n/WQ2mPCzrLN07bFQL57edvNQnKdpGL-----END PRIVATE KEY-----
CLIENT_EMAIL_ADMIN_FIREBASE=firebase-adminsdk-d6kjg@am-ticket-app.iam.gserviceaccount.com
NEXT_PUBLIC_MAPS_KEY=AIzaSyDGng8RSkibldd247nh7pDfx9x-OkyEWXc
NEXT_PUBLIC_NFT_STORAGE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweDkwQTVkNThFMjJCODA3ZkZkMzlmQmNhNWVmMjMwODEwOTFDM2YxQTciLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTY3MjIwNTU2NzAxNiwibmFtZSI6InBpcGFwbyJ9.dFNoflCSyJQ5kMcZgx1n2fKqgI-UUju1YxZBTQWHhcg
## EVM Integration
### Done
### To Do
## Checklist done
1. Authorization API (done)
2. Create event API and contract (done)
2.a. Verify contract created on DB
2.b. Success modal
4. Event list API (done)
8. Owned NFT list (done)
9. QR generator in NFT page (done)
7. Buy button (done)
6. NFT page (done)
10. QR verifier for EO -> redeem flow (done)
11. 4. confirmation modal on redeeming (done)
12. royalty contract & marketplace listing (paras) (done)
13. total sold tickets, total remaining tickets (done)
22. button to secondary marketplace (paras)
23. gift nft
24. transfer nft
25. ramper auto deposit (API)
22. ramper deposit call from FE
23. location map
24. share generator
## ToDo
15. Create demo video
17. protocol spec
18. fix polling for verify ticket
19. performance test https://pagespeed.web.dev/report?url=https%3A%2F%2Fpipapo.io%2F -> need to optimize images
20. SEO is bad, need to create meta
### ToDO (UI)
2. like unlike API
## Backlog
12. Admin dashboard for EO (prio 2)
13. Email (prio 3)
## After Hackathon
### To Do
1. service API:
a. ...prev API
b. profile (name, email, phone number, credit card)
c. events (...prev schema, NFT per ticket type)
d.
## Function call
buat redeem -> function call
```
user::subAccountContract.redeem_nft({token_id: token_id}) 1yoctoNear
```
nft enumeration for user -> view function
```
function nft_tokens_for_owner(
account_id: string,
from_index: string|null, // default: 0
limit: number|null, // default: unlimited (could fail due to gas limit)
): Token[] {}
```
buy function for user -> function call
```
user::subAccountContract.nft_buy({}) attach near harga ticketnya
```
## Notes
1. Authorization API
1.a. login with near (done)
1.a. bikin authorization (copas punya paras) (done)
1. Create event API (done)
POST /api/event (check signed message)
2. Email API (deprio)
After buy, send email with QR page link
3. Smart contract template (create new contract, buy, redeem) (done)
3.a. organizer can create new contract with nft and price (tinggal integrate fe)
3.b. audience can buy and redeem nft (when buy, send email with qr code page) (integrate fe)
4. Event list API (done)
GET /api/event
5. QR generator (FE)
6. QR verifier (account organizer)
6.a. organizer has a page in dashboard where he/she can check QR (FE)
6.a. organizer scans QR from audience phone
6.a. (short pooling) on the audience phone there is a prompt to redeem
6.a. after audience clicked 'approve', -> success message both in organizer device and audience
###
## The ticketing system on blockchain
pipapo.io is a blockchain-based ticketing platform. We provide white-label and on-chain solutions for event certification, proof of attendance, and more.
## Our Vision
Onboarding web2 users to web3 using the NFT ticketing system, subscriptions, or other similar things, as well as providing the benefits of using NFT that can be applied in every day in life. easy to use and user friendly and also contribute to increasing the number of web3 users, especially in near blockchain.
## Why pipapo.io
### Ticketing technology
pipapo.io is a blockchain ticketing platform that connects users and event organizers in a secure and transparent way. We use the blockchain to enforce trust, transparency and accountability between users, while on-chain payments are made by using our native currency [NEAR] which can be exchanged for other cryptocurrencies or fiat money.
### Using QR code
QR codes are a great way to verify that you have attended an event. They can be scanned by the organizer and provide accurate data, which is important for event organizers. With NFT, you can make sure your attendees are getting their tickets scanned in a timely manner and not just using them as a collector's item.
### No fraud, scam, or clone ticket
Blockchain technology is an emerging way to create secure, digital tickets. Because blockchain is decentralized and transparent, all transactions are recorded on a public ledger, which means that it's impossible to forge or duplicate a ticket without leaving a trace.
### Tickets become digital collectibles
People love to collect things, You can buy them, sell them, trade them, and build a community around them. You could even make a game out of it.
### Royalty increase business profit
Event providers get royalties from ticket selling NFT that enables them to increase profit