Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 48 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
# Contributing
# Contributing to Secureflow

This is a guide to contributing to `scaffold-stellar-frontend` itself. Feel free to delete or modify it for your own project.
Thank you for contributing to Secureflow. This guide covers the common local setup path for the frontend, backend, contracts, and Supabase data model.

## Prerequisites

- Node.js 20+
- npm
- Supabase CLI
- Rust and the Stellar/Soroban tooling when working on contracts

## Local setup

```bash
git clone https://github.com/Secureflow-protocol/secureflow.git
cd secureflow
npm install
```

Copy the environment examples used by the area you are changing, then start the app or service you need.

## Supabase setup

The repository includes Supabase migrations in `supabase/migrations/` and local seed data in `supabase/seed.sql`.

```bash
supabase start
supabase db reset
```

`supabase db reset` recreates the local database, applies migrations, and loads the seed file. The seed data includes sample messages and notifications so the inbox and notification routes have records to return during local development.

## Backend workflow

```bash
cd backend
npm install
npm run dev
```

When changing API routes, keep request validation and Supabase table fields aligned with the migrations and seed data.

## Pull request checklist

- Keep the change focused on one issue or feature.
- Update docs when setup, migrations, routes, or environment variables change.
- Add or update tests for behavior changes when practical.
- Run the smallest relevant validation command and include it in the PR description.
- Do not commit secrets, private keys, wallet seed phrases, or Supabase service-role credentials.
60 changes: 60 additions & 0 deletions supabase/seed.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
-- Local development seed data for Secureflow.
-- Run with: supabase db reset

insert into public.messages (
conversation_id,
sender_address,
recipient_address,
content,
read_at,
created_at
) values
(
'GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA:GBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB',
'GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
'GBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB',
'Hi, I reviewed your milestone proposal and have one follow-up question.',
now(),
now() - interval '2 hours'
),
(
'GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA:GBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB',
'GBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB',
'GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
'Thanks. I can provide the supporting file before the deadline.',
null,
now() - interval '90 minutes'
)
on conflict do nothing;

insert into public.notifications (
wallet_address,
type,
title,
message,
read_at,
action_url,
data,
created_at
) values
(
'GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
'milestone',
'Milestone ready for review',
'A freelancer submitted milestone evidence for your project.',
null,
'/approvals',
'{"escrowId":"local-escrow-001","milestone":1}'::jsonb,
now() - interval '1 hour'
),
(
'GBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB',
'application',
'Application received',
'Your application was delivered to the job creator.',
now(),
'/jobs',
'{"jobId":"local-job-001"}'::jsonb,
now() - interval '30 minutes'
)
on conflict do nothing;