- .NET 6 SDK Installation Guide
-
Clone the repository:
git clone https://github.com/GabrielGMarques/ProductManagementAPI.git cd ProductManagementAPI -
Open the project on visual studio
-
Run migrations
- Set up the ProductManagement.Api as the startup project
- Open appsettings.json and put the
ConnectionStrings.DefaultConnectionkey to the connection string of your local database - Open the Package Management Console
- Set the ProjectManagement.Infra default project
- Run
Update-Databaseto create the entities on the project
- Endpoints are protected by authentication
- To authenticate first create a user with the /auth/register endpoint
- Then use the login endpoint to get the JWT Token (A improvment would return the jwt token on this endpoint together with the id of the user)
- Then authenticate with postman using ```bearer {{generated jwt token}}``
- Category endpoints are only available to users with the role Admin (UserRole.Admin). So in order to test it, first create a user with the Admin role and authenticate with it)