Thanks to visit codestin.com
Credit goes to github.com

Skip to content

omeraydindev/flexile

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Flexile

Contractor payments as easy as 1-2-3.

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 to:

  • Set up Ruby (ideally using rbenv/rvm) and PostgreSQL
  • Install dependencies using pnpm i and cd backend && bundle i
  • Set up your environment by either using pnpx vercel env pull .env or cp .env.example .env and filling in missing values and your own keys
  • Run cd backend && gem install foreman

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 https://flexile.dev

Check the seeds for default data created during setup.

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.

Testing

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

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

Services configuration

Clerk
  1. Go to clerk.com and create a new app.
  2. Name it whatever you like and disable all login methods except Email Address and Google. Clerk Sanbox Creation
  3. Once created, copy the Publishable Key into NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and Secret Key into CLERK_SECRET_KEY in the .env file. Clerk Env Variables

Test User Setup for Playwright Tests

For Playwright end-to-end tests to work locally, you need to manually create 4 specific test users in your Clerk dashboard that match the hardcoded values in e2e/helpers/auth.ts:

  1. Go to your Clerk dashboard → UsersCreate User

  2. Create the following 4 users with these exact email addresses:

  3. After creating each user, copy their generated User ID from the Clerk dashboard

  4. Update the corresponding user IDs in e2e/helpers/auth.ts in the clerkTestUsers array to match the actual IDs generated by Clerk

Important: Clerk generates unique user IDs that cannot be manually set during user creation. The IDs currently in the code (user_2rV0f8ymVAsk3S0V6EhfSiQcGbK, etc.) are examples and must be replaced with the actual IDs from your Clerk dashboard.

Without these test users, running pnpm playwright test e2e/helpers/auth.ts will fail locally.

Stripe
  1. Go to your Developers dashboard at stripe.com.
  2. Turn on Test mode.
  3. Go to the API Keys tab and copy the Publishable Key into NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY and Secret Key into STRIPE_SECRET_KEY in the .env file. Stripe Secret Key
Wise
  1. Go to sandbox.transferwise.tech and make a brand new Wise account using the register option and following Wise instructions.
  2. Once you got your account set up click on your profile. Wise Sandbox Page
  3. Copy your Membership number and paste it into WISE_PROFILE_ID in the .env file. Wise Sandbox Profile Settings
  4. Go to Integrations and Tools and then to API tokens.
  5. Create a new API token making sure it is set to Full Access.
  6. Reveal the full API key and copy it into WISE_API_KEY in the .env file. Wise Sandbox API Settings

License

Flexile is licensed under the MIT License.

About

Contractor payments as easy as 1-2-3

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 56.5%
  • TypeScript 38.2%
  • JavaScript 3.7%
  • HTML 1.3%
  • CSS 0.1%
  • Shell 0.1%
  • Other 0.1%