You have to clarify that your machine has got next software:
- Docker
- Docker Compose
- Git
- To clone this repository, run the following command:
git clone https://github.com/AMSaiian/MyCutePet.git
- Navigate to the repository backend source code folder
cd MyCutePet/backend
- Copy .env.example as .env at the same folder - it must be exactly near docker.compose.yml. All generic environment variables have been configured, however you can change it with your own
- Run predefined console script basing on your OS:
# Windows (using Powershell at MyCutePet/backend):
.\run-with-docker.ps1
# Linux (using sh at MyCutePet/backend):
chmod +x ./run_with_docker.sh # use this line if you encountered issues with permissions
./run-with-docker.sh
!!! Don't pay attention to application exceptions, related to error with connection to Postgre DB, during first start. This is not issue due to during first start there is init of Postgre volume and other heavy processes, which can make Db container unavailable during some time. Docker Compose of project has been designed to handle this situation with "Restart always", so just wait some time and then application is going to be ready to work properly
You have to clarify that your machine has got next software:
- .NET Core 8
- PostgreSQL 16
- Git
- To clone this repository, run the following command:
git clone https://github.com/AMSaiian/MyCutePet.git
- Navigate to the repository backend source code folder
cd MyCutePet/backend
- Fill next placeholders in configuration using appsetting.json or .NET user secrets:
- TokenProvider -> Secret
- ConnectionStrings -> Auth
- ConnectionStrings -> Application (can be similar with Auth)
- Run next commands using Powershell or Command line:
dotnet restore Task.io.sln
dotnet build Task.io.sln --configuration Release --no-restore
dotnet run --project src/App/Taskio/Taskio.csproj --no-build
- Swagger UI (HTTPS): https://localhost:9081/swagger/index.html
- Swagger UI (HTTP): http://localhost:9080/swagger/index.html !!! due to Swagger UI can't handle redirect, use HTTPS
- The PostgreSQL database is accessible on port 5433 (using Docker run) or The PostgreSQL database is accessible on port 5432 (using local run)
- Use pre-created user with next credentials:
- Identifier: WellKnownUser
- Password: 12345678Ab!
- Register a user providing a valid email and username e.g. NewUser. Password must have length from 8 to 20 symbols and contain one digit, one uppercase letter and one special symbol e.g. !@$. Save returned user id, which you have to use to query tasks and etc.
- Obtain a token at the token endpoint using credentials from 0 or 1 step. Add the token as bearer token e.g. at Swagger UI
- If you start with pre-created credentials and don't have user id - access api/users GET endpoint with token
- When you have user id you can create, update, delete and query your task.
- Create, Update, Delete actions are trivial so I would like tell about api/user/{userId}/tasks endpoint:
- By default it paginated with amount provided in configuration. Using query params you can define by what property tasks will be sorted; amount of tasks; direction of order. You can order, filter and rangie(by providing start and end value) tasks simultaneously.
- Available order properties: -- title -- priority -- status -- dueDate -- createdDate -- updatedDate
- Available filter properties: -- priority -- status -- dueDate -- createdDate -- updatedDate
- Available ranger properties: -- dueDate -- createdDate -- updatedDate
- Structured logging using Serilog with sensitive data masking
- Validation pipelines
- Errors and exceptions handlers/filters
- Enhanced solution structure divided on necessary assemblies