ProfileHub is a RESTful API developed on ASP.NET Core that allows you to manage users and upload their photos to AWS S3.
- ASP.NET Core 6
- Entity Framework Core
- SQLite
- AWS SDK for .NET
- AWS S3
- Swagger (OpenAPI)
-
Clone the repository:
git clone https://github.com/MINT-KISS/ProfileHub.git cd ProfileHub
-
Install dependencies:
dotnet restore
-
Create the database and apply the migrations: ```bash dotnet restore 3.
dotnet ef database update
Before running the project, you must configure AWS S3 and update the appsettings.json
file.
-
Customize AWS S3:
- Create an account on AWS if you don't already have one.
- Create an S3 bucket to store your photos.
- Get your access keys (Access Key ID and Secret Access Key).
-
Update
appsettings.json
:{ "ConnectionStrings": { "DefaultConnection": "Data Source=Database/ProfileHub.db" }, "AWS": { "AccessKey": "your-access-key", "SecretKey": "your-secret-key", "Region": "your-region", "BucketName": "your-bucket-name" }, "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "AllowedHosts": "*" }
-
Start the project:
dotnet run
-
Open the Swagger UI:
Go to https://localhost:5203/swagger in your browser to see the documentation and test the API.
- GET
/api/users
- Get all users. - GET
/api/users/{id}
- Get a user by ID. - POST
/api/users
- Create a new user. - PUT
/api/users/{id}
- Update a user. - DELETE
/api/users/{id}
- Delete user.
- POST
/api/users/{id}/photo
- Upload a photo for the user.
You can use Swagger UI or Postman to test the API.
- Navigate to
https://localhost:5203/swagger
. - Select the desired endpoint and click `Try it out'.
- Enter the required parameters and click “Execute”.
- Import the Postman collection from the
ProfileHub.postman_collection.json
file. - Select the desired request and click “Send”.
- Controllers: Contains controllers that handle HTTP requests.
- Models: Contains the data models.
- Data: Contains database context and repositories.
- Repositories: Contains repositories for working with data.
- Services: Contains services for working with AWS S3.
- Interfaces: Contains interfaces for repositories and services.
This project is licensed under the MIT License.