A Go-based REST API that enriches personal data by automatically determining age, gender, and nationality based on a person's name.
- CRUD operations for persons, genders, and nationalities
- Automatic enrichment of personal data using external APIs
- Age - https://api.agify.io/?name=Dmitriy
- Gender - https://api.genderize.io/?name=Dmitriy
- Nationality - https://api.nationalize.io/?name=Dmitriy
- PostgreSQL database storage
- Swagger documentation
- Go 1.18+
- PostgreSQL database
-
Clone the repository
-
Create a
.envfile with database configuration like .env.example:
```env
DATABASE_DSN=postgres://postgres:pass@localhost:5432/postgres?sslmode=disable PORT=8080- Run the application:
go run cmd/main.go- Access Swagger documentation: http://localhost:8080/swagger/index.html
The application uses three tables:
persons: Stores personal informationgenders: Reference table for gender typesnationalities: Reference table for nationality codes