The backend project was initially built using .NET Core 2 and it has been updated to DotNet Core 5.0
- DotNet Core 5.0 (C#)
- Clean Code Architecture / DDD
- RESTFul APIs
- SQL Server database & EF Core
- JWT authentication
- Slack Notifications
- Redis Cache
- Swagger
-
Install .NET Core 5 on your machine.
-
Run
docker-compose up --build
to spin up a new database. ** You can skip this step if you don't want to use Docker.IMPORTANT: Before running above command, make sure you have docker and docker-compose installed. * It runs the docker-compose.yml file.
-
Make the proper changes in the configuration file "DatingApp.Api/appsettings.json".
For uploading/downloading photos, you must create an account in Cloudinary. Then, navigate to "Settings > Security Tab > Access Keys" menu, generate a new pair of key
ApiKey/ApiSecret
, and change your config file using the generated tokens."Cloudinary": { "CloudName": "YourCloudName", "ApiKey": "YourApiKey", "ApiSecret": "YourApiSecret" }
-
Run
npm run start
for starting the server.
This project uses Entity Framework Core for database migrations.
From version 3.0, the .NET SDK does not include the EF tool so we should install it globally. Breaking Changes - EF 3.0
dotnet tool install --global dotnet-ef
This project sends Slack notifications photos are approved/rejected.
To set up a new Slack App we need to follow the steps:
-
Create a new app at the API website.
-
Get a token to use the Web API. Navigate to OAuth & Permissions and scroll down to the section for scopes. Use the dropdown under the "Bot Token Scopes" header and add the scope
chat:write
. -
Install the app to your workspace. Scroll up to the top of the page and click the "Install to Workspace" button. Go ahead and click "Allow", this will generate the token.
-
Copy the Bot User OAuth Access Token (it should begin with
xoxb
). Treat this value like a password and keep it safe. -
Create a channel to send messages. Go to the slack workspace linked to your app and create a new channel.
-
Invite the app to the channel. Send a message like
/invite @your-app-name
. This will allow the slack app to send messages in the channel. -
Replace the environment variables with the configurations created above.
"Slack": { "Token": "xoxb-YourTokenFromSlack", "BaseUrl": "https://slack.com/api", "Channels": { "RejectedPhotos": "#rejected-photos" } }
Reference: https://slack.dev/node-slack-sdk/getting-started
If you are using WSL, you might need to follow the steps below. Otherwise, your terminal may not find the EF installation. * NOTE: Linux users might not face this problem.
-
cd /home/yourUserName
-
Edit the file
.zshrc
and add this lineexport PATH="$PATH:$HOME/.dotnet/tools/"
. -
Restart your terminal
References: Stack Overflow - Cannot find command 'dotnet ef'