SafeStash is a secure and user-friendly financial management platform designed to empower users in developing nations. It provides a seamless interface for managing digital assets, making deposits, withdrawals, and tracking transaction history. SafeStash aims to enhance financial stability and accessibility through innovative technology.
SafeStash is built with a modern, scalable architecture that ensures security, performance, and maintainability. The architecture consists of the following key components:
- Frontend: A NextJS application that provides a responsive and intuitive user interface.
- Backend: A Flask-based RESTful API that handles authentication, session management, and business logic.
- Database: A Supabase PostgreSQL database that stores user data, transaction history, and other relevant information.
- Authentication: Session-based authentication for secure and stateless user sessions.
- Third-Party Integrations: Integration with external services such as Stellar for blockchain transactions, Momo API for mobile money operations, and currency exchange api.
SafeStash operates through a series of well-defined steps to ensure secure and efficient financial management:
-
User Registration and Authentication:
- Users sign up and log in using their email and password.
- Session-based authentication is used to manage user sessions securely.
-
Dashboard Access:
- Upon successful login, users are redirected to the dashboard.
- The dashboard provides an overview of the user's account, including balance, recent transactions, and quick actions.
-
Deposits and Withdrawals:
- Users can make deposits and withdrawals through the dashboard.
- For deposits, users enter the amount, currency, and mobile number.
- The backend processes the deposit request, interacts with the Momo API for mobile money operations, and updates the user's balance.
- For withdrawals, users enter the amount and destination details.
- The backend processes the withdrawal request, interacts with the Stellar network for blockchain transactions, and updates the user's balance.
-
Real-Time Exchange Rates:
- SafeStash integrates with a currency exchange API to provide real-time exchange rates.
- Users can view the current exchange rates and convert their assets accordingly.
-
Transaction History:
- Users can view their transaction history on the dashboard.
- The transaction history includes details such as date, description, amount, and status.
-
Security Measures:
- All sensitive data is encrypted and securely stored.
- HTTP session cookies are used for secure and stateless authentication.
- CORS is configured to allow secure cross-origin requests.
- Node.js >= 18.18.0 and npm (for frontend)
- Python 3.8+ and pip (for backend)
-
Clone the Repository:
git clone https://github.com/your-username/safestash.git cd safestash/frontend -
Install Dependencies:
npm install # or -
Set Environment Variables: Create a
.env.localfile copied from.env.examplein the frontend directory -
Run the Development Server:
npm run dev
-
Build for Production:
npm run build
-
Start the Production Server:
npm start
-
Clone the Repository:
git clone https://github.com/your-username/safestash.git cd safestash/backend -
Create a Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Dependencies:
pip install -r requirements.txt
-
Set Environment Variables: Create a
.envfile copied form.env.examplein thebackenddirectory: -
Run the Development Server:
flask run # or python app.py
Supabase is an open-source Firebase alternative that provides a suite of backend services, including a PostgreSQL database, authentication, and real-time subscriptions. Follow these steps to set up Supabase for your project:
-
Create a Supabase Account:
- Go to the Supabase website and sign up for an account.
- After signing up, create a new project.
-
Set Up the Database:
- Once your project is created, navigate to the "Database" section in the Supabase dashboard.
- You will find the connection details for your database, including the
API URL,anon key, andservice_role key.
-
Configure Environment Variables:
- Create a
.envfile in your project root directory (if it doesn't already exist). - Add the following environment variables to the
.envfile, replacing the placeholders with your actual Supabase project details:
SUPABASE_URL=https://your-supabase-url.supabase.co SUPABASE_KEY=your-key
- Create a


