A modern, production-ready REST API for managing game details built with ASP.NET Core and PostgreSQL.
- ✅ RESTful API - Clean, well-documented endpoints
- ✅ PostgreSQL Database - Reliable data persistence
- ✅ Entity Framework Core - ORM for database operations
- ✅ OpenAPI/Scalar Documentation - Interactive API explorer
- ✅ CORS Enabled - Secure cross-origin requests
- ✅ Database Migrations - Version-controlled schema changes
- ✅ Docker Support - Containerized deployment
- ✅ Render Deployment Ready - One-click cloud deployment
- .NET 10.0+
- PostgreSQL 14+
- Git
- Docker (optional, for containerized deployment)
git clone https://github.com/your-username/TestAPI.git
cd TestAPIcd API
dotnet restoreCreate a .env file in the API directory:
DB_CONNECTION=Host=localhost;Port=5432;Database=gamedb;Username=postgres;Password=your_passworddotnet ef database updatedotnet runThe API will be available at: https://localhost:5007
Local: https://localhost:5007
Production: https://gameinfoapi.onrender.com
GET /gamedetailsResponse:
[
{
"id": 1,
"title": "The Legend of Zelda",
"description": "Adventure game",
"coverImageUrl": "https://example.com/zelda.jpg"
}
]GET /gamedetails/{id}Example: GET /gamedetails/1
POST /gamedetails
Content-Type: application/json
{
"title": "Elden Ring",
"description": "Action RPG",
"coverImageUrl": "https://example.com/elden.jpg"
}PUT /gamedetails/{id}
Content-Type: application/json
{
"title": "Elden Ring: Shadow of the Erdtree",
"description": "Updated description",
"coverImageUrl": "https://example.com/elden-updated.jpg"
}DELETE /gamedetails/{id}TestAPI/
├── API/
│ ├── Controllers/ # API endpoints
│ │ └── GameDetailsController.cs
│ ├── Data/ # Database context
│ │ └── AppDbContext.cs
│ ├── Models/ # Entity models & DTOs
│ │ ├── GameDetail.cs
│ │ └── GameDetailDTO.cs
│ ├── Migrations/ # Database migrations
│ ├── Program.cs # Application startup
│ ├── API.csproj
│ └── appsettings.json
├── Dockerfile # Docker configuration
├── TestAPI.sln # Solution file
└── README.md # This file
Made with ❤️ by Dhruv Darji