Simoona's back-end is built using ASP.NET with Entity Framework. Project dependencies are managed via NuGet.
- Open the solution file
Shrooms.slnfile located insrc\api\Shrooms.sln. - Set
Shrooms.APIproject as StartUp project (located insrc\api\Main\PresentationLayer\Shrooms.API\). - Start it with debug (F5) or without debug (Ctrl+F5).
- Wait for project to build.
- If database is set up and Web.config has correct connection string the project should start. To set up the database head over to build folder.
Simoona uses email sending services to send its users various important and optional notifications. If you don't set up the mailing service, users won't be able to receive these notifications. It's especially important to set it up if local sign-up/sign-in system is being used (by default it is), because the system uses email service to send information about verifying email addresses and resetting passwords. For development purposes the easiest way to set up SMTP Server is to use MailTrap. For sending emails to their destinations we recommend services like SendGrid.
Follow these steps to configure mail sending service in Simoona:
-
Create a service account using MailTrap, SendGrid or any other email service
-
After creating an account find your SMTP server credentials on their website
-
Open Web.config file located in
src\api\Main\PresentationLayer\Shrooms.API\Web.config -
Locate
<mailSettings>block in Web.config file and paste your credentials and host to appropriate places inside of<network>block as shown in code snippet bellow<system.net> <mailSettings> <smtp from="noreply@simoona.com"> <network host="yourHost" userName="yourUserName" password="yourPassword" /> </smtp> </mailSettings> </system.net>
Another way to work with email services while developing is installing smtp4dev and setting your Web.config according to this:
```xml
<system.net>
<mailSettings>
<smtp from="noreply@simoona.com">
<network host="localhost" port="25" />
</smtp>
</mailSettings>
</system.net>
```
You will see all your sent emails in the dedicated application on your local machine while actually no third party or online service is involved.
All configurable properties are located in src\api\Main\PresentationLayer\Shrooms.API\Web.config file.
Don't forget to change API and Client urls if running on different addresses:
<!-- Url used to redirect back to AngularJS application after external login -->
<add key="OAuthRedirectUri" value="http://localhost:3000/" />
<!-- Urls for AngularJS application and API -->
<add key="ClientUrl" value="http://localhost:3000/" />
<add key="ApiUrl" value="http://localhost:50321" />By default Simoona uses local file system storage, but it's possible to use Azure Blob Storage for storing media files. To set up blob storage follow these steps:
-
Head over to Azure Portal and follow instructions Azure Quickstart
-
After creating blob storage get its connection string
-
Open
Web.configfile located insrc\api\Main\PresentationLayer\Shrooms.API\ -
Locate
<connectionStrings>block and put your blob storage connection string as a value ofconnectionStringinside<add>block withStorageConnectionStringname as shown below<connectionStrings> ... <add name="StorageConnectionString" connectionString="yourConnectionString" /> </connectionStrings>
If you don't use ImageResizer Performance Edition plugins, but wish to use Azure Blob Storage you will need to follow these extra steps:
-
Open Web.config file located in
src\api\Main\PresentationLayer\Shrooms.API\Web.config -
Inside
<rules>block in<system.webServer>block findRedirect to Azure Blob Storagerule, make sure that it is uncommented and paste your blob storage url asurlvalue inside<action>block as shown bellow (make sure to leave{R:1}intact)<system.webServer> <rewrite> <rules> <rule name="Redirect to Azure Blob Storage"> <match url="^storage/(.*)$"/> <action type="Redirect" url="https://your-project.blob.core.windows.net/{R:1}" redirectType="Permanent" /> </rule> </rules> </rewrite> </system.webServer>
Simoona supports sign in with Google and Facebook. To enable this feature follow these steps:
- Get Google and/or Facebook application credentials
- Open Web.config file located in
src\api\Main\PresentationLayer\Shrooms.API\ - Locate
<appSettings>block and find the lines shown below and just paste your application credentials to appropriate places asvalue
<appSettings>
...
<add key="GoogleAccountClientId" value="yourGoogleAccountClientId" />
<add key="GoogleAccountClientSecret" value="yourGoogleAccountClientSecret" />
<add key="FacebookAccountAppId" value="yourFacebookAccountAppId" />
<add key="FacebookAccountAppSecret" value="yourFacebookAccountAppSecret" />
...
</appSettings>Simoona can also leverage ImageResizer Performance plugins to make media delivery faster. If you wish to try these plugins in development environment or you have a license to use them follow these steps:
-
Open Web.config file located in
src\api\Main\PresentationLayer\Shrooms.API\ -
Locate
<resizer>block and uncomment lines inside of<plugins>block as shown bellow<resizer> <plugins> <add name="AzureReader2" prefix="~/storage" connectionString="yourBlobStorageConnectionString" endpoint="https://your-project.blob.core.windows.net/" /> <add name="AnimatedGifs" /> <add name="DiskCache" /> <add name="PrettyGifs" /> </plugins> </resizer>
To use AzureReader2 plugin you will have to provder your connectionString and endpoint, paste these values to appropriate places inside add block with name="AzureReader2" attribute. If you have a Redirect to Azure Blob Storage rule enabled don't forget to disable it.
To use these plugins in production environment you will have to put ImageResizer license inside <license> block as shown below
<resizer>
<licenses>
<license>
<!-- ImageResizer license here -->
</license>
</licenses>
</resizer>