diff --git a/README.md b/README.md index 4717e55..91df2ae 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/TodoList.Web/secrets.json b/TodoList.Web/secrets.json new file mode 100644 index 0000000..5336f85 --- /dev/null +++ b/TodoList.Web/secrets.json @@ -0,0 +1,23 @@ +{ + "SendGrid": { + "ServiceApiKey": "your_secret_key" + }, + "Authentication": { + "Facebook": { + "AppId": "", + "AppSecret": "" + }, + "Google": { + "ClientId": "", + "AppSecret": "" + }, + "Microsoft": { + "AppId": "", + "AppSecret": "" + }, + "Twitter": { + "ClientId": "", + "ClientSecret": "" + } + } +} \ No newline at end of file