https://github.com/nxdun/memeapp
A Simple Dotnet Application, Used Migration
https://github.com/nxdun/memeapp
crud csharp dotnet-core sql
Last synced: about 1 month ago
JSON representation
A Simple Dotnet Application, Used Migration
- Host: GitHub
- URL: https://github.com/nxdun/memeapp
- Owner: nxdun
- Created: 2024-11-28T12:16:14.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-28T13:11:26.000Z (over 1 year ago)
- Last Synced: 2025-03-30T20:52:30.719Z (about 1 year ago)
- Topics: crud, csharp, dotnet-core, sql
- Language: C#
- Homepage:
- Size: 980 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π Meme App - A Fun CRUD Project with .NET C# and SQL Server π
Welcome to **Jokes App**, a delightful application where you can **Create**, **Read**, **Update**, and **Delete** jokes. Built with the power of `.NET C#` and **SQL Server**, this app will tickle your funny bone while showcasing clean and efficient CRUD operations.
---
## π Table of Contents
1. [π About](#-about)
2. [π Features](#-features)
3. [π Prerequisites](#-prerequisites)
4. [π₯ Installation Guide](#-installation-guide)
5. [π Running Guide](#-running-guide)
6. [π’ SQL Server Configuration](#-sql-server-configuration)
7. [π API Endpoints](#-api-endpoints)
8. [πΈ Screenshots](#-screenshots)
9. [π‘ Jokes API Example](#-jokes-api-example)
10. [π License](#-license)
---
## π About
The **Jokes App** is a CRUD-based project where users can manage jokes through a seamless UI. The backend is powered by `.NET C#`, while SQL Server handles data storage. Perfect for learning or showcasing **CRUD operations** with a sprinkle of humor!
---
## π Features
β
Add your favorite jokes
β
View all jokes with pagination
β
Edit existing jokes
β
Delete jokes you no longer find funny
---
## π Prerequisites
Before you begin, ensure you have the following tools installed:
| **Tool** | **Version** |
|---------------------|------------------------------|
| Visual Studio | 2022 or later |
| .NET SDK | 6.0 or later |
| SQL Server | 2019 or later |
| Entity Framework | Core 6.0 |
---
## π₯ Installation Guide
1. Clone the repository:
```bash
git clone https://github.com/your-username/jokes-app.git
cd jokes-app
```
2. Open the project in **Visual Studio**.
3. Restore NuGet packages:
```bash
dotnet restore
```
4. Update the **appsettings.json** file with your SQL Server connection string:
```json
"ConnectionStrings": {
"DefaultConnection": "Server=YOUR_SERVER_NAME;Database=JokesDB;Trusted_Connection=True;MultipleActiveResultSets=true"
}
```
5. Run database migrations:
```bash
dotnet ef database update
```
---
## π Running Guide
1. Open the project in **Visual Studio**.
2. Set the startup project to **JokesApp.API**.
3. Press `F5` or run the project using the play button βΆοΈ.
4. Access the app at:
**Frontend:** `http://localhost:5000`
**API:** `http://localhost:5000/api/jokes`
---
## π’ SQL Server Configuration
### Step 1: Create the Database
1. Open **SQL Server Management Studio** (SSMS).
2. Create a new database called `JokesDB`:
```sql
CREATE DATABASE JokesDB;
```
### Step 2: Update Connection String
Update your **appsettings.json** file with your SQL Server name:
```json
"ConnectionStrings": {
"DefaultConnection": "Server=YOUR_SERVER_NAME;Database=JokesDB;Trusted_Connection=True;"
}
```
### Step 3: Run Migrations
In the terminal, execute:
```bash
dotnet ef migrations add InitialCreate
dotnet ef database update
```
---
## π API Endpoints
| **Method** | **Endpoint** | **Description** |
|------------|---------------------|----------------------------------|
| `GET` | `/api/jokes` | Fetch all jokes |
| `POST` | `/api/jokes` | Add a new joke |
| `PUT` | `/api/jokes/{id}` | Update an existing joke |
| `DELETE` | `/api/jokes/{id}` | Delete a joke |
---
## πΈ Screenshots
Coming soon! π¨
---
## π‘ Jokes API Example
Hereβs a quick joke for you:
```json
{
"id": 1,
"content": "Why donβt skeletons fight each other? They donβt have the guts!"
}
```
---
## π License
This project is licensed under the MIT License.
Feel free to use, modify, and share!
---
β¨ *Happy coding! Keep joking!* π - Nuu