Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,40 @@ This project is a simple but powerful web application to manage to-dos.

## Set up

1 - Clone this project running `git clone https://github.com/amoraitis/TodoList.git` in your terminal. If you haven't git installed can simply download it and unzip it.
1. Clone this project running `git clone https://github.com/amoraitis/TodoList.git` in your terminal. If you haven't git installed can simply download it and unzip it.

2 - Add your Sendgrid API Key by running `dotnet user-secrets set "SendGrid:ServiceApiKey" "your_secret_key"`.
2. Add your Sendgrid API Key to `./TodoList.Web/secrets.json` and replace the "your_secret_key" value

3. Run `type ./TodoList.Web/secrets.json | dotnet user-secrets set --project ./TodoList.Web/TodoList.Web.csproj` from the solution folder root

3 - Run the required infrastructure (PostgreSQL etc) for development purposes
* Go to the `TodoList/` folder by running the command `cd TodoList/`
* Run the command `docker-compose -f docker-dev-compose.yml up` to bring up the infrastructure. This will setup and run the PostgreSQL server locally.
* Note that a folder `pgdata` will be created. PostgreSQL data is persisted in this folder and can be used without having to re-create/seed data over and over during development. Delete this folder to remove any data created during development.
4. Run the required infrastructure (PostgreSQL etc) for development purposes
* Run the required infrastructure (PostgreSQL etc) for development purposes
* Go to the `TodoList/` folder by running the command `cd TodoList/`
* Run the command `docker-compose -f docker-dev-compose.yml up` to bring up the infrastructure. This will setup and run the PostgreSQL server locally.
* Note that a folder `pgdata` will be created. PostgreSQL data is persisted in this folder and can be used without having to re-create/seed data over and over during development. Delete this folder to remove any data created during development.

4 - Go to the `TodoList/TodoList.Web` folder by running the command `cd TodoList/TodoList.Web` or manually navigating into the file system.
5. Go to the `TodoList/TodoList.Web` folder by running the command `cd TodoList/TodoList.Web` or manually navigating into the file system.

5 - Run the command `dotnet tool install -g Microsoft.Web.LibraryManager.Cli` to install Libman.
6. Run the command `dotnet tool install -g Microsoft.Web.LibraryManager.Cli` to install Libman.

6 - Run the command `dotnet restore` to install all the dependencies.
7. Run the command `dotnet restore` to install all the dependencies.

7 - Run the command `dotnet build` to compile the project.
8. Run the command `dotnet build` to compile the project.

8 - Run the command `dotnet run` to start serving the project.
9. Run the command `dotnet run` to start serving the project.

9 - That it's, your application is running in `http://localhost:47818`.
10. That it's, your application is running in `http://localhost:47818`.

## Support for social login providers

If you want to allow your users to login with their social accounts, e.g. Facebook, follow instructions below.

1. Open the file `./TodoList.Web/secrets.json` and add your keys into replace the appropriate "id" and "secret"

2. Run `type ./TodoList.Web/secrets.json | dotnet user-secrets set --project ./TodoList.Web/TodoList.Web.csproj` from the solution folder root to automatically re-import the secrets file

OR run each command as follows for the appropriate secret

### Facebook
1 - Follow this [guide](https://docs.microsoft.com/en-us/aspnet/core/security/authentication/social/facebook-logins?view=aspnetcore-2.2#create-the-app-in-facebook) to generate AppID and AppSecret.

Expand Down
23 changes: 23 additions & 0 deletions TodoList.Web/secrets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"SendGrid": {
"ServiceApiKey": "your_secret_key"
},
"Authentication": {
"Facebook": {
"AppId": "<app-id>",
"AppSecret": "<app-secret>"
},
"Google": {
"ClientId": "<client-id>",
"AppSecret": "<client-secret>"
},
"Microsoft": {
"AppId": "<app-id>",
"AppSecret": "<app-secret>"
},
"Twitter": {
"ClientId": "<consumer-key>",
"ClientSecret": "<consumer-secret>"
}
}
}