- Navigate to Appwrite Console
- Click "Create Project" and name it "FinWise"
- Note your Project ID - you'll need this later
- Select your region (closest to your target users)
- Go to "Auth" section in left sidebar
- Click "Settings" tab
- Enable "Email/Password" provider
- Configure session length (recommend 30 days)
- Under "Teams", create a default team if needed for shared budgets
- Go to "Overview" → "Add Platform"
- Select "React Native" (or "Flutter" depending on your stack)
- Enter app name: "FinWise Mobile"
- Add bundle ID/package name:
com.yourcompany.finwise - Save the generated platform ID
- In Appwrite Console, go to "Settings" → "Environment Variables"
- Add any global variables (none needed initially)
- Note: API keys will be configured later for cloud functions
inside appwriteFunction folder create .env file and add the following variables
OPENROUTER_API_KEY=*****
- Navigate to "Databases" section
- Click "Create Database"
- Name:
finwise_db - Set ID (auto-generated or custom)
- Enable "Advanced Security" options
- Inside your database, click "Create Collection"
- Name:
user_profiles - Set Collection ID:
user_profiles
Add Attributes:
userId(string, required) - References Appwrite auth user IDdisplayName(string, required) - User's full nameemail(string, required) - User's emailavatar(string, optional) - Profile picture URLmonthlyIncome(float, optional) - For budget calculationscurrency(string, default: "USD") - Preferred currencycreatedAt(datetime, auto-generated)updatedAt(datetime, auto-updated)
Set Indexes:
userId_idxonuserIdfield (unique)
Configure Permissions:
- Create:
role:all - Read:
user:$userId - Update:
user:$userId - Delete:
user:$userId
- Click "Create Collection"
- Name:
transactions - Collection ID:
transactions
Add Attributes:
title(string, required) - Transaction descriptionamount(float, required) - Monetary valuetype(enum: "expense", "income", required)category(string, required) - Category identifierdate(datetime, required) - Transaction dateuserId(string, required) - Owner referencenotes(string, optional) - Additional detailsreceiptImageId(string, optional) - Reference to storage filetags(array of strings, optional) - For filteringisRecurring(boolean, default: false)createdAt(datetime, auto-generated)
Set Indexes:
user_date_idxonuserIdanddate(descending)user_category_idxonuserIdandcategory
Configure Permissions:
- Create:
user:$userId - Read:
user:$userId - Update:
user:$userId - Delete:
user:$userId
- Click "Create Collection"
- Name:
budgets - Collection ID:
budgets
Add Attributes:
category(string, required) - Category this budget applies toamount(float, required) - Monthly budget limitmonth(string, required) - Format: YYYY-MMuserId(string, required) - Owner referencenotificationThreshold(float, default: 80) - Percentage to trigger alertscolor(string, optional) - UI color codeicon(string, optional) - Icon identifiercreatedAt(datetime, auto-generated)
Set Indexes:
user_month_idxonuserIdandmonthuser_category_month_idxcomposite index
Configure Permissions:
- Create:
user:$userId - Read:
user:$userId - Update:
user:$userId - Delete:
user:$userId
- Go to "Storage" section
- Click "Create Bucket"
- Name:
receipts - Bucket ID:
receipts
Configure Settings:
- Maximum file size: 10 MB
- Allowed file types:
image/jpeg,image/png,image/heic,application/pdf - Enable "File security" for user isolation
- Enable "Encryption" for sensitive documents
Set Permissions:
- Create:
user:$userId - Read:
user:$userId - Update:
user:$userId - Delete:
user:$userId
- Navigate to "Functions" section
- Click "Create Function"
- Name:
ai-financial-assistant - Runtime: Node.js 18+ (or Python 3.9+)
- Permissions: Enable access to database and storage
Environment Variables:
OPENAI_API_KEY(or Anthropic/other LLM provider key)DATABASE_IDfrom your databaseCOLLECTION_TRANSACTIONS_ID
Function Code Structure:
// Main handler that processes user queries
// Fetches user's recent transactions
// Constructs context about spending patterns
// Calls LLM with financial context
// Returns personalized advice