Refund API 💸

The backend API for the Refund application. Built with Node.js, Express, and Prisma, it provides endpoints for managing financial transactions.
✨ Features
- Full CRUD Support: Create, read, update, and delete transactions.
- Secure Authentication: User authentication and route protection using JWT.
- File Uploads: Supports file uploads for receipts or attachments using Multer.
- Type-safe: Built with TypeScript and validated with Zod to ensure data integrity.
- Secure Password Storage: Passwords are encrypted using
bcrypt
.
🛠️ Tech Stack
🚀 Getting Started
To run this project locally, you’ll need Node.js and npm.
- Clone the repository:
git clone https://github.com/rafabt-hub/refound-api.git
- Navigate to the project directory:
- Install dependencies:
- Set up environment variables:
Create a
.env
file in the root directory and add your database connection string and JWT secret.
DATABASE_URL="your-database-connection-string"
JWT_SECRET="your-super-secret-key"
- Run database migrations:
- Run the development server:
The API will be available at http://localhost:3000
(or the port defined in your server.ts
).
📄 License
This project is licensed under the MIT License.
🇧🇷 Ver em Português
> A API backend para a aplicação Refund. Construída com Node.js, Express e Prisma, ela fornece endpoints para gerenciar transações financeiras.
### ✨ Funcionalidades
- **Suporte CRUD Completo:** Crie, leia, atualize e delete transações.
- **Autenticação Segura:** Autenticação de usuário e proteção de rotas usando JWT.
- **Upload de Arquivos:** Suporte para upload de arquivos (recibos, anexos) com Multer.
- **Tipagem Segura:** Construído com TypeScript e validado com Zod para garantir a integridade dos dados.
- **Armazenamento Seguro de Senhas:** Senhas são criptografadas com `bcrypt`.
### 🚀 Como Executar
1. **Clone o repositório.**
2. **Navegue até a pasta do projeto.**
3. **Instale as dependências:** `npm install`.
4. **Configure as variáveis de ambiente:** Crie um arquivo `.env` com a string de conexão do banco e um segredo para o JWT.
5. **Execute as migrações do banco:** `npx prisma migrate dev`.
6. **Inicie o servidor:** `npm run dev`.