Skip to content

Commit

Permalink
feat: README updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mythter committed Jul 31, 2024
1 parent 79fb490 commit cdd1c54
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,7 @@ Front-end part: https://github.com/ita-social-projects/StreetCode_Client
### Environment
environmental variables
```properties
spring.datasource.url=${DATASOURCE_URL}
spring.datasource.username=${DATASOURCE_USER}
spring.datasource.password=${DATASOURCE_PASSWORD}
spring.mail.username=${EMAIL_ADDRESS}
spring.mail.password=${EMAIL_PASSWORD}
cloud.name=${CLOUD_NAME}
api.key=${API_KEY}
api.secret=${API_SECRET}
ADMIN_PASSWORD
```

### Clone
Expand All @@ -79,10 +72,11 @@ [email protected]:ita-social-projects/StreetCode.git
Server={local_server_name};Database=StreetcodeDb;User Id={username};Password={password};MultipleActiveResultSets=true;TrustServerCertificate=true;
```

**2. Add database seeding**
- Go to `Program.cs` in **StreetCode.WebApi** project and add following code:
**2. Add database seeding and set environment variable**
- Go to `Program.cs` in **StreetCode.WebApi** project and add the following code (replace `{password}` with your password):

```csharp
Environment.SetEnvironmentVariable("ADMIN_PASSWORD", "{password}");
await app.SeedDataAsync();
```

Expand Down Expand Up @@ -110,11 +104,15 @@ [email protected]:ita-social-projects/StreetCode.git
12. Change password to the default system one - **"Admin@1234"**. Don't forget to confirm it afterwards
13. On the left-hand side select **"Status"** page, and set **"Login"** radio-button to **"Enabled"**
14. Click "Ok"
15. Right click on **"localhost"** server on the left-hand side of the UI and click **"Restart"**

Now you can connect to your localhost instance with login (sa) and password (Admin@1234)!

**_NOTE:_** Here's the full walkthrough: https://www.youtube.com/watch?v=ANFnDqe4JBk&t=211s.
### Troubleshooting

- If you encounter an unhandled `Microsoft.Data.SqlClient.SqlException: 'A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)'` while seeding the DB check if you have `TrustServerCertificate=true;` parameter in your connection string and add if you haven't.

- If you encounter an unhandled `System.IO.DirectoryNotFoundException` while seeding the DB try to specify the absolute paths in `SeedingLocalExtension.cs` to the files in DAL or Streetcode.XIntegrationTest projects.

### How to run Docker

Expand Down

0 comments on commit cdd1c54

Please sign in to comment.