transactionsAPI is a secure and user-friendly RESTful API designed for managing financial transactions. Built on Node.js and PostgreSQL, it offers essential features such as user authentication, transaction recording (income and expenses), retrieval of transaction lists, and summary details. transactionsAPI ensures data security through JWT-based authentication and provides a straightforward interface for users to monitor and control their financial activities.
-
User Authentication:
- Implements JWT-based authentication for secure user interactions.
-
Transaction Operations:
- Add a New Transaction:
- Endpoint:
POST /transactions
- Record income or expenses by providing details like description, amount, and type.
- Endpoint:
- Retrieve Transactions:
- Endpoint:
GET /transactions
- Access a list of transactions for a detailed overview of financial activities.
- Endpoint:
- Retrieve Transactions Summary:
- Endpoint:
GET /transactions/summary
- Obtain a summary of total income, total expenses, and savings for a specified period.
- Endpoint:
- Delete a Specific Transaction:
- Endpoint:
DELETE /transactions/:id
- Delete a specific transaction based on its unique identifier.
- Endpoint:
- Add a New Transaction:
-
Data Validation and Security:
- Ensures robust data validation and sanitization to prevent common vulnerabilities.
-
Response Handling:
- Uses standard HTTP status codes and provides meaningful JSON responses.
-
Home Route:
- Endpoint:
GET /
- Displays a welcome message and redirects users to the API documentation.
- Endpoint:
-
Database Schema:
- Utilizes PostgreSQL with two tables: 'users' for storing user information and 'transactions' for transaction details.
- Ensure Node.js and PostgreSQL are installed.
- Clone the transactionsAPI repository and install dependencies.
- Configure PostgreSQL connection details and secret keys.
- Run the API server locally and start interacting with the endpoints.
- Register or login to receive a JWT token.
- Include the token in the
Authorization
header for authenticated requests. - Explore transaction-related endpoints for recording, retrieving, and managing financial data.
Contributions are welcome! If you have any suggestions, issues, or improvements, feel free to open a GitHub issue or submit a pull request.
This project is licensed under the MIT License.