- Introduction
- Prerequisites
- Installation
- Development Server
- Building for Production
- Android Deployment
- Project Structure
- Environment Configuration
- Troubleshooting
This guide will help you set up and run the Expense Tracker application on your local machine. The application is built with React, TypeScript, and Vite, supporting both web and Android platforms through Capacitor.
Before you begin, ensure you have the following installed:
- Node.js (version 18 or higher)
- npm or yarn package manager
- Git for version control
- Android Studio (for Android deployment)
- Java Development Kit (JDK) 17 or higher
-
Clone the repository
git clone <repository-url> cd expense-tracker
-
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
Edit
.envwith your configuration if needed.
Start the development server:
npm run devThe application will be available at http://localhost:5173
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLintnpm run type-check- Run TypeScript compiler
-
Build the web application
npm run build
-
Preview the production build
npm run preview
-
Add Android platform (first time only)
npx cap add android
-
Sync web assets to Android
npx cap sync android
-
Open in Android Studio
npx cap open android
-
Build APK/Bundle
- In Android Studio: Build → Build Bundle(s) / APK(s)
- Or use Gradle commands
For development with live reload on Android:
npm run dev:androidexpense-tracker/
├── android/ # Android platform files
├── public/ # Static assets
├── src/
│ ├── assets/ # Images and static files
│ ├── components/ # Reusable UI components
│ ├── contexts/ # React Context providers
│ ├── hooks/ # Custom React hooks
│ ├── mocks/ # Mock data
│ ├── pages/ # Page components
│ ├── router/ # Routing configuration
│ ├── index.css # Global styles
│ └── main.tsx # Application entry
├── .env.example # Environment template
├── capacitor.config.ts # Capacitor configuration
├── package.json # Dependencies
├── tailwind.config.ts # Tailwind CSS config
├── tsconfig.json # TypeScript configuration
└── vite.config.ts # Vite configuration
Create a .env file with the following variables:
# Application
VITE_APP_NAME=Expense Tracker
VITE_APP_VERSION=1.0.0
# API (if applicable)
VITE_API_URL=http://localhost:3000
# Features
VITE_ENABLE_ANALYTICS=falseThe capacitor.config.ts file contains platform-specific settings:
const config: CapacitorConfig = {
appId: 'com.example.expensetracker',
appName: 'Expense Tracker',
webDir: 'dist',
server: {
androidScheme: 'https'
}
};Port already in use
# Kill process on port 5173
npx kill-port 5173Android build fails
- Ensure Android Studio is properly configured
- Check that JDK is installed and JAVA_HOME is set
- Run
npx cap sync androidafter web changes
Dependencies not resolving
rm -rf node_modules package-lock.json
npm installTypeScript errors
npm run type-checkIf you encounter issues:
- Check the Troubleshooting Guide
- Review component-specific documentation
- Check the project issues on GitHub
After setup, explore:
- Project Overview for architecture details
- Development Guidelines for coding standards
- Individual component documentation in respective folders