This project is a RESTful API for managing an action movies catalog, built with .NET 9, SQLite, and JWT authentication. The API is deployed using serverless functions on Vercel and implements user management with Identity.
- JWT-based user authentication using Identity
- User registration and role-based access control
- CRUD operations for action movies
- Swagger for API documentation and testing
- Hosted using serverless functions on Vercel
ActionMoviesCatalog.Api
: Contains the main API logicActionMoviesCatalog.Tests
: Unit tests for the API
- Install .NET SDK 9.0 or later from here.
- Run
dotnet restore
to install dependencies. - Configure the database connection string as an environment variable
DATABASE_CONNECTION
. - Add environment variables for JWT:
JWT_KEY
: The secret key for signing tokens.JWT_ISSUER
: The issuer of the tokens.JWT_AUDIENCE
: The audience for the tokens.
- Deploy the project to Vercel by linking your GitHub repository and setting the above environment variables in the Vercel dashboard.
- Run the API locally:
dotnet run --project src/ActionMovieCatalog.Api
- Access the API documentation locally at
http://localhost:5000/swagger
.
The API is deployed on Vercel and can be accessed via the provided public URL.
- Push the project to a GitHub repository.
- Log in to Vercel.
- Create a new project and link it to your GitHub repository.
- Configure the following environment variables in the Vercel dashboard:
DATABASE_CONNECTION
JWT_KEY
JWT_ISSUER
JWT_AUDIENCE
- Deploy the project.
The API is designed as serverless functions, allowing efficient scaling and reduced overhead. It uses Identity for user management, including registration, authentication, and role-based authorization.
The API will be live and accessible at https://actionmoviecatalog.vercel.app/swagger
.
Keo Coelho