Welcome to the Doodocs Backend API! This project is a robust REST API designed for managing archives and sending emails. It was developed as part of the Doodocs Backend Challenge. 🚀
- 📁 Analyze archive files: Extract detailed structure and metadata.
- 🗜️ Create ZIP archives: Combine multiple files into a single archive.
- 📧 Send files via email: Deliver files to multiple recipients using SMTP.
- 💻 Go (Golang): Backend logic.
- 🌐 Gin: HTTP web framework.
- 📖 Swaggo: API documentation generation.
- ✉️ SMTP: Email functionality.
- 🐳 Docker: Containerization.
doodocs-backend/
├── cmd/ # Main application entry point
├── internal/
│ ├── config/ # Configuration and environment loading
│ ├── controller/ # Route handlers
│ ├── docs/ # Swagger documentation (auto-generated)
│ ├── middleware/ # Middleware logic
│ ├── model/ # Data models
│ ├── service/ # Business logic
├── test/ # Tests
│ ├── testdata/ # Sample files for testing
├── Dockerfile # Dockerfile for containerization
├── go.mod # Go module dependencies
├── go.sum # Go dependency checksum file
└── README.md # Project documentation
- 🛠️ Go 1.22 or higher
- 🐳 Docker (optional for containerization)
-
Clone the repository:
git clone https://github.com/doryngal/doodocs-backend.git cd doodocs-backend
-
Copy the
.env
file and update values:cp .env.example .env
-
Install dependencies:
go mod download
-
Run the application:
go run cmd/main.go
-
Access Swagger Documentation: Open http://localhost:8080/swagger/index.html in your browser.
-
Build the Docker image:
docker build -t doodocs-backend .
-
Run the Docker container:
docker run -p 8080:8080 --env-file .env doodocs-backend
-
Run tests:
go test ./...
-
What’s tested?:
- 📊 Archive Analysis Validation: Ensure archive files are analyzed correctly.
- 🗂️ Archive Creation: Validate handling of valid and invalid files during archive creation.
- ✉️ Email Functionality: Test email-sending with mocked configurations.
- 💻 Clean Code: Modular and maintainable design.
- 🏛️ Clean Architecture: Decoupled service and controller logic.
- 🧩 Extensibility: Easy to add new features.
- 🧪 Testing: Comprehensive unit tests for all key functionalities.
- 🚀 Performance: Optimized handling of archives and email processes.