This is the HNGx Backend Project 2, a RESTful API built using C# and .NET 7 Minimal API framework. It provides endpoints to manage a list of persons, allowing you to perform basic CRUD operations (Create, Read, Update, Delete) on person records. The API is containerized with Docker and hosted on Render, making it easy to deploy and scale.
To run this project locally or deploy it on your own server, follow these steps:
-
Prerequisites:
- .NET 7 SDK
- Docker
- Render account for deployment (optional)
-
Configure the PostgreSQL database connection: Update the database connection string in the appsettings.json file to point to your PostgreSQL database.
-
Clone the Repository:
git clone https://github.com/richkazz/HNGx.git cd HNGx
-
Build and Run Locally:
dotnet build dotnet run
-
Access the API:
The API should now be running locally at
http://localhost:8080/api
.
For detailed information on the API endpoints and how to use them, please refer to the API Documentation.
This project is Dockerized, allowing for easy deployment and scaling. To build a Docker image and run it locally, follow these steps:
-
Build the Docker Image:
docker build -t hngx.
-
Run the Docker Container:
docker run -p 8080:80 hngx
The API will be accessible at
http://localhost:8080/api
.
To deploy this project on Render, follow these steps:
-
Create a Render Account:
If you haven't already, sign up for a Render account at https://render.com/.
-
Create a New Web Service:
- Choose "Docker" as the environment.
- Link your GitHub repository.
- Configure the build settings and environment variables as needed.
-
Deploy the Service:
Render will automatically build and deploy your Docker container. Once deployed, your API will be accessible at the provided URL.