Added Card model, updated database initialization, udated readme.
This commit is contained in:
25
README.md
25
README.md
@@ -15,27 +15,40 @@ Follow these steps to set up your local PostgreSQL database:
|
||||
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 SDG-Backend-Admin
|
||||
CREATE USER "SDG-Backend-Admin" WITH ENCRYPTED PASSWORD 'password';
|
||||
|
||||
-- Grant privileges
|
||||
GRANT ALL PRIVILEGES ON DATABASE "SDG-Backend" TO "SDG-Backend-Admin";
|
||||
-- Create the database
|
||||
CREATE DATABASE "SDG-Backend" OWNER "SDG-Backend-Admin";
|
||||
```
|
||||
|
||||
### 2. Configure Connection String
|
||||
#### Initialize User Secrets
|
||||
Run this in the project directory (`SDG-Backend-Barracuda\SDG-Backend-Barracuda`):
|
||||
```bash
|
||||
dotnet user-secrets init
|
||||
```
|
||||
|
||||
#### Set the Connection String
|
||||
Replace `password` if you used a different one during setup:
|
||||
```bash
|
||||
dotnet user-secrets set "ConnectionStrings:DefaultConnection" "Host=localhost;Database=SDG-Backend;Username=SDG-Backend-Admin;Password=password;Maximum Pool Size=100;"
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
### Installing Dependencies
|
||||
The project uses `Npgsql` and `Dapper`. These can be installed via:
|
||||
The project uses `Npgsql`, `Dapper`, and `Npgsql.DependencyInjection`.
|
||||
|
||||
```bash
|
||||
dotnet add package Npgsql
|
||||
dotnet add package Dapper
|
||||
dotnet add package Npgsql.DependencyInjection
|
||||
```
|
||||
|
||||
### Running the Application
|
||||
From the root directory:
|
||||
```bash
|
||||
dotnet run --project SDG-Backend-Barracuda
|
||||
```
|
||||
Reference in New Issue
Block a user