{"id":19839607,"url":"https://github.com/pedrior/eventify-api","last_synced_at":"2025-12-31T01:07:25.187Z","repository":{"id":228276642,"uuid":"773413495","full_name":"pedrior/eventify-api","owner":"pedrior","description":"A REST API built using ASP.NET Core, EF Core, PostgreSQL, AWS, Clean Architecture, DDD, CQRS, and other technologies. This project exemplifies top coding standards, providing a neat, effective, and scalable solution","archived":false,"fork":false,"pushed_at":"2024-04-06T20:16:47.000Z","size":657,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-06T21:25:06.350Z","etag":null,"topics":["api","aspnetcore","authentication","authorization","clean-architecture","cognito","cqrs","ddd","design-patterns","docker","dotnet","efcore","logging","postgresql","rest-api","s3"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pedrior.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-17T15:44:58.000Z","updated_at":"2024-04-06T21:25:11.027Z","dependencies_parsed_at":"2024-04-06T21:36:47.278Z","dependency_job_id":null,"html_url":"https://github.com/pedrior/eventify-api","commit_stats":null,"previous_names":["pedrior/eventify-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrior%2Feventify-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrior%2Feventify-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrior%2Feventify-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrior%2Feventify-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedrior","download_url":"https://codeload.github.com/pedrior/eventify-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241209544,"owners_count":19927735,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","aspnetcore","authentication","authorization","clean-architecture","cognito","cqrs","ddd","design-patterns","docker","dotnet","efcore","logging","postgresql","rest-api","s3"],"created_at":"2024-11-12T12:23:30.686Z","updated_at":"2025-12-31T01:07:25.168Z","avatar_url":"https://github.com/pedrior.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Eventify API\n\nA REST API built using ASP.NET Core, EF Core, PostgreSQL, AWS, Clean Architecture, DDD, CQRS, and other technologies.\nThis project exemplifies top coding standards, providing a neat, effective, and scalable solution.\n\n👉 This project was developed for educational purposes, but feel free to use it as a reference or for any other purpose.\n\n## :pushpin: Index\n\n- [Project](#sparkles-project)\n- [Getting Started](#runner-getting-started)\n- [API](#globe_with_meridians-api)\n- [License](#page_with_curl-license)\n\n## :sparkles: Project\n\n### :bulb: Overview\n\nEventify is a simple event platform where producers can create and manage events, and attendees can search for events\nand book tickets.\n\n__Some cool features you will discover here:__\n\n- __Clean Architecture__: The project follows the principles of Clean Architecture, which emphasize separating concerns\n  and defining clear responsibilities.\n- __DDD__: A software design approach that prioritizes the problem domain over technology, aiming to develop systems\n  that align with the language and requirements of the business.\n- __CQRS__: An architectural pattern that separates the read and update operations of a data store (in this project,\n  encouraged more as a code style, as we use a single database).\n- __API Versioning__: The project adopts versioning to facilitate progressive changes while maintaining backward\n  compatibility.\n- __API Rate Limiting:__ The project adopts rate limiting to prevent request abuses.\n- __Authentication and Authorization__: The project implements authentication and authorization with JWT.\n- __Unit Testing__: The solution includes individual test projects for unit testing the API layers.\n- __Database Transactions__: The project supports database transactions. Each command that implements the ITransactional\n  interface is executed in a single transaction.\n- __Pipeline Behaviors__: The project implements various Pipeline Behaviors for managing Authorization, Exceptions,\n  Logging, Transactions, and Validations.\n\n### :triangular_ruler: Architecture\n\nThe project follows the Clean Architecture principles inspired\nby [Jason Taylor's Clean Architecture Solution Template](https://github.com/jasontaylordev/CleanArchitecture),\nwith some modifications to suit my preferences and needs.\n\n![Clean Architecture Design](./images/clean-architecture.jpg)\n\n## :runner: Getting Started\n\n### :memo: Requirements\n\nTo successfully build and run this project, you will need the following tools properly configured:\n\n- [ASP.NET Core 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)\n- [EF Core CLI Tools](https://learn.microsoft.com/en-us/ef/core/cli/dotnet)\n- [Docker](https://www.docker.com/)\n- [Amazon S3](https://aws.amazon.com/s3/)\n- [Amazon Cognito](https://aws.amazon.com/cognito/)\n\n:information_source: In the `/aws` directory, you will find the `cognito-functions` sln with a Lambda Function\nimplementation to handle the\nAWS\nCognito [Pre Sign-Up](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html#user-pool-lambda-pre-sign-up-flows)\nevent.\nThis Lambda Function is used to automatically confirm the user during registration. Build and deploy this Lambda\nfunction to AWS and configure Cognito to trigger it.\nOtherwise, manual user confirmation will be required. Also, create the user groups `attendee` and `producer` to manage\nuser roles in the system.\n\n1. Clone the repository\n\n```shell\ngit clone https://github.com/pedrior/eventify-api.git\ncd eventify-api\n```\n\n2. Configure the required application settings\n\n```json\n{\n  \"ConnectionStrings\": {\n    \"DefaultConnection\": \"Your PostgreSQL connection string (Skip if you're using Docker Compose)\"\n  },\n  \"AWS\": {\n    \"Region\": \"Your AWS Region\",\n    \"UserPoolClientId\": \"Your AWS Cognito User Pool Client Id\",\n    \"UserPoolClientSecret\": \"Your AWS Cognito User Pool Client Secret\",\n    \"UserPoolId\": \"Your AWS Cognito User Pool Id\"\n  },\n  \"Storage\": {\n    \"Bucket\": \"Your S3 Bucket Name\"\n  }\n}\n```\n\n\u003e :warning: Make sure you have configured the AWS credentials in the environment variables.\n\u003e\nSee [Environment variables to configure the AWS CL](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html)\nfor further details.\n\n3. Create a certificate for the API to run on Docker over HTTPS\n\n```shell\ndotnet dev-certs https -ep $env:USERPROFILE\\.aspnet\\https\\Eventify.Presentation.pfx -p password\ndotnet dev-certs https --trust\n```\n\n\u003e :warning: Make sure that the certificate name and password match those specified in the `docker-compose.yml` file.\n\u003e\nSee [Developing ASP.NET Core Applications with Docker over HTTPS](https://github.com/dotnet/dotnet-docker/blob/main/samples/run-aspnetcore-https-development.md)\nfor further details.\n\n4. Create and apply the database migration\n\n\u003e :information_source: In this step, you need to have the database running for the migration to be successful.\n\n```shell\ndotnet ef migrations add Initial -s src/Eventify.Presentation -p src/Eventify.Infrastructure -o ./Common/Persistence/Migrations\ndotnet ef database update -s src/Eventify.Presentation -p src/Eventify.Infrastructure\n```\n\n5. Run with Docker Compose\n\n```shell\ndocker compose up --build\n```\n\n## :globe_with_meridians: API\n\nThe API offers endpoints for handling events, tickets, bookings, and users. You can locate all `*.http` samples in the \n`src/Eventify.Presentation/Requests directory`, and execute them using any REST client.\n\n__Location__\n\nThe API is available at `https://localhost:8081/api/{version}`.\n\n__Versioning__\n\nThe API is versioned through the URL path. By default, all endpoints use the `v1` version of the API.\n\n__Authorization__\n\nThe API uses JWT Bearer Authentication for endpoint protection. When making authenticated requests, you need to\ninclude the access token in the `Authorization` header with the `Bearer` scheme.\n\n\u003e :information_source: You can obtain an `access_token` by sending a request to the `/v1/account/login` endpoint.\n\nIf you fail to provide the access token or provide an invalid one, you will get a `401 Unauthorized` response. If you\nprovide a valid access token but lack authorization for the request, you will receive a `403 Forbidden` response.\n\n```http\nAuthorization: Bearer {access_token}\n```\n\n__Rate Limiting:__\n\nMost endpoints have rate limits to prevent abuse. If you surpass the request limit within a specific time frame, you\nwill get a `429 Too Many Requests` response.\n\n__Responses__\n\nThe API uses standard HTTP response codes to indicate the success or failure of an API request.\n\n| Code                        | Description                                                                                     |\n|-----------------------------|-------------------------------------------------------------------------------------------------|\n| 200 - OK                    | Everything worked as expected.                                                                  |\n| 201 - Created               | Everything worked as expected, and as result, has created a new resource.                       |\n| 204 - No Content            | Everything worked as expected, but is not going to return any content.                          |\n| 400 - Bad Request           | The request was unacceptable, often due to missing a required parameter or malformed parameter. |\n| 401 - Unauthorized          | The request requires user authentication.                                                       |\n| 403 - Forbidden             | The user is authenticated but not authorized to perform the request.                            |\n| 404 - Not Found             | The requested resource doesn’t exist.                                                           |\n| 409 - Conflict              | The request could not be completed due to a conflict with the current state of the resource.    |\n| 422 - Unprocessable Entity  | The request body was acceptable but unable to be processed, often due to business logic errors. |\n| 429 - Too Many Requests     | Too many requests hit the API too quickly.                                                      |\n| 500 - Internal Server Error | An unexpected error occurred.                                                                   |\n\n__Errors__\n\nThe API provides error responses compliant with RFC 7807. The response may contain additional fields to provide a more\ndetailed description of the error.\n\nExamples:\n\n```json\n{\n  \"type\": \"https://tools.ietf.org/html/rfc9110#section-15.5.10\",\n  \"title\": \"Conflict\",\n  \"status\": 409,\n  \"traceId\": \"00-9544cfe6df9d42a0553f910ca6d228b7-6469fbed19a87208-00\",\n  \"errors\": [\n    {\n      \"code\": \"event.slug_already_exists\",\n      \"message\": \"The slug is already associated with another event\",\n      \"details\": {\n        \"slug\": \"awesome-event-slug\"\n      }\n    }\n  ]\n}\n```\n\nValidation errors:\n\n```json\n{\n  \"type\": \"https://tools.ietf.org/html/rfc9110#section-15.5.1\",\n  \"title\": \"One or more validation errors occurred.\",\n  \"status\": 400,\n  \"errors\": {\n    \"slug\": [\n      \"Must not be empty.\",\n      \"Must contain only lowercase letters, numbers, dashes and must not start or end with a dash.\"\n    ]\n  },\n  \"traceId\": \"00-3d6a0b01f3384b9327b7de83c37c8005-792cece6737ab181-00\"\n}\n```\n\n## :page_with_curl: License\n\nThis project is licensed under the terms of the [MIT](https://github.com/pedrior/eventify-api/blob/master/LICENSE)\nlicense.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrior%2Feventify-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedrior%2Feventify-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrior%2Feventify-api/lists"}