An MVC C# client-side web application leveraging greenharborAPI for the storage and retrieval of composting host information.
- C#
- Razor HTML
- CSS
- .NET 6.0
- Entity Framework Core
- JSON
- MySQL
- Visual Studio Code
- Github
- Git
- Swagger
GreenHarbor Compost connects users with local compost hosts, facilitating easy and eco-friendly disposal of organic waste. Become a compost host or find nearby composting locations to contribute to a sustainable and greener community.
If you have not already, install the dotnet-ef tool by running the following command in your terminal:
dotnet tool install --global dotnet-ef --version 6.0.0
- Clone this repo.
- Open the terminal and navigate to this project's main directory called "GreenHarborClient.Solution".
- Within the production directory "GreenHarborCient", create new file:
appsettings.json. - Within
appsettings.json, put in the following code. Make sure to replacing theuidandpwdvalues in the MySQL database connection string with your own username and password for MySQL.
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "Server=localhost;Port=3306;database=gh-user;uid=[YOUR_USERNAME];pwd=[YOUR_MYSQL_PASSWORD];"
}
}- Install all necessary packages by running
dotnet restorein the shell while within the production directory "GreenHarborClient". - Create the database using the migrations in the GreenHarborClient project. Open your shell (e.g., Terminal or GitBash) to the production directory "GreeHarborClient", and run
dotnet ef database update. - Within the production directory "GreenHarborClient", run
dotnet watch runin the command line to start the project server and open the webpage within your browser. - The Client side program will use the domain http://localhost:7200.
- Next, Within the production directory "GreenHarborApi" found at this remote repository,follow the API setup instructions and then use Git command
dotnet watch runin the command line to start the project server and open the swagger webpage within your browser. NOTE: Both the client side and the API need to be running at the same time for the relationship between the two to be working. - The API side program will use the domain http://localhost:7000.
- Next, create a user for "Green Harbor" by navigating to the
Registersection. Then Login to access stored composter host informtion and to add to the compster database.
- When a user is logged in, there is a security vulnerability allowing them to edit and delete all composting host posts without proper authorization. This poses a risk to data integrity and user privacy. To address this issue, future versions will implement user roles for proper authorization and access control. This enhancement is crucial to ensure a secure and permission-controlled environment.
- Please visit this projects GitHub repository to submit Issues and Pull Requests.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) Kari Vigna, Jessica Hattig, Will Jolley, Greg Stillwell, Mac Granger 2023