Skip to content

MyKl-Y/MYAssets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

m.y Assets

A robust and scalable Flutter application for managing user accounts, budgets, and transactions with secure backend authentication, including Google OAuth2 integration.

Features

  • User Registration and Login:

    • Traditional username and password authentication.
    • Google Sign-In for seamless login.
  • Account Management:

    • Add, view, and manage accounts with real-time balance updates.
  • Transaction Management:

    • Add, view, and categorize transactions.
    • Supports income and expense tracking with auto-balance adjustment.
  • Secure Backend:

    • JWT-based authentication with token refresh support.
    • Secure API endpoints for managing users, accounts, and transactions.
  • Responsive Design:

    • Optimized for web, desktop, and mobile platforms.

Tech Stack

Frontend

Backend


Installation

Frontend Setup

  1. Install Flutter on your machine.
  2. Clone the repository:
    git clone https://github.com/MyKl-Y/MYAssets
    cd client
  3. Install dependencies:
    flutter pub get
  4. Run the app:
    flutter run

Backend Setup

  1. Install Python 3.9 or higher.
  2. Clone the repository:
    git clone https://github.com/MyKl-Y/MYAssets
    cd server
  3. Create a virtual environment:
    python -m venv venv
    source venv/bin/activate # On Windows: venv\Scripts\activate
  4. Create environment variables (in a .env file):
    SECRET_KEY=<your_secret_key>
    DATABASE_URL=<your_database_url>
    JWT_SECRET_KEY=<your_jwt_secret_key>
  5. Install dependencies:
    pip install -r requirements.txt
  6. Run the server:
    flask run

Usage

  1. Launch the Backend:
    • Run the Flask server:
      flask run
  2. Run the Frontend:
    • Open a terminal in the client directory and run:
      flutter run
  3. Login/Register:
    • Use the app to create an account or log in using Google OAuth2.
  4. Add Accounts, Transactions, etc.
    • Navigate to the "Add" tab to manage accounts and transactions.

API Endpoints

Authentication

  • POST /login: User login with username and password.
  • POST /register: User registration.
  • POST /google-login: Google OAuth2 login.
  • POST /refresh: Refresh JWT access token.

User

  • GET /user: Fetch the logged-in user.

Accounts

  • GET /accounts: Retrieve all user accounts.
  • POST /accounts: Add a new account.
  • PUT /account/<id>: Updates an account by its ID.
  • DELETE /account/<id>: Deletes an account by its ID.

Transactions

  • GET /transactions: Retrieve all user transactions.
  • GET /transactions/<account>: Retrieve all transactions for a given account.
  • POST /transactions: Add a new transaction.
  • PUT /transaction/<id>: Updates a transaction by its ID.
  • DELETE /transaction/<id>: Deletes a transaction by uts ID.

Google OAuth2 Setup

  1. Create a new project in the Google Cloud Console.
  2. Enable the Google Identity Services API.
  3. Configure OAuth2 credentials and authorized redirect URIs:
    • Backend: http://127.0.0.1:42069
    • Frontend: Add any necessary mobile or web platform configurations.
  4. Replace "YOUR_GOOGLE_CLIENT_ID" in the backend code with your client ID.

Folder Structure

project/
├── client/                # Flutter frontend
│   ├── lib/
│   │   ├── screens/       # UI screens
│   │   ├── widgets/       # Reusable components
│   │   ├── services/      # API service integration
│   │   └── utils/         # State management and helpers
│   ├── pubspec.yaml       # Frontend dependencies
│   └── assets/            # Assets
│       └── images/        # Images
├── server/                # Flask backend
│   ├── app/
│   │   ├── api.py         # API routes
│   │   ├── models.py      # Database models
│   │   └── utils.py       # Utility functions
│   └── requirements.txt   # Backend dependencies
├── README.md              # Project documentation
└── todo.md                # List of features to implement

Contributing

  1. Fork the repository
  2. Create a new branch:
    git checkout -b feature-name
  3. Commit your changes:
    git commit -m "Add feature-name..."
  4. Push to the branch:
    git push origin feature-name
  5. Open a pull request.

Contact

For questions or support, please reach out to the maintainer(s):

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published