|
| 1 | +# Odin Wallet |
| 2 | + |
| 3 | +A professional, mobile-first personal finance management application built with Go and React. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +## Features |
| 8 | + |
| 9 | +- **Multi-user Support**: Secure registration and authentication with session-based cookies |
| 10 | +- **Multiple Account Types**: Cash, Debit Card, Credit Card, Loan, Savings, Investment |
| 11 | +- **Transaction Tracking**: Categorized transactions with detailed history |
| 12 | +- **Financial Overview**: Assets vs Liabilities dashboard with net worth calculation |
| 13 | +- **Multi-currency Support**: Track accounts in different currencies |
| 14 | +- **Mobile-first Design**: Responsive UI optimized for mobile and desktop |
| 15 | + |
| 16 | +## Tech Stack |
| 17 | + |
| 18 | +- **Backend**: Go with Chi router and SQLite |
| 19 | +- **Frontend**: React 18 + Vite + TailwindCSS + Framer Motion |
| 20 | +- **Deployment**: Docker with GitHub Actions CI/CD |
| 21 | + |
| 22 | +## Development Setup |
| 23 | + |
| 24 | +### Prerequisites |
| 25 | + |
| 26 | +- Go 1.21+ |
| 27 | +- Node.js 20+ |
| 28 | +- npm or pnpm |
| 29 | + |
| 30 | +### Quick Start |
| 31 | + |
| 32 | +```bash |
| 33 | +# Clone the repository |
| 34 | +git clone https://github.com/kengru/odin-wallet.git |
| 35 | +cd odin-wallet |
| 36 | + |
| 37 | +# Start the backend (from root directory) |
| 38 | +go mod download |
| 39 | +go run cmd/server/main.go |
| 40 | + |
| 41 | +# In a separate terminal, start the frontend |
| 42 | +cd frontend |
| 43 | +npm install |
| 44 | +npm run dev |
| 45 | +``` |
| 46 | + |
| 47 | +- Backend runs on `http://localhost:8080` |
| 48 | +- Frontend dev server runs on `http://localhost:5173` (proxies API requests to backend) |
| 49 | + |
| 50 | +## Production Deployment (Docker) |
| 51 | + |
| 52 | +### Pull from GitHub Container Registry |
| 53 | + |
| 54 | +```bash |
| 55 | +# Pull the latest image |
| 56 | +docker pull ghcr.io/kengru/odin-wallet:latest |
| 57 | + |
| 58 | +# Run with persistent data volume |
| 59 | +docker run -d \ |
| 60 | + --name odin-wallet \ |
| 61 | + -p 8080:8080 \ |
| 62 | + -v $(pwd)/wallet-data:/app/data \ |
| 63 | + -e SESSION_SECRET=your-secure-secret-here \ |
| 64 | + ghcr.io/kengru/odin-wallet:latest |
| 65 | +``` |
| 66 | + |
| 67 | +Access the application at `http://localhost:8080` |
| 68 | + |
| 69 | +### Build from Source |
| 70 | + |
| 71 | +```bash |
| 72 | +# Build the Docker image |
| 73 | +docker build -t odin-wallet . |
| 74 | + |
| 75 | +# Run the container |
| 76 | +docker run -d \ |
| 77 | + --name odin-wallet \ |
| 78 | + -p 8080:8080 \ |
| 79 | + -v $(pwd)/wallet-data:/app/data \ |
| 80 | + -e SESSION_SECRET=your-secure-secret-here \ |
| 81 | + odin-wallet |
| 82 | +``` |
| 83 | + |
| 84 | +## Environment Variables |
| 85 | + |
| 86 | +| Variable | Description | Default | |
| 87 | +| ---------------- | ------------------------------------------------------- | --------------------------------- | |
| 88 | +| `PORT` | Server port | `8080` | |
| 89 | +| `SESSION_SECRET` | Secret key for session cookies (required in production) | `dev-secret-change-in-production` | |
| 90 | +| `DB_PATH` | Path to SQLite database file | `./data/wallet.db` | |
| 91 | + |
| 92 | +## Account Types |
| 93 | + |
| 94 | +| Type | Description | Balance Field | |
| 95 | +| --------------- | -------------------------------- | ------------------------------------------ | |
| 96 | +| **Cash** | Physical cash tracking | `current_balance` | |
| 97 | +| **Debit Card** | Bank debit/checking accounts | `current_balance` | |
| 98 | +| **Credit Card** | Credit cards with limit tracking | `credit_owed` | |
| 99 | +| **Loan** | Loans with payment tracking | `loan_current_owed` | |
| 100 | +| **Savings** | Savings accounts with interest | `current_balance` + `yearly_interest_rate` | |
| 101 | +| **Investment** | Investment accounts | `current_balance` + `yearly_interest_rate` | |
| 102 | + |
| 103 | +## Transaction Categories |
| 104 | + |
| 105 | +Groceries, Dining, Transport, Utilities, Rent, Healthcare, Entertainment, Shopping, Subscriptions, Games, Travel, Education, Fitness, Personal, Gifts, Income, Transfer, Other |
| 106 | + |
| 107 | +## API Endpoints |
| 108 | + |
| 109 | +### Authentication |
| 110 | + |
| 111 | +- `POST /api/auth/register` - Register a new user |
| 112 | +- `POST /api/auth/login` - Login |
| 113 | +- `POST /api/auth/logout` - Logout |
| 114 | +- `GET /api/auth/me` - Get current user |
| 115 | + |
| 116 | +### Accounts |
| 117 | + |
| 118 | +- `GET /api/accounts` - List all accounts |
| 119 | +- `POST /api/accounts` - Create account |
| 120 | +- `GET /api/accounts/:id` - Get account details |
| 121 | +- `PUT /api/accounts/:id` - Update account |
| 122 | +- `DELETE /api/accounts/:id` - Delete account |
| 123 | +- `GET /api/overview` - Get financial overview |
| 124 | + |
| 125 | +### Transactions |
| 126 | + |
| 127 | +- `POST /api/accounts/:id/transactions` - Create transaction |
| 128 | +- `GET /api/accounts/:id/transactions` - List account transactions |
| 129 | +- `GET /api/transactions/recent` - Get recent transactions across all accounts |
| 130 | + |
| 131 | +## Project Structure |
| 132 | + |
| 133 | +``` |
| 134 | +wallet/ |
| 135 | +├── cmd/server/ # Go server entry point |
| 136 | +├── internal/ |
| 137 | +│ ├── handlers/ # HTTP request handlers |
| 138 | +│ ├── middleware/ # Auth middleware |
| 139 | +│ ├── models/ # Data models |
| 140 | +│ └── services/ # Business logic |
| 141 | +├── pkg/database/ # SQLite initialization |
| 142 | +├── frontend/ |
| 143 | +│ ├── src/ |
| 144 | +│ │ ├── api/ # API client |
| 145 | +│ │ ├── components/ # React components |
| 146 | +│ │ ├── contexts/ # React contexts |
| 147 | +│ │ ├── pages/ # Page components |
| 148 | +│ │ └── types/ # TypeScript types |
| 149 | +│ └── ... |
| 150 | +├── Dockerfile |
| 151 | +├── .github/workflows/ # CI/CD |
| 152 | +└── README.md |
| 153 | +``` |
| 154 | + |
| 155 | +## License |
| 156 | + |
| 157 | +Private - Odin Company |
| 158 | + |
| 159 | +--- |
| 160 | + |
| 161 | +Built with 💛 by Odin |
0 commit comments