Expenser is an expense tracking application designed to help users manage their personal finances effectively. The application consists of a backend server built with Go and a frontend user interface developed using React, TypeScript, and Vite.
- Easy Expense Tracking: Quickly add, edit, or remove expenses with just a few clicks.
- Categorized Expenses: Group expenses into categories (like Food, Transportation, Shopping) for better organization.
- Analytics & Reports: View summaries, charts, and expense patterns to analyze your spending habits.
- Secure Storage: Data is securely stored so you can track your expenses over time.
- User Authentication: Secure login and registration using JWT tokens.
- Go (Golang) 1.22
- PostgreSQL
- JWT for authentication (
github.com/golang-jwt/jwt/v5) - UUID generation (
github.com/google/uuid) - Password hashing (
golang.org/x/crypto) - Environment variable management (
github.com/joho/godotenv) - CORS handling (
github.com/rs/cors) - SQLC for database query generation
- React 18
- TypeScript
- Vite
- Shadcn/ui
- React Router
- ESLint and Prettier for code styling
- Context API for state management
-
Clone the Repository
git clone https://github.com/keertirajmalik/expenser.git
-
Navigate to the Backend Directory
cd expenser-server -
Set Up Environment Variables
Create a
.envfile in theexpenser-serverdirectory:touch .env
Add the following variables to
.env:PORT=8080 DB_URL=postgresql://<username>:<password>@localhost:5432/<database_name>?sslmode=disable JWT_SECRET=<your_jwt_secret_key> DB_USERNAME=<username> DB_PASSWORD=<password> DB_DATABASE=<database_name>
-
Install Dependencies
go mod tidy
-
Run Database Migrations
# Using psql psql -U <username> -d <database_name> -f db/schema/001_init.sql # Or using a migration tool like goose goose postgres "user=${DB_USERNAME} dbname=${DB_DATABASE} sslmode=disable host=localhost password=${DB_PASSWORD}" -dir database/schema up
Note: Ensure your database user has sufficient privileges to create tables and indexes.
-
Start the Server
go run main.go
The server should now be running on
http://localhost:8080.
-
Navigate to the Frontend Directory
cd expenser-ui -
Install Dependencies
npm install
-
Set Up Environment Variables
Create a
.envfile in theexpenser-uidirectory:touch .env
Add the following variable to
.env:VITE_APP_DEV_BACKEND_URL=http://localhost:8080
-
Start the Development Server
npm run dev
The application should now be running on
http://localhost:3000.
-
Access the Application Once the development server is running, open
http://localhost:3000in your browser to view the application. -
Register a New Account
Click on the signup link and create a new user account.
-
Login
Use your credentials to log in to the application.
-
Manage Transactions
- Click on "Add Expense" and fill in details like amount, description, and category.
- View your transaction history.
- Update or delete existing transactions.
-
Manage Categories
- Create expense categories according to your needs.
- View your expense categories.
- Update or delete existing expense categories.
-
View Reports
Navigate to the "Dashboard" section to get an overview of your expenses by category or date range
expenser/
├── expenser-server/ # Backend server code
│ ├── auth/ # Authentication logic
│ ├── database/ # Database configurations and queries
│ ├── internal/ # Internal packages (auth, database models)
│ │ ├── handler/ # routes handlers
│ │ ├── model/ # Data models
│ │ ├── repository/ # DB related code
│ │ └── server/ # server configuration
│ ├── middleware/ # Middleware functions
│ └── main.go # Entry point of the backend server
└── expenser-ui/ # Frontend client code
├── src/
│ ├── app/ # Application pages
│ ├── components/ # React components
│ ├── hooks/ # Hooks
│ ├── lib/ # utils
│ ├── providers/ # Context providers
│ └── types/ # Type definitions
├── tsconfig.json # TypeScript configuration
└── vite.config.ts # Vite configuration
Contributions are welcome! Please fork the repository and create a pull request with your changes.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Keertiraj Malik - @keertiraj_malik - keertirajmalik@icloud.com Project Link: https://github.com/keertirajmalik/expenser
Thank you for using Expenser! If you have any questions or suggestions, feel free to open an issue or contact the maintainers of the project.