Link to rubric self evaluation
The Tanda App is a Ruby on Rails application that allows users to set savings goals and track them collaboratively with friends and family, promoting financial accountability and transparency within groups, powered by cryptocurrency wallets.
- Installation
- Configuration
- Usage
- Contributing
- Visual Aids
- API Implementation
- End To End Testing
- Troubleshooting
- Notes
- License
- Contact
-
Clone the repository:
git clone https://github.com/viviancreates/tanda
-
Navigate to the project directory:
cd tanda
-
Install the required gems:
bundle install
-
Set up the database:
rails db:setup
-
Start the Rails server:
rails server
-
Open your browser and navigate to:
http://localhost:3000
Ensure the following environment variables are set up in a .env
file or in your deployment environment:
API_KEY_NAME=<Your API Key Name>
API_KEY_PRIVATE_KEY=<Your API Private Key>
- Verify and update
config/database.yml
with the correct database credentials if necessary. - Run the following commands to set up the database:
rails db:create rails db:migrate rails db:seed or rake sample_data
-
Start the Rails server:
rails server
-
Open your browser and navigate to http://localhost:3000 Follow the on-screen instructions to use the application
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a new branch (
git checkout -b feature-branch
) - Commit your changes (
git commit -m 'Add some feature'
) - Push to the branch (
git push origin feature-branch
) - Open a pull request
This project integrates with the Coinbase API to provide wallet creation, funding, and cryptocurrency transfers. These functionalities ensure secure and efficient cryptocurrency transaction handling.
To use the API, ensure the following environment variables are set:
API_KEY_NAME
API_KEY_PRIVATE_KEY
- Description: Creates a wallet for the user.
- Method:
POST
- Endpoint:
/users/:id/create_wallet
- Request Body: None
- Response:
{ "status": "success", "wallet_id": "mock_wallet_id", "balance": 0 }
- Description: Adds testnet funds to the user's wallet.
- Method:
POST
- Endpoint:
/users/:id/fund_wallet
- Request Body: None
- Response:
{ "status": "success", "transaction_hash": "<transaction_hash>", "transaction_link": "<transaction_link>", "balance": "<new_balance>" }
- Description: Transfers cryptocurrency to a recipient's wallet.
- Method:
POST
- Endpoint:
/users/:id/transfer
- Request Body:
{ "amount": "<amount>", "currency": "eth", "recipient_address": "<recipient_address>", "tanda_id": "<tanda_id>" }
- Response Body:
{ "status": "success", "transaction_link": "<transaction_link>", "updated_balance": "<updated_balance>" }
This project includes end-to-end tests to validate key workflows and ensure robust application functionality. The tests are implemented using Minitest
and are designed to simulate real-world usage scenarios.
- Create Wallet: Ensures a new wallet is successfully created and associated with the user.
- Fund Wallet: Validates the wallet funding process via a testnet faucet, ensuring the user's balance updates correctly.
- Transfer Funds: Tests transferring funds to another wallet address, verifying balance updates and transaction success.
- Profile and Friend Management: Confirms a user profile can be created and friend requests can be sent and accepted.
- Tanda Creation and Participation: Ensures users can create a Tanda with a defined goal amount and due date, and validates the addition of participants.
- Transaction Management: Tests adding transactions to a Tanda, ensuring amounts, descriptions, and transaction types are recorded accurately.
- The Coinbase functionality tests are implemented in
test/controllers/coinbase_api_test.rb
. - The Tanda application flow tests are implemented in
test/controllers/tanda_flow_test.rb
.
To execute the test suite, run the following command: rails test
-
Database Setup Issues: Ensure your PostgreSQL service is running and credentials are correctly configured in
config/database.yml
. -
Missing API Keys: Verify that
API_KEY_NAME
andAPI_KEY_PRIVATE_KEY
are set in the environment. -
Server Not Starting: Run
rails db:migrate
to ensure the database schema is up-to-date.
- Transfers show up on the transactions, converted to USD! :D Will add withdrawal functionality at a later date
- The Coinbase API provides a playground environment with a faucet to help test out wallet functionality
- The ETH and other assets obtained in this environment hold no real-world monetary value and are intended for testing purposes only
- Only Ethereum (ETH) is supported for transactions. Future updates will include a gasless option to minimize transaction costs and support for stablecoins to provide a more predictable payment option.
- Encryption for user data has not been implemented yet but is planned for a future update to ensure privacy and security
This project is licensed under the MIT License.
Vivian Davila - [email protected] Project Link: GitHub Repository