Skip to content

antiwork/flexile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Flexile

Contractor payments.

Setup

You'll need:

The easiest way to set up the development environment is to use the bin/setup script, but feel free to run the commands in it yourself:

Backend

  • Set up Ruby (ideally using rbenv/rvm) and PostgreSQL
  • Navigate to backend code and install dependencies: cd backend && bundle i && gem install foreman

Frontend

  • Navigate to frontend app and install dependencies cd frontend && pnpm i

Finally, set up your environment: cp .env.example .env. If you're an Antiwork team member, you can use vercel env pull .env.

Running the App

You can start the local app using the bin/dev script - or feel free to run the commands contained in it yourself.

Once the local services are up and running, the application will be available at http://localhost:3000, with the backend (Rails API) running at http://localhost:3001.

Development shortcuts:

  • If ENABLE_DEFAULT_OTP=true is set in your .env, you can use 000000 as the OTP for logging in or signing up.
  • Use these pre-seeded accounts (password: password for all):
    • Admin: hi+sahil@example.com (Primary Administrator)
    • Contractor: hi+sharang@example.com (Software Engineer)
    • Investor: hi+chris@example.com (Investor)
    • More accounts: See the seed data for additional test users (emails are always hi+firstname@example.com)

Common Issues / Debugging

1. Postgres User Creation

Issue: When running bin/dev (after bin/setup) encountered FATAL: role "username" does not exist

Resolution: Manually create the Postgres user with:

psql postgres -c "CREATE USER username WITH LOGIN CREATEDB SUPERUSER PASSWORD 'password';"

Likely caused by the bin/setup script failing silently due to lack of Postgres superuser permissions (common with Homebrew installations).

2. Redis Connection & database seeding

Issue: First attempt to run bin/dev failed with Redis::CannotConnectError on port 6389.

Resolution: Re-running bin/dev resolved it but data wasn't seeded properly, so had to run db:reset

Likely caused by rails attempting to connect before Redis had fully started.

3. Stripe-related rspec/playwright tests fail

Issue: Tests that involve Stripe operations may fail due to invalid or missing customer IDs.

Resolution:

  1. Generate real customer id, simplest way to do it:
stripe customers create \
  --name "Customer Name" \
  --email "customer@example.com" \
  --api-key "sk_test_mock"
  1. Update company factories (on frontend and backend) with that customer id

Testing

# Run Rails specs
bundle exec rspec --tag '~skip' --tag '~type:system'

# Run a single spec
bundle exec rspec spec/system/roles/show_spec.rb:7

# Run Playwright end-to-end tests
pnpm playwright test

Services configuration

Stripe
  1. Create account at stripe.com and complete verification
  2. Enable Test mode (toggle in top right of dashboard)
  3. Navigate to DevelopersAPI keys
  4. Copy Publishable key (pk_test_...) and Secret key (sk_test_... - click "Reveal" first)
  5. Add to .env:
    NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_your_publishable_key_here
    STRIPE_SECRET_KEY=sk_test_your_secret_key_here
    
Wise
  1. Register at sandbox.transferwise.tech and complete email verification
  2. Click profile/avatar → Settings → copy your Membership number
  3. Go to Integrations and ToolsAPI tokensCreate API token
  4. Set permissions to Full Access, name it (e.g., "Flexile Development"), and copy the token immediately
  5. Add to .env:
    WISE_PROFILE_ID=12345678 # Should be a number
    WISE_API_KEY=your_full_api_token_here
    
Resend
  1. Create account at resend.com and complete email verification
  2. Navigate to API Keys in the dashboard
  3. Click Create API Key, give it a name (e.g., "Flexile Development")
  4. Copy the API key immediately (starts with re_)
  5. Add to .env:
    RESEND_API_KEY=re_your_api_key_here
    

Note: Keep credentials secure and never commit to version control.

License

Flexile is licensed under the MIT License.

About

Contractor payments

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published