https://github.com/ozturkvedat/dbredditclone
A simple Reddit back-end clone. Uses raw SQL for db management and a REST API.
https://github.com/ozturkvedat/dbredditclone
asp-net-core backend postgresql swagger
Last synced: about 1 month ago
JSON representation
A simple Reddit back-end clone. Uses raw SQL for db management and a REST API.
- Host: GitHub
- URL: https://github.com/ozturkvedat/dbredditclone
- Owner: OzturkVedat
- Created: 2024-11-30T07:28:52.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-03T07:00:38.000Z (over 1 year ago)
- Last Synced: 2025-08-13T01:46:19.997Z (11 months ago)
- Topics: asp-net-core, backend, postgresql, swagger
- Language: C#
- Homepage:
- Size: 181 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reddit Clone Database
A basic Reddit clone back-end showcasing CRUD operations, raw SQL integration, and database triggers, with ASP.NET Core and PostgreSQL. The project includes Swagger UI for API testing and documentation.
---
## Features
- **CRUD Functionality**: Perform create, read, update, and delete operations on core entities like Posts, Comments, and Subreddits.
- **Raw SQL Scripts**: Use of raw SQL for precise database control.
- **Triggers**: PostgreSQL triggers for automated database tasks.
- **Swagger UI Integration**: Test and view the API endpoints interactively.
- **PostgreSQL Database**: Robust and open source relational database backend.
---
## Project Structure
- **Controllers**: Manage API endpoints.
- **Models**: Represent database entities, DTOs, etc.
- **SqlScripts**: PostgreSQL scripts that seeded into database upon application start.
- **Services**: Directory containing abstraction layers (services) between the API controllers and the database.
---

# Pre-requisites
- [PostgreSQL](https://www.postgresql.org/download/)
- pgAdmin (optional, but useful for database management)
- .NET SDK (8.0 or later)
## Installation
1. **Clone the Repository**
```bash
git clone https://github.com/OzturkVedat/DBRedditClone.git
cd DBRedditClone
```
3. **Set up a Database**
Create a new database for project. Modify the project's connection string within appsettings.json for local development.
5. **Run the application**
Install dependencies and run the app with CLI (or just run it from Visual Studio):
```bash
dotnet restore
dotnet run
```
7. Access Swagger UI
Navigate to https://localhost:7245/swagger/index.html to test the API endpoint.
---
Here is the Crow's Foot style diagram of the current database set up:
