Newer
Older
![](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white)
![](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)
![](https://img.shields.io/badge/mac%20os-000000?style=for-the-badge&logo=apple&logoColor=white)
This codebase is used to run a web application that serves as a social media platform for sharing recipes.
Users can create an account, log in, and share their favorite recipes with other users.
Users can also view other users' recipes and save them to their profile.
A user can also give a rating to a recipe and leave a comment.
## Technologies
- ASP.NET Core
- Entity Framework Core
- Microsoft SQL Server
- C#
- Razor Pages
- JavaScript
To run the application, you will need to first install .net 8.0 runtime and SDK.
You can find the installation instructions [here](https://dotnet.microsoft.com/download/dotnet/8.0).
After installing the .NET SDK, you can run the application by following these steps:
1. Clone the repository
2. Open the solution in the terminal or your preferred IDE
3. Run the IIS Express server by clicking the play button in your IDE or run the command `dotnet run` in the terminal
You will also need to update the database to the current scheme so that items can be posted to the database.
To do this, run the following command in the terminal: `dotnet ef update database`
If any errors are thrown, please ensure that you have correctly installed the .NET SDK + runtime and that you are running the correct version of the SDK.
### Self-contained Application
If you are having trouble running the application, you can also run the application as a self-contained application.
This means that the application will run on its own without the need for the .NET SDK.
The only downside that changes made in the code will not be visible in the self-contained application.
We have included the self-contained applications in the `publish` folder, read that folder's readme to learn how to run the app.
The application opens in the browser on its own.
If not, you can find the url by looking at the output in the terminal.
The website itself is very intuitive and easy to use.
## Codebase
### Structure
All our code is divided into the following folders/files:
- `Data`: Contains the database context
- `Models`: Contains the models for the application
- `Views`: Contains the views (pages) and view-models for the application
- `Areas`: Contains areas for the application. This is currently only the Identity area, which is used for authentication
- `wwwroot`: Contains the css and resources for the website
- `Program.cs`: Contains the main method for the application
- `RecipesCookbookconnect.csproj`: Contains the project configuration
- `Publish`: Contains the self-contained applications for Windows, MacOS, and Linux
### Generative AI
Usage of ChatGPT or any other AI model is very limited in this codebase.
It has mostly just been used for helping the developers find the right syntax.
Some of the team's members have also used the line completion feature facilitated by their IDE for a more efficient developing process.
If a larger block of code is generated by an AI model, it will have been disclosed by the developer by using comments above the code.
### Template Code
Please note that a large part of the codebase is also part of the ASP.NET Core framework and has been generated by the framework itself.
We assume no major bugs are in this code as it is generated by the framework itself.
The Identity area is also generated by the framework, but it has been altered a lot by us to match our requirements.
On multiple occasions in the code can duplicate code snippets be found, mainly in the Razor pages (.cshtml). The reason that this occurs so often throughout the repository is the framework's restrictions on partial views.
A partial view doesn't support sections such as one for scripts written in JavaScript. Bootstrap's validation classes can't be loaded either in partial views, meaning that the input fields inside the partial can't be validated for Create or Update requests.