Skip to content
Snippets Groups Projects
README.md 4.51 KiB
Newer Older
adaja's avatar
adaja committed
# Cookbook Connect
Dagmar Smid's avatar
Dagmar Smid committed

adaja's avatar
adaja committed
![](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)

Dagmar Smid's avatar
Dagmar Smid committed
## Description
adaja's avatar
adaja committed
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
Lukas Mouthaan's avatar
Lukas Mouthaan committed
- .NET Core 8.0
adaja's avatar
adaja committed
  - ASP.NET Core
  - Entity Framework Core
- Microsoft SQL Server
- C#
- Razor Pages
- JavaScript
Lukas Mouthaan's avatar
Lukas Mouthaan committed
- CSS
adaja's avatar
adaja committed

## Running the Application
### IIS Express
Lukas Mouthaan's avatar
Lukas Mouthaan committed
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).
adaja's avatar
adaja committed

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

Lukas Mouthaan's avatar
Lukas Mouthaan committed
You will also need to update the database to the current scheme so that items can be posted to the database.
adaja's avatar
adaja committed
To do this, run the following command in the terminal: `dotnet ef update database`

Lukas Mouthaan's avatar
Lukas Mouthaan committed
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.
adaja's avatar
adaja committed

### 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.
Dagmar Smid's avatar
Dagmar Smid committed

## Usage
adaja's avatar
adaja committed
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:
adaja's avatar
adaja committed
- `Controllers`: Contains the controllers for the application
- `Data`: Contains the database context
- `Models`: Contains the models for the application
adaja's avatar
adaja committed
- `Migrations`: Contains the database migrations
Lukas Mouthaan's avatar
Lukas Mouthaan committed
- `Views`: Contains the views (pages) and view-models for the application
adaja's avatar
adaja committed
- `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
Lukas Mouthaan's avatar
Lukas Mouthaan committed
- `Publish`: Contains the self-contained applications for Windows, MacOS, and Linux
adaja's avatar
adaja committed

### 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.
Lukas Mouthaan's avatar
Lukas Mouthaan committed
Some of the team's members have also used the line completion feature facilitated by their IDE for a more efficient developing process.
Lukas Mouthaan's avatar
Lukas Mouthaan committed
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.
adaja's avatar
adaja committed

### 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.

Lukas Mouthaan's avatar
Lukas Mouthaan committed
### Duplicate Code
Lukas Mouthaan's avatar
Lukas Mouthaan committed
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. 
Lukas Mouthaan's avatar
Lukas Mouthaan committed

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.

adaja's avatar
adaja committed
## Credits
This project was created by students of the University of Utrecht for the course _Informatica introductieproject [INFOB1PICA]_ in the year 2024-2025.
The contributors are:
- Dagmar Smid
- Frank Schreuders
- Tijn Wammes
- Lukas Mouthaan