This is a simple API for managing cards. It's built with .NET Core and uses Entity Framework Core for data access.
- User registration and authentication
- CRUD operations for cards
- Pagination, sorting, and filtering for retrieving cards
- Role-based authorization
POST /auth/register
: Register a new userPOST /auth/login
: Authenticate a user and get a JWTGET /card
: Get all cards with optional pagination, sorting, and filteringGET /card/{id}
: Get a specific card by IDPOST /card
: Create a new cardPUT /card
: Update an existing cardDELETE /card/{id}
: Delete a card
- Clone the repository
- Run
dotnet restore
to restore the NuGet packages - Run
dotnet ef database update
to apply the database migrations - Update your appsettings.json file with your database connection string or environment variable SA_PASSWORD if running with docker
- Run
dotnet run
to start the application - visit
https://localhost:5001/swagger
to view the API documentation
The database is seeded with an admin user and a member user at startup. The credentials for these users are:
- Admin:
admin@example.com
/Admin123!
- Member:
member@example.com
/Member123!
A Dockerfile
and docker-compose.yml
file are included for running the application with Docker. To start the application with Docker, run docker-compose up
.