An open API service indexing awesome lists of open source software.

https://github.com/dmunasingha/razor-crud-app

RazorCrudApp is a simple CRUD (Create, Read, Update, Delete) web application built using ASP.NET Core Razor Pages and SQLite. It demonstrates fundamental features like user authentication, secure login/logout with cookies, form validation, and Bootstrap-powered UI for responsiveness. The app is ideal for learning the basics of .NET
https://github.com/dmunasingha/razor-crud-app

asp-net-core bootstrap5 crud csharp css html learn razor-pages web webapp

Last synced: about 2 months ago
JSON representation

RazorCrudApp is a simple CRUD (Create, Read, Update, Delete) web application built using ASP.NET Core Razor Pages and SQLite. It demonstrates fundamental features like user authentication, secure login/logout with cookies, form validation, and Bootstrap-powered UI for responsiveness. The app is ideal for learning the basics of .NET

Awesome Lists containing this project

README

          

# RazorCrudApp

A simple CRUD web application built with ASP.NET Core Razor Pages, featuring:

* User Authentication (Login / Logout)
* SQLite Database Integration
* Toast Notifications using Bootstrap
* Entity Framework Core (EF Core) with Code-First Migrations

---

## ๐Ÿš€ Features

* ๐Ÿง‘โ€๐Ÿ’ผ User Authentication with Cookie-based login/logout
* ๐Ÿ“ฆ SQLite database
* ๐Ÿ“ CRUD operations on User Model (or any other data model)
* ๐Ÿ’ฌ Bootstrap Toast Notifications
* ๐Ÿ“„ Razor Pages + Layout + Partial Integration

---

## ๐Ÿ› ๏ธ Setup Instructions

### Prerequisites

* [.NET 6 or later SDK](https://dotnet.microsoft.com/en-us/download)
* (Optional) Visual Studio 2022+ / VS Code
* SQLite Explorer (like DB Browser for SQLite)

---

### โš™๏ธ Getting Started

1. **Clone the Repository**

```bash
git clone https://github.com/yourusername/RazorCrudApp.git
cd RazorCrudApp
```

2. **Restore Dependencies**

```bash
dotnet restore
```

3. **Add EF Core Tools (if not already installed)**

```bash
dotnet tool install --global dotnet-ef
```

4. **Apply Migrations and Create the Database**

```bash
dotnet ef migrations add InitialCreate
dotnet ef database update
```

5. **Run the Application**

```bash
dotnet run
```

---

## ๐Ÿฅช Usage

* Visit: `https://localhost:5001`
* Use the Login form to authenticate.
* Use navigation bar to perform CRUD actions.
* Use Toasts for visual feedback on actions.

---

## ๐Ÿงน Folder Structure

```
/Pages
/Auth # Login, Logout pages
/Users # CRUD pages for users
/Models
User.cs # User model
/Data
AppDbContext.cs
```

---

## ๐Ÿ“ฆ Dependencies

* ASP.NET Core Razor Pages
* Microsoft.EntityFrameworkCore.Sqlite
* Microsoft.AspNetCore.Authentication.Cookies
* Bootstrap 5
* jQuery

---

## ๐Ÿซฏ Troubleshooting

### Issue: `no such table: Users`

Run migrations and update database:

```bash
dotnet ef migrations add InitialCreate
dotnet ef database update
```

### Issue: `The file is being used by another process`

Close the app or watcher, then run:

```bash
taskkill /f /im RazorCrudApp.exe
dotnet clean
dotnet build
```

---

## ๐Ÿ“– License

MIT License. Feel free to use and contribute!

---

## ๐Ÿค Contributing

Pull requests are welcome. For major changes, open an issue first to discuss what you'd like to change.

---

## โœ๏ธ Author

**Dunith Munasingha**
Sri Lanka
Software Engineer

---