The Expense Tracker API is a RESTful API built with Spring Boot and PostgreSQL, allowing users to manage their expenses securely. Users can sign up, log in, and track their expenses in different categories. The API provides filtering options for past expenses and ensures data security with JWT authentication.
- User Authentication
- Sign up as a new user
- Log in and receive a JWT token
- Secure endpoints with JWT authentication
- Expense Management
- Add new expenses
- View all expenses
- Update existing expenses
- Delete expenses
- Expense Categories
- Groceries
- Leisure
- Electronics
- Utilities
- Clothing
- Health
- Others
- Backend: Spring Boot
- Database: PostgreSQL
- Authentication: JSON Web Tokens (JWT)
- ORM: Hibernate (JPA)
- Ensure you have Java and PostgreSQL installed.
- Set up a PostgreSQL database and configure the credentials.
- Clone the repository:
git clone https://github.com/your-username/expense-tracker-api.git cd expense-tracker-api
- Configure the database in
application.properties
:spring.datasource.url=jdbc:postgresql://localhost:5432/your-database spring.datasource.username=your-username spring.datasource.password=your-password spring.jpa.hibernate.ddl-auto=update jwt.secret=your-secret-key
- Build and run the application:
mvn clean install mvn spring-boot:run
Method | Endpoint | Description |
---|---|---|
POST | /api/v1/auth/register | Register a user |
POST | /api/v1/auth/login | Authenticate user |
Method | Endpoint | Description |
---|---|---|
GET | /api/v1/expenses | Get all user expenses |
POST | /api/v1/expenses | Add a new expense |
PUT | /api/v1/expenses/:id | Update an existing expense |
DELETE | /api/v1/expenses/:id | Delete an expense |
- Uses JWT tokens to protect endpoints.
- Users can only access their own expenses.
- Passwords are hashed using BCrypt for secure storage.
- Fork the repository.
- Create a feature branch (
git checkout -b feature-name
). - Commit your changes (
git commit -m "Add feature"
). - Push to the branch (
git push origin feature-name
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any issues or inquiries, please reach out via GitHub Issues or email at azamatabraev07@example.com
.