Added Dapper, simplified database config, and added README.md with setup steps
This commit is contained in:
41
README.md
Normal file
41
README.md
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# SDG-Backend-Barracuda
|
||||||
|
|
||||||
|
This is an ASP.NET Core Web API with a PostgreSQL backend, using Dapper for high-performance data access.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- [.NET 10 SDK](https://dotnet.microsoft.com/download/dotnet/10.0)
|
||||||
|
- [PostgreSQL](https://www.postgresql.org/download/)
|
||||||
|
|
||||||
|
## PostgreSQL Database Setup
|
||||||
|
|
||||||
|
Follow these steps to set up your local PostgreSQL database:
|
||||||
|
|
||||||
|
### 1. Create Database and User
|
||||||
|
If you haven't already, create a database and a user with appropriate permissions. You can use `psql` or a tool like pgAdmin.
|
||||||
|
|
||||||
|
```sql
|
||||||
|
-- Create the database
|
||||||
|
CREATE DATABASE "SDG-Backend";
|
||||||
|
|
||||||
|
-- Create the user
|
||||||
|
CREATE USER "SDG-Backend-Admin" WITH ENCRYPTED PASSWORD 'password';
|
||||||
|
|
||||||
|
-- Grant privileges
|
||||||
|
GRANT ALL PRIVILEGES ON DATABASE "SDG-Backend" TO "SDG-Backend-Admin";
|
||||||
|
```
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
### Installing Dependencies
|
||||||
|
The project uses `Npgsql` and `Dapper`. These can be installed via:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dotnet add package Npgsql
|
||||||
|
dotnet add package Dapper
|
||||||
|
```
|
||||||
|
|
||||||
|
### Running the Application
|
||||||
|
```bash
|
||||||
|
dotnet run --project SDG-Backend-Barracuda
|
||||||
|
```
|
||||||
@@ -8,7 +8,9 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Dapper" Version="2.1.66" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.1" />
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.1" />
|
||||||
|
<PackageReference Include="Npgsql" Version="10.0.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Reference in New Issue
Block a user