This project is a result of a technical test given by Asseco SEE. The purpose of the test was to showcase the author's skills in .NET Core and Web technologies.
See the wiki page for full requirements.
The following instructions will allow you to copy and run the project on a local machine for development and testing purposes.
It is strongly recommended that you install the following software before running the app:
- Visual Studio / VS Code
- Docker Desktop with Docker Compose V2 enabled in settings
- Node.js
- Clone the repository onto a local machine using the command:
git clone https://github.com/frakic/LeadGenerator
-
From there you can open BitMouse.LeadGenerator.sln in Visual Studio.
-
If you have Docker Desktop installed, Visual Studio should pull all of the required images and run docker-compose on start.
-
The first time you run the app, you might see a message in your browser, warning you about an invalid security certificate. Click on Advanced... and then Accept the Risk and Continue
- Once the backend projects are running and you can see the Swagger UI in your browser, it's time to go into the frontent project folder:
cd /BitMouse.LeadGenerator/BitMouse.LeadGenerator.Web/ClientApp
- Install dependencies:
npm i
- And run the project:
npm run dev
- After that, just visit http://localhost:5004 and you should see the app
- Database: Upon successfully building and running all backend projects, you can manually inspect the database using MS SSMS or your preferred database management tool. The credentials can be found in setup.sql script on line 5.
- Integration API: Functions as a separate application with its own Swagger UI, which can be viewed by setting the "composeLaunchServiceName" property in launchSettings.json file to "bitmouse.leadgenerator.integration.api" and running the project with docker-compose.
- Sending email: Since this is a mock app, a fake SMTP service called Ethereal Email is being used. If you want to check whether the emails are actually being delivered to the recipient, you can log in using the credentials provided in the appsettings.Development.json file in the BitMouse.LeadGenerator.Api project.
- Logging: Application logs with exceptions and other useful information can be viewed by going into a running docker container BitMouse.LeadGenerator.Api and navigating to /var/log/LeadGenerator.Api folder.
If you encounter any issues while trying to run or build the project, you can refer to the following troubleshooting tips:
-
Dependency issues: Make sure that you have installed all required dependencies by following the instructions in the Installation section. If you are encountering an error related to a missing dependency, try reinstalling the dependencies by running the relevant command(s) again.
-
Database issues: When the database container starts, it uses entrypoint.sh, mssql-customize.sh and setup.sql scripts, located in /BitMouse.LeadGenerator.Database folder, in order to initialize the database. If you are unable to connect to the database on localhost, try deleting the database container, restarting docker and running docker-compose again. Also, make sure that the first two mentioned scripts have line endings set to LF, as opposed to CRLF.
-
Port(s) unavailable: LeadGenerator uses the following ports for all of its components: 5000, 5001, 5002, 5003, 5004. Make sure that you have nothing else running on these before running LeadGenerator.