Welcome to Dog Friendly – a web application designed to help dog owners find pet-friendly places with ease. Whether for a weekend getaway or a longer vacation, Dog Friendly makes it simple to discover locations that welcome dogs, ensuring a stress-free experience for you and your furry friends.
🌐 Access the deployed site: Dog Friendly - https://dogfriendly.delpierre.me/
📖 Read the final project blog article: Dog Friendly Blog Article - https://medium.com/@8766_21533/creating-dog-friendly-my-journey-to-building-a-web-application-for-dog-lovers-6d034f024939
👩 Author: Charlène Scomparin - https://www.linkedin.com/in/charlène-scomparin/
Handles the API logic built with ASP.NET Core. It processes HTTP requests and connects to the data layer via DogFriendly.Infrastructure.
Contains core business logic and services between the API and Infrastructure.
Manages data access using Entity Framework.
Defines core business models and domain entities.
A Blazor front-end project that interacts with DogFriendly.API.
A Blazor backoffice project that interacts with database.
This project is responsible for hosting the DogFriendly.Web.Client with server-side prerendering. It delivers a faster initial page load by rendering the front-end on the server and then passing control to the client-side Blazor application.
-
Define the Connection String: Make sure the connection string for your database is correctly configured in the
appsettings.jsonfile or yourDbContextconstructor. -
Add a Migration: Open the Package Manager Console or a terminal and navigate to the Infrastructure project directory. Run the following command to add a migration:
Add-Migration <MigrationName> -Project DogFriendly.Infrastructure -StartupProject DogFriendly.API
-
Update the Database: After creating the migration, apply the changes to the database with the following command:
Update-Database -Project DogFriendly.Infrastructure -StartupProject DogFriendly.API
To use Firebase in the DogFriendly.API and DogFriendly.Web projects, you need to add the Firebase configurations in the appsettings.json files of both projects. Follow these steps:
- Go to the Firebase console at the following address: https://console.firebase.google.com/.
- Select your project or create a new one.
- Go to the project settings in Firebase, and find the following information in the Firebase SDK section:
- ApiKey
- AuthDomain
- ProjectId
- AppId
In the DogFriendly.API and DogFriendly.Web projects, open the appsettings.json file and add the following section with your own Firebase values.
"Firebase": {
"ApiKey": "YOUR_API_KEY",
"AuthDomain": "YOUR_AUTH_DOMAIN",
"ProjectId": "YOUR_PROJECT_ID",
"AppId": "YOUR_APP_ID"
}{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"Firebase": {
"ApiKey": "AIzaSyD...1234",
"AuthDomain": "myapp.firebaseapp.com",
"ProjectId": "myapp",
"AppId": "1:1234567890:web:abcdef123456"
}
}In projects (DogFriendly.API, DogFriendly.Web and DogFriendly.Admin), the Firebase configuration will be automatically retrieved from the appsettings.json file.
Ensure that the Firebase service is properly set up to use these parameters in your application's code.
The FileStorage section in the appsettings.json is designed to configure the connection to Cloudflare R2 storage using the AWS S3 SDK. Each setting is crucial for secure access and proper functionality. Below is a breakdown of the key properties:
- AccountId: Your Cloudflare account identifier. It uniquely identifies your Cloudflare account for all API interactions.
- AccessKey: The access key provided by Cloudflare, which acts as the public credential for authenticating API requests.
- SecretKey: The corresponding secret key, used together with the access key to securely authenticate with Cloudflare R2.
- DomainUri: The base URL for accessing the R2 storage domain, usually formatted as
https://<account_id>.r2.cloudflarestorage.com/. - UsersUri: The URI for accessing the users’ storage bucket or endpoint, which may hold profile images or user-specific files.
- PlacesUri: The URI for accessing place-related files, such as images and media associated with locations in your application.
- NewsUri: The URI used to store or retrieve files related to news content in your application.
- AmenitiesUri: The URI for storing files related to amenities, such as images or additional media associated with your entities.
- BucketName: The name of the bucket where your application’s files are stored within the R2 service.
- Build the Docker image:
docker build -f Front.Dockerfile -t dogfriendly-client . - Run the container:
docker run -d -p 8080:8080 dogfriendly-client
- Build the Docker image:
docker build -f Back.Dockerfile -t dogfriendly-api . - Run the container:
docker run -d -p 8181:8181 dogfriendly-api
- Build the Docker image:
docker build -f Admin.Dockerfile -t dogfriendly-admin . - Run the container:
docker run -d -p 8082:8082 dogfriendly-admin
- Sign up on Sliplane and create a new project.
- Connect your GitHub repository to Sliplane, allowing access to the DogFriendly repo.
- In Sliplane, navigate to the Deployments section and create a new deployment.
- For the front-end, choose
Front.Dockerfile. For the back-end, selectBack.Dockerfile. For backoffice, selectAdmin.Dockerfile.
- Sliplane will automatically build your Docker images from the provided Dockerfiles.
- After building, Sliplane will deploy the containers, handling scaling and monitoring automatically.
- Enable automatic builds in Sliplane so that each push to GitHub triggers a new deployment.
- This ensures that any updates to
developormainbranches are automatically compiled, built, and deployed.
This project follows the GitFlow workflow for source control management. In the CI/CD pipeline, GitHub Actions are configured to build and compile Docker images automatically for every pull request. This ensures that code is thoroughly tested and images are ready for deployment after review.
- Navigate to the DogFriendly.Tests project:
cd DogFriendly.Tests - Run the tests using the .NET CLI:
dotnet test
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.