>> Live demo
- If it's not yet installed on your machine, install node.js.
- Install the latest Firebase CLI by running the following in your terminal:
npm install -g firebase-tools. - In your terminal, run
git clone https://github.com/GoogleChromeLabs/trust-safety-demo.git && cd trust-safety-demo/attribution-reporting. This command will create a folder, clone all of thetrust-safetydemo code in that folder, and navigate you to theattribution-reportingdemo subfolder. - In your terminal, run
cd functions && npm install && cd ... This command will install all the required dependencies for you to locally run theattribution-reportingdemo.
-
Optionally, pull the latest code from this repository: in your terminal, navigate to
trust-safety-demo/attribution-reportingand run thegit pullcommand. -
Locally start the demo: in your terminal, navigate to
trust-safety-demo/attribution-reportingand runfirebase emulators:start. If you have no Firebase project setup you can add--project none(firebase emulators:start --project none).- You should now have multiple servers running: home(:8080), adtech(:8085), advertiser(:8086), publisher(:8087) server.
- Make sure you see the following output and port mappings in your terminal. If the port mappings differ, see the #Troubleshooting section.
... i hosting[arapi-home]: Serving hosting files from: sites/home ✔ hosting[arapi-home]: Local server: http://localhost:8080 i hosting[arapi-adtech]: Serving hosting files from: sites/adtech ✔ hosting[arapi-adtech]: Local server: http://localhost:8085 i hosting[arapi-advertiser]: Serving hosting files from: sites/advertiser ✔ hosting[arapi-advertiser]: Local server: http://localhost:8086 i hosting[arapi-publisher]: Serving hosting files from: sites/publisher ✔ hosting[arapi-publisher]: Local server: http://localhost:8087 ...
-
Open arapi-home.localhost:8080 in Chrome.
-
Follow the instructions in the UI. 🚨 In particular, make sure to follow the Set up your browser instructions.
All URLs in this demo (publisher, advertiser, adtech) can be customized.
Look for functions/.env.local and functions/.env.prod files and customize them as needed.
If you see different port mapping during running the local emulators with firebase emulators:start, the reason might be that the ports are bound to a different process.
Make sure all processes using ports 8080,8085,8086,8087 are closed. To find out information about processes that occupy the ports you can do the following.
# find the process id of the process holding a port
lsof -ti:<port_number>
# find the process name and info
ps | grep $(lsof -ti:8085)
# stop a process that is holding a port
kill $(lsof -ti:8085)Join the developer mailing list and ask your question there.