Skip to content

HelixY2J/The-Bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Bridge

Arch

dashboard_founder

Make sure 'make' is installed or you can use docker cmd directly. Create an .env file at /notif-go/.env , copy the content from .env.example

make up

or

	docker compose up --build -d

then get the container id for postgres

docker ps

Run migrations with

make migrate-up
make seed

For postgresql shell

docker exec -it <postgres-container-id> psql  -U notif -d notif

For redis shell

docker exec -it <redis-container-id> redis-cli

For notif-go shell

docker exec -it notif-notif-go-1 sh
docker logs -f notif-notif-go-1

For notif-web shell

docker exec -it <notif-web-container-id> sh

SQL cmds

\dt
SELECT * FROM users;
SELECT * FROM notifications;
SELECT * FROM company_relationships;
SELECT * FROM companies;
SELECT * FROM members;

Browser based flow

Please open 3 different browser windows and login as admin at Founder company, member at a founder company and member at investor company. Or open incognito windows for each.

dashboard_founder

dashboard_founder

Terminal login and flow

creds

Test credentials (all use password: password123):
  Admin: sundar@deepmind.com, dario@anthropic.com
  Member: jeff@deepmind.com, daniela@anthropic.com, alfred@sequoia.com, marc@a16z.com

Login from admin of a founder company - for cmd windows

curl.exe -X POST http://localhost:8080/auth/login -H "Content-Type: application/json" -c test/cookies_dario.txt -d "{\"email\":\"dario@anthropic.com\",\"password\":\"password123\"}"

Login from member of that same founder company

curl.exe -X POST http://localhost:8080/auth/login -H "Content-Type: application/json" -c test/cookies_daniel.txt -d "{\"email\":\"daniela@anthropic.com\",\"password\":\"password123\"}"

Start listener for the reciepient:

Example - If recipient is the member of that company

curl -N http://localhost:8080/api/notifications/stream -b test/cookies_daniel.txt

Sending notifications

Sending WITHIN company as ADMIN broadcast

dashboard_founder

curl -X POST http://localhost:8080/api/notifications/send -H "Content-Type: application/json" -b test/cookies_dario.txt -d "{\"mode\":\"within_company\",\"title\":\"Team Update\",\"body\":\"All hands at 5 PM\"}"

Sending WITHIN company as member - replace the cookies file with member

WIll recieve 403

Sending DIRECT NOTIFICATION:

dashboard_founder

Replace with sender cookies file, target_user_id with the user you want to send to

curl.exe -X POST http://localhost:8080/api/notifications/send -H "Content-Type: application/json" -b test/cookies_daniel.txt -d "{\"mode\":\"direct\",\"title\":\"Ping\",\"body\":\"Heyy party tonightt\",\"target_user_id\":\"0ad72f96-4250-424a-bf13-730d918d4982\"}"

CROSS COMPANY NOTIFICATION:

dashboard_founder

Can create relationship if doesnt exist:

curl.exe -X POST http://localhost:8080/api/companies/relationships -H "Content-Type: application/json" -b test\cookies_dario.txt -d "{\"target_company_id\":\"4fbcec3b-3123-4e06-a58a-a9f337215b7b\"}"

Then send notificaiton as ADMIN:

curl.exe -X POST http://localhost:8080/api/notifications/send -H "Content-Type: application/json" -b test/cookies_dario.txt -d "{\"mode\":\"cross_company\",\"title\":\"Investor Update\",\"body\":\"Quarterly report ready\",\"target_company_id\":\"4fbcec3b-3123-4e06-a58a-a9f337215b7b\"}"

READ NOTIFICATIONS

Reaplce cookies file with recipient

curl.exe -X POST http://localhost:8080/api/notifications/d0f2a7e0-cef8-4ad9-988f-75a0ae6ac4f9/read -b test\cookies_dario.txt

Read ALL

curl.exe -X POST http://localhost:8080/api/notifications/read-all -b test\cookies_dario.txt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors