├── docs ├── demo.gif └── slides.pdf ├── frontend ├── public │ ├── favicon.ico │ └── index.html ├── babel.config.js ├── src │ ├── assets │ │ └── logo.png │ ├── main.js │ ├── router │ │ └── index.js │ ├── components │ │ └── HelloWorld.vue │ ├── ApiClient.js │ ├── App.vue │ └── views │ │ ├── Chart.vue │ │ └── Home.vue ├── .gitignore ├── README.md └── package.json ├── Shared ├── Models │ ├── DataRequest.cs │ ├── PredictionRequest.cs │ ├── Kline.cs │ ├── CandleStick.cs │ └── PredictionResult.cs ├── Shared.csproj └── Lib │ ├── DateTimeExtensions.cs │ └── HttpService.cs ├── Ticker ├── Properties │ └── launchSettings.json ├── appsettings.json ├── Ticker.csproj └── Program.cs ├── Auth ├── Properties │ └── launchSettings.json ├── appsettings.json ├── Auth.csproj ├── AuthController.cs ├── Program.cs └── JWTAuthenticationManager.cs ├── APIGateway ├── Properties │ └── launchSettings.json ├── APIGateway.csproj ├── Program.cs └── appsettings.json ├── NotifyHub ├── Properties │ └── launchSettings.json ├── appsettings.json ├── NotifyHub.csproj ├── AppHub.cs └── Program.cs ├── HistoricalData ├── Properties │ └── launchSettings.json ├── appsettings.json ├── HistoricalData.csproj ├── Program.cs └── DataController.cs ├── PricePredictorController ├── Properties │ └── launchSettings.json ├── appsettings.json ├── PricePredictorController.csproj ├── PredictController.cs └── Program.cs ├── Predictor1 ├── Program.cs ├── Predictor1.csproj └── PredictionRequestConsumer.cs ├── readme.md ├── .gitattributes ├── CryptoPredictor.sln └── .gitignore /docs/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eramax/CryptoPredictor/HEAD/docs/demo.gif -------------------------------------------------------------------------------- /docs/slides.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eramax/CryptoPredictor/HEAD/docs/slides.pdf -------------------------------------------------------------------------------- /frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eramax/CryptoPredictor/HEAD/frontend/public/favicon.ico -------------------------------------------------------------------------------- /frontend/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /frontend/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eramax/CryptoPredictor/HEAD/frontend/src/assets/logo.png -------------------------------------------------------------------------------- /Shared/Models/DataRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Shared.Models 2 | { 3 | public record DataRequest(string currency, long from, long to); 4 | } 5 | -------------------------------------------------------------------------------- /frontend/src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | 5 | createApp(App).use(router).mount('#app') 6 | -------------------------------------------------------------------------------- /Shared/Models/PredictionRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Shared.Models 2 | { 3 | public record PredictionRequest(string currency, int? limit, long? endDate, string tframe); 4 | } 5 | -------------------------------------------------------------------------------- /Ticker/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Ticker2": { 4 | "commandName": "Project", 5 | "environmentVariables": { 6 | } 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /Shared/Models/Kline.cs: -------------------------------------------------------------------------------- 1 | namespace Shared.Models 2 | { 3 | public record Kline(decimal open, decimal low, decimal high, decimal close, decimal volume, long timestamp, decimal turnover); 4 | } 5 | -------------------------------------------------------------------------------- /Auth/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "AuthServer": { 4 | "commandName": "Project", 5 | "applicationUrl": "http://0.0.0.0:5300", 6 | "environmentVariables": { 7 | } 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /APIGateway/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "APIGateway": { 4 | "commandName": "Project", 5 | "applicationUrl": "https://0.0.0.0:5000", 6 | "environmentVariables": { 7 | } 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /NotifyHub/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "SignalRServer": { 4 | "commandName": "Project", 5 | "applicationUrl": "http://0.0.0.0:5100", 6 | "environmentVariables": { 7 | } 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /HistoricalData/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "DataServer": { 4 | "commandName": "Project", 5 | "applicationUrl": "http://0.0.0.0:5200", 6 | "environmentVariables": { 7 | } 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /NotifyHub/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /PricePredictorController/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "PricePredictor": { 4 | "commandName": "Project", 5 | "applicationUrl": "http://0.0.0.0:5500", 6 | "environmentVariables": { 7 | } 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Shared/Models/CandleStick.cs: -------------------------------------------------------------------------------- 1 | using BinanceExchange.API.Models.WebSocket; 2 | using Newtonsoft.Json; 3 | 4 | namespace Shared.Models 5 | { 6 | public class CandleStick : KlineCandleStick 7 | { 8 | public long Timestamp { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Shared/Models/PredictionResult.cs: -------------------------------------------------------------------------------- 1 | namespace Shared.Models 2 | { 3 | public class PredictionResult 4 | { 5 | public float[] Value { get; set; } 6 | public float[] Low { get; set; } 7 | public float[] High { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Shared/Shared.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Ticker/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "apiKey": "", 11 | "secretKey": "" 12 | } 13 | -------------------------------------------------------------------------------- /HistoricalData/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "apiKey": "", 11 | "secretKey": "" 12 | } 13 | -------------------------------------------------------------------------------- /PricePredictorController/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "MqHost": "rabbitmq://localhost" 11 | } 12 | -------------------------------------------------------------------------------- /Auth/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "Secret": "IPjzS2pexgtHju2Uah4eYBfyGLbhOlXw_p$9#bMq'QvVwI$Xvj?3Cty$[g3PX{qtI~O3s>Ib" 11 | } 12 | -------------------------------------------------------------------------------- /frontend/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /Predictor1/Program.cs: -------------------------------------------------------------------------------- 1 | using MassTransit; 2 | using System; 3 | using System.Threading; 4 | 5 | Console.WriteLine("Predictor1 started"); 6 | var busControl = Bus.Factory.CreateUsingRabbitMq(cfg => cfg.ReceiveEndpoint("prediction-requests", e => e.Consumer())); 7 | await busControl.StartAsync(); 8 | new ManualResetEvent(false).WaitOne(); 9 | -------------------------------------------------------------------------------- /frontend/README.md: -------------------------------------------------------------------------------- 1 | # frontend 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Customize configuration 19 | See [Configuration Reference](https://cli.vuejs.org/config/). 20 | -------------------------------------------------------------------------------- /NotifyHub/NotifyHub.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Auth/Auth.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /HistoricalData/HistoricalData.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Shared/Lib/DateTimeExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Shared.Lib 4 | { 5 | public static class DateTimeExtensions 6 | { 7 | public static long ToToUnixTimestamp(this DateTime MyDateTime) 8 | { 9 | //TimeSpan timeSpan = MyDateTime - new DateTime(1970, 1, 1, 0, 0, 0); 10 | //return (long)timeSpan.TotalSeconds*1000; 11 | return new DateTimeOffset(MyDateTime).ToUnixTimeSeconds() * 1000; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /frontend/src/router/index.js: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHistory } from 'vue-router' 2 | import Chart from "../views/Chart"; 3 | import Home from "../views/Home"; 4 | 5 | 6 | const routes = [ 7 | { 8 | path: '/', 9 | name: 'Home', 10 | component: Home 11 | }, 12 | { 13 | path: '/:currency/:tframe', 14 | name: 'Chart', 15 | component: Chart 16 | } 17 | ] 18 | 19 | const router = createRouter({ 20 | history: createWebHistory(process.env.BASE_URL), 21 | routes 22 | }) 23 | 24 | export default router 25 | -------------------------------------------------------------------------------- /APIGateway/APIGateway.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Predictor1/Predictor1.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Auth/AuthController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | using Microsoft.AspNetCore.Mvc; 3 | 4 | [ApiController] 5 | [Route("[controller]")] 6 | public class AuthController : ControllerBase 7 | { 8 | public record GetTokenRequest(string Username, string Password); 9 | 10 | [AllowAnonymous] 11 | [HttpPost("access_token")] 12 | public IActionResult Authorize([FromServices] JWTAuthenticationManager authenticationManager, [FromBody] GetTokenRequest request) 13 | { 14 | var token = authenticationManager.Authenticate(request.Username, request.Password); 15 | return token == null ? Unauthorized() : Ok(token); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /PricePredictorController/PricePredictorController.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "frontend", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build" 8 | }, 9 | "dependencies": { 10 | "@microsoft/signalr": "^5.0.5", 11 | "core-js": "^3.6.5", 12 | "fetch-retry": "^4.1.1", 13 | "klinecharts": "^7.1.0", 14 | "vue": "^3.0.0", 15 | "vue-router": "^4.0.0-0" 16 | }, 17 | "devDependencies": { 18 | "@vue/cli-plugin-babel": "~4.5.0", 19 | "@vue/cli-plugin-router": "~4.5.0", 20 | "@vue/cli-service": "~4.5.0", 21 | "@vue/compiler-sfc": "^3.0.0" 22 | }, 23 | "browserslist": [ 24 | "> 1%", 25 | "last 2 versions", 26 | "not dead" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /PricePredictorController/PredictController.cs: -------------------------------------------------------------------------------- 1 | using MassTransit; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Shared.Models; 4 | using System.Threading.Tasks; 5 | 6 | [ApiController] 7 | [Route("[controller]")] 8 | public class PredictController : ControllerBase 9 | { 10 | [HttpGet("{currency}")] 11 | public async Task> Get 12 | ([FromServices] IRequestClient client, string currency, int? limit, long? endDate, string tframe) 13 | { 14 | var payload = new PredictionRequest(currency, limit, endDate, tframe); 15 | var request = client.Create(payload); 16 | var response = await request.GetResponse(); 17 | return Ok(response); 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /NotifyHub/AppHub.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.SignalR; 2 | using Shared.Models; 3 | using System; 4 | using System.Threading.Tasks; 5 | public class AppHub : Hub 6 | { 7 | public async Task Subscribe(string topic) => await Groups.AddToGroupAsync(Context.ConnectionId, topic); 8 | public async Task Unsubscribe(string topic) => await Groups.RemoveFromGroupAsync(Context.ConnectionId, topic); 9 | public override async Task OnConnectedAsync() 10 | { 11 | Console.WriteLine($"{Context.ConnectionId} joined the conversation"); 12 | await base.OnConnectedAsync(); 13 | } 14 | public void Publish(string currency, CandleStick kline) 15 | { 16 | Console.WriteLine($"publishing on {currency}"); 17 | Clients.Group(currency).SendAsync(currency, kline); 18 | } 19 | } -------------------------------------------------------------------------------- /NotifyHub/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Microsoft.Extensions.Hosting; 5 | using Microsoft.Extensions.Logging; 6 | 7 | Host.CreateDefaultBuilder(args) 8 | .ConfigureLogging(logging => logging.AddConsole()) 9 | .ConfigureWebHostDefaults(webBuilder => webBuilder 10 | .ConfigureServices(services => 11 | { 12 | services.AddCors(); 13 | services.AddSignalR(); 14 | }) 15 | .Configure(app => 16 | { 17 | app.UseRouting(); 18 | app.UseCors(builder => builder.AllowAnyHeader().AllowAnyMethod().SetIsOriginAllowed((host) => true).AllowCredentials()); 19 | app.UseEndpoints(endpoints => endpoints.MapHub("/ws")); 20 | })).Build().Run(); -------------------------------------------------------------------------------- /frontend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | CryptoPredictor 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 |
20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # CryptoPredictor 2 | ![demo](./docs/demo.gif) 3 | ## A simple application to cover 4 | - Microservice architecture 5 | - SignalR real time messaging 6 | - RabbitMQ service bus 7 | - Secured microservices 8 | - Machine learning 9 | - Nice front end 10 | 11 | ## Lessons learned 12 | - .NET 5 helps you to develop microservices easily. 13 | - Binance and many other cryptocurrencies broker provide public API to get data feeds. 14 | - Masstransit is break through into microservices for .NET developers. 15 | - ML.NET support building many machine learning applications with less code. 16 | - Vue.js framework helps you to build complete front end application with less code than other frameworks. 17 | - SignalR binds both client and server together and allow remote method invocation to both. 18 | 19 | ## Presentation 20 | ![PDF slides](./docs/slides.pdf) 21 | 22 | -------------------------------------------------------------------------------- /Auth/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using Microsoft.Extensions.Hosting; 6 | using Microsoft.Extensions.Logging; 7 | using System.Text; 8 | 9 | string stringKey = ""; 10 | Host.CreateDefaultBuilder(args) 11 | .ConfigureLogging(logging => logging.AddConsole()) 12 | .ConfigureWebHostDefaults(webBuilder => webBuilder 13 | .ConfigureAppConfiguration((hostingContext, config) => stringKey = config.Build().GetValue("Secret")) 14 | .ConfigureServices(services => 15 | { 16 | var key = Encoding.UTF8.GetBytes(stringKey); 17 | services.AddSingleton(new JWTAuthenticationManager(key)); 18 | services.AddCors(); 19 | services.AddControllers(); 20 | }) 21 | .Configure(app => 22 | { 23 | app.UseRouting(); 24 | app.UseCors(builder => builder.AllowAnyHeader().AllowAnyMethod().SetIsOriginAllowed((host) => true).AllowCredentials()); 25 | app.UseEndpoints(endpoints => endpoints.MapControllers()); 26 | })).Build().Run(); 27 | -------------------------------------------------------------------------------- /PricePredictorController/Program.cs: -------------------------------------------------------------------------------- 1 | using MassTransit; 2 | using Microsoft.AspNetCore.Builder; 3 | using Microsoft.AspNetCore.Hosting; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using Microsoft.Extensions.Hosting; 6 | using Microsoft.Extensions.Logging; 7 | using Shared.Models; 8 | 9 | Host.CreateDefaultBuilder(args) 10 | .ConfigureLogging(logging => logging.AddConsole()) 11 | .ConfigureWebHostDefaults(webBuilder => webBuilder 12 | .ConfigureServices(services => 13 | { 14 | services.AddControllers(); 15 | services.AddMassTransitHostedService().AddMassTransit(x => 16 | { 17 | x.AddRequestClient(); 18 | x.AddBus(context => Bus.Factory.CreateUsingRabbitMq(c => 19 | { 20 | c.Host("rabbitmq://localhost"); 21 | c.ConfigureEndpoints(context); 22 | })); 23 | }); 24 | }) 25 | .Configure(app => 26 | { 27 | app.UseRouting(); 28 | app.UseCors(builder => builder.AllowAnyHeader().AllowAnyMethod().SetIsOriginAllowed((host) => true).AllowCredentials()); 29 | app.UseEndpoints(endpoints => endpoints.MapControllers()); 30 | })).Build().Run(); -------------------------------------------------------------------------------- /Ticker/Ticker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | PreserveNewest 16 | true 17 | PreserveNewest 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Auth/JWTAuthenticationManager.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.IdentityModel.Tokens; 2 | using Shared.Lib; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.IdentityModel.Tokens.Jwt; 6 | using System.Linq; 7 | using System.Security.Claims; 8 | 9 | public class JWTAuthenticationManager 10 | { 11 | readonly IDictionary users = new Dictionary {{ "demo", "demo" },{ "admin", "password" }}; 12 | private readonly byte[] tokenKey; 13 | public JWTAuthenticationManager(byte[] tokenKey) => this.tokenKey = tokenKey; 14 | public record TokenResponse(string access_token, long expires); 15 | public TokenResponse Authenticate(string username, string password) 16 | { 17 | if (!users.Any(u => u.Key == username && u.Value == password)) return null; 18 | var expires = DateTime.UtcNow.AddMinutes(1); 19 | var tokenHandler = new JwtSecurityTokenHandler(); 20 | var tokenDescriptor = new SecurityTokenDescriptor 21 | { 22 | Subject = new ClaimsIdentity(new Claim[] {new Claim(ClaimTypes.Name, username) }), 23 | Expires = expires, 24 | SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(tokenKey), SecurityAlgorithms.HmacSha256Signature) 25 | }; 26 | var desc = tokenHandler.CreateToken(tokenDescriptor); 27 | var token = new TokenResponse(tokenHandler.WriteToken(desc), expires.ToToUnixTimestamp()); 28 | return token; 29 | } 30 | } -------------------------------------------------------------------------------- /Shared/Lib/HttpService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net.Http; 3 | using System.Net.Http.Json; 4 | using System.Threading.Tasks; 5 | 6 | namespace Shared.Lib 7 | { 8 | public class HttpService 9 | { 10 | private readonly HttpClient httpClient; 11 | 12 | public HttpService(HttpClient httpClient) 13 | { 14 | this.httpClient = httpClient; 15 | } 16 | 17 | public async Task GetAsync(string url) 18 | { 19 | HttpResponseMessage res = await httpClient.GetAsync(url); 20 | if (res.IsSuccessStatusCode) 21 | { 22 | return await res.Content.ReadFromJsonAsync(); 23 | } 24 | else 25 | { 26 | string msg = await res.Content.ReadAsStringAsync(); 27 | Console.WriteLine(msg); 28 | throw new Exception(msg); 29 | } 30 | } 31 | 32 | public async Task PostAsync(string url, TRequest request) 33 | { 34 | HttpResponseMessage res = await httpClient.PostAsJsonAsync(url, request); 35 | if (res.IsSuccessStatusCode) 36 | { 37 | return await res.Content.ReadFromJsonAsync(); 38 | } 39 | else 40 | { 41 | string msg = await res.Content.ReadAsStringAsync(); 42 | Console.WriteLine(msg); 43 | throw new Exception(msg); 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /HistoricalData/Program.cs: -------------------------------------------------------------------------------- 1 | using BinanceExchange.API.Client; 2 | using BinanceExchange.API.Client.Interfaces; 3 | using Microsoft.AspNetCore.Builder; 4 | using Microsoft.AspNetCore.Hosting; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.DependencyInjection; 8 | using Microsoft.Extensions.Hosting; 9 | using Microsoft.Extensions.Logging; 10 | 11 | string apiKey = ""; 12 | string secretKey = ""; 13 | Host.CreateDefaultBuilder(args) 14 | .ConfigureLogging(logging => logging.AddConsole()) 15 | .ConfigureWebHostDefaults(webBuilder => webBuilder 16 | .ConfigureAppConfiguration((hostingContext, config) => 17 | { apiKey = config.Build().GetValue("apiKey"); secretKey = config.Build().GetValue("secretKey"); }) 18 | .ConfigureServices(services => 19 | { 20 | var binanceClient = new BinanceClient(new ClientConfiguration() { ApiKey = apiKey, SecretKey = secretKey }); 21 | services.AddResponseCompression(); 22 | services.AddApiVersioning(config => 23 | { config.DefaultApiVersion = new ApiVersion(1, 0); config.AssumeDefaultVersionWhenUnspecified = true; }); 24 | services.AddSingleton(binanceClient); 25 | services.AddCors(); 26 | services.AddResponseCaching(); 27 | services.AddControllers(); 28 | }) 29 | .Configure(app => 30 | { 31 | app.UseRouting(); 32 | app.UseResponseCompression(); 33 | app.UseResponseCaching(); 34 | app.UseCors(builder => builder.AllowAnyHeader().AllowAnyMethod().SetIsOriginAllowed((host) => true).AllowCredentials()); 35 | app.UseEndpoints(endpoints => endpoints.MapControllers()); 36 | })).Build().Run(); 37 | -------------------------------------------------------------------------------- /APIGateway/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | using Microsoft.Extensions.Logging; 4 | using Microsoft.AspNetCore.Authentication.JwtBearer; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.DependencyInjection; 8 | using Microsoft.IdentityModel.Tokens; 9 | using Ocelot.Cache.CacheManager; 10 | using Ocelot.DependencyInjection; 11 | using Ocelot.Middleware; 12 | using System.Text; 13 | using Ocelot.Provider.Polly; 14 | 15 | string stringKey = ""; 16 | Host.CreateDefaultBuilder(args) 17 | .ConfigureLogging(logging => logging.AddConsole()) 18 | .ConfigureWebHostDefaults(webBuilder => webBuilder 19 | .ConfigureAppConfiguration((hostingContext, config) => stringKey = config.Build().GetValue("Secret")) 20 | .ConfigureServices(services => 21 | { 22 | var key = Encoding.UTF8.GetBytes(stringKey); 23 | services.AddCors().AddOcelot().AddCacheManager(settings => settings.WithDictionaryHandle()).AddPolly(); 24 | services.AddAuthentication(x => x.DefaultAuthenticateScheme = x.DefaultSignInScheme = JwtBearerDefaults.AuthenticationScheme) 25 | .AddJwtBearer(x => 26 | { 27 | x.RequireHttpsMetadata = false; 28 | x.SaveToken = true; 29 | x.TokenValidationParameters = new TokenValidationParameters 30 | { 31 | ValidateIssuerSigningKey = true, 32 | IssuerSigningKey = new SymmetricSecurityKey(key), 33 | ValidateIssuer = false, 34 | ValidateAudience = false 35 | }; 36 | }); 37 | }) 38 | .Configure(app => 39 | { 40 | app.UseCors(builder => builder.AllowAnyHeader().AllowAnyMethod().SetIsOriginAllowed((host) => true).AllowCredentials()); 41 | app.UseAuthentication(); 42 | app.UseWebSockets(); 43 | app.UseOcelot().Wait(); 44 | })).Build().Run(); 45 | -------------------------------------------------------------------------------- /HistoricalData/DataController.cs: -------------------------------------------------------------------------------- 1 | using BinanceExchange.API.Client.Interfaces; 2 | using BinanceExchange.API.Enums; 3 | using BinanceExchange.API.Models.Request; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Shared.Models; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Linq; 9 | using System.Threading.Tasks; 10 | using Shared.Lib; 11 | 12 | 13 | [ApiVersion("1")] 14 | [ApiController] 15 | [Route("[controller]")] 16 | public class DataController : ControllerBase 17 | { 18 | //BTCUSDT?tframe=4&limit=H1&startDate=10000&endDate=1619945168 19 | [ResponseCache(Duration = 50, Location = ResponseCacheLocation.Any, NoStore = false)] 20 | [HttpGet("{currency}")] 21 | public async Task> Get([FromServices] IBinanceClient binanceClient, string currency, 22 | int? limit, long? startDate, long? endDate, string tframe) 23 | { 24 | KlineInterval interval = tframe switch 25 | { 26 | "M1" => KlineInterval.OneMinute, 27 | "M5" => KlineInterval.FiveMinutes, 28 | "M15" => KlineInterval.FifteenMinutes, 29 | "M30" => KlineInterval.ThirtyMinutes, 30 | "H1" => KlineInterval.OneHour, 31 | "H4" => KlineInterval.FourHours, 32 | "D1" => KlineInterval.OneDay, 33 | "W1" => KlineInterval.OneWeek, 34 | _ => KlineInterval.OneHour 35 | }; 36 | var opts = new GetKlinesCandlesticksRequest { Interval = interval, Limit = limit, Symbol = currency }; 37 | opts.StartTime = (startDate.HasValue) ? DateTimeOffset.FromUnixTimeSeconds(startDate.Value).DateTime.ToLocalTime() : null; 38 | opts.EndTime = (endDate.HasValue) ? DateTimeOffset.FromUnixTimeSeconds(endDate.Value).DateTime.ToLocalTime() : null; 39 | 40 | var data = await binanceClient.GetKlinesCandlesticks(opts); 41 | var result = data.Select(d => new CandleStick() 42 | { 43 | Open = d.Open, 44 | Close = d.Close, 45 | High = d.High, 46 | Low = d.Low, 47 | Volume = d.Volume, 48 | Timestamp = d.OpenTime.ToToUnixTimestamp() 49 | }).ToList(); 50 | return result; 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /frontend/src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 41 | 42 | 43 | 59 | -------------------------------------------------------------------------------- /Ticker/Program.cs: -------------------------------------------------------------------------------- 1 | using BinanceExchange.API.Client; 2 | using BinanceExchange.API.Enums; 3 | using BinanceExchange.API.Websockets; 4 | using Microsoft.AspNetCore.SignalR.Client; 5 | using Microsoft.Extensions.Configuration; 6 | using Shared.Lib; 7 | using Shared.Models; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Linq; 11 | using System.Threading; 12 | using System.Threading.Tasks; 13 | 14 | var config = new ConfigurationBuilder().AddJsonFile($"appsettings.json", true, true).AddEnvironmentVariables().Build(); 15 | string apiKey = config.GetValue("apiKey"); 16 | string secretKey = secretKey = config.GetValue("secretKey"); 17 | var SignalRConnection = new HubConnectionBuilder().WithUrl("http://localhost:5100/ws", 18 | ops => ops.AccessTokenProvider = () => Task.FromResult("Ticker")).Build(); 19 | SignalRConnection.Closed += async (error) => { await Task.Delay(new Random().Next(0, 5) * 1000); await SignalRConnection.StartAsync(); }; 20 | await SignalRConnection.StartAsync().ContinueWith(t => Console.WriteLine("Connection Started")); 21 | var binanceClient = new BinanceClient(new ClientConfiguration { ApiKey = apiKey, SecretKey = secretKey }); 22 | var binanceWebSocketClient = new DisposableBinanceWebSocketClient(binanceClient); 23 | 24 | var currencies = new List { "BTCUSDT", "ETHUSDT" }; 25 | var timeframe = new Dictionary { {"M1", KlineInterval.OneMinute } , {"M5", KlineInterval.FiveMinutes }, 26 | {"M15", KlineInterval.FifteenMinutes },{"M30", KlineInterval.ThirtyMinutes }, {"H1", KlineInterval.OneHour }, 27 | {"H4", KlineInterval.FourHours },{"D1", KlineInterval.OneDay } }; 28 | 29 | currencies.ForEach(c => 30 | timeframe.ToList().ForEach(t => 31 | binanceWebSocketClient.ConnectToKlineWebSocket(c, t.Value, data => 32 | { 33 | var klineObj = new CandleStick() 34 | { 35 | Close = data.Kline.Close, 36 | High = data.Kline.High, 37 | Low = data.Kline.Low, 38 | Open = data.Kline.Open, 39 | Volume = data.Kline.Volume, 40 | Timestamp = data.Kline.StartTime.ToToUnixTimestamp() 41 | }; 42 | SignalRConnection.InvokeAsync("Publish", $"{c}/{t.Key}", klineObj); 43 | }) 44 | )); 45 | new ManualResetEvent(false).WaitOne(); -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /Predictor1/PredictionRequestConsumer.cs: -------------------------------------------------------------------------------- 1 | using MassTransit; 2 | using Microsoft.ML; 3 | using Microsoft.ML.Transforms.TimeSeries; 4 | using Shared.Models; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Net.Http; 9 | using System.Net.Http.Json; 10 | using System.Threading.Tasks; 11 | 12 | class PredictionRequestConsumer : IConsumer 13 | { 14 | public async Task Consume(ConsumeContext context) 15 | { 16 | Console.WriteLine($"Value: {context.Message.currency} - {context.Message.tframe}"); 17 | var data = await FetchData(context.Message); 18 | PredictionResult result = Forcast(data); 19 | await context.RespondAsync(result); 20 | } 21 | 22 | static readonly HttpClient client = new(); 23 | public record InputModel(float Close); 24 | static string host = "http://localhost:5200"; 25 | static async Task> FetchData(PredictionRequest request) 26 | { 27 | try 28 | { 29 | var response = await 30 | client.GetAsync($"{host}/data/{request.currency}?tframe={request.tframe}&limit={request.limit}&endDate={request.endDate}"); 31 | response.EnsureSuccessStatusCode(); 32 | var data = await response.Content.ReadFromJsonAsync>(); 33 | var converted = data.Select(d => new InputModel(decimal.ToSingle(d.Close))); 34 | return converted; 35 | } 36 | catch (HttpRequestException e) 37 | { 38 | Console.WriteLine("\nException Caught!"); 39 | Console.WriteLine("Message :{0} ", e.Message); 40 | return default; 41 | } 42 | } 43 | 44 | static PredictionResult Forcast(IEnumerable data) 45 | { 46 | int series = 7; 47 | int window = 2; 48 | int horizon = 20; 49 | float confidenceLevel = 0.75f; 50 | if (data == default) return default; 51 | var context = new MLContext(); 52 | var dataview = context.Data.LoadFromEnumerable(data); 53 | 54 | var pipeline = context.Forecasting.ForecastBySsa( 55 | nameof(PredictionResult.Value), 56 | nameof(InputModel.Close), 57 | windowSize: window, 58 | seriesLength: series, 59 | trainSize: data.Count(), 60 | horizon: horizon, 61 | confidenceLevel: confidenceLevel, 62 | confidenceLowerBoundColumn: nameof(PredictionResult.Low), 63 | confidenceUpperBoundColumn: nameof(PredictionResult.High) 64 | ); 65 | var model = pipeline.Fit(dataview); 66 | var forecastingEngine = model.CreateTimeSeriesEngine(context); 67 | var forecasts = forecastingEngine.Predict(); 68 | return forecasts; 69 | } 70 | } -------------------------------------------------------------------------------- /APIGateway/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "Secret": "IPjzS2pexgtHju2Uah4eYBfyGLbhOlXw_p$9#bMq'QvVwI$Xvj?3Cty$[g3PX{qtI~O3s>Ib", 10 | "AllowedHosts": "*", 11 | "Routes": [ 12 | { 13 | "DownstreamPathTemplate": "/auth/access_token", 14 | "DownstreamScheme": "http", 15 | "DownstreamHostAndPorts": [ 16 | { 17 | "Host": "localhost", 18 | "Port": 5300 19 | } 20 | ], 21 | "UpstreamPathTemplate": "/api/auth/access_token", 22 | "UpstreamHttpMethod": [ "Post" ], 23 | "QoSOptions": { 24 | "ExceptionsAllowedBeforeBreaking": 3, 25 | "DurationOfBreak": 10000, 26 | "TimeoutValue": 5000 27 | } 28 | }, 29 | { 30 | "DownstreamPathTemplate": "/data/{currency}", 31 | "DownstreamScheme": "http", 32 | "DownstreamHostAndPorts": [ 33 | { 34 | "Host": "localhost", 35 | "Port": 5200 36 | } 37 | ], 38 | "UpstreamPathTemplate": "/api/data/{currency}", 39 | "UpstreamHttpMethod": [ "Get" ], 40 | "AuthenticationOptions": { 41 | "AuthenticationProviderKey": "Bearer", 42 | "AllowedScopes": [] 43 | }, 44 | "FileCacheOptions": { "TtlSeconds": 50 }, 45 | "QoSOptions": { 46 | "ExceptionsAllowedBeforeBreaking": 3, 47 | "DurationOfBreak": 10000, 48 | "TimeoutValue": 5000 49 | } 50 | }, 51 | { 52 | "DownstreamPathTemplate": "/predict/{currency}", 53 | "DownstreamScheme": "http", 54 | "DownstreamHostAndPorts": [ 55 | { 56 | "Host": "localhost", 57 | "Port": 5500 58 | } 59 | ], 60 | "UpstreamPathTemplate": "/api/forcast/{currency}", 61 | "UpstreamHttpMethod": [ "Get" ], 62 | "AuthenticationOptions": { 63 | "AuthenticationProviderKey": "Bearer", 64 | "AllowedScopes": [] 65 | }, 66 | "FileCacheOptions": { "TtlSeconds": 50 }, 67 | "QoSOptions": { 68 | "ExceptionsAllowedBeforeBreaking": 3, 69 | "DurationOfBreak": 10000, 70 | "TimeoutValue": 10000 71 | } 72 | }, 73 | { 74 | "DownstreamPathTemplate": "/ws/{catchAll}", 75 | "DownstreamScheme": "ws", 76 | "DownstreamHostAndPorts": [ 77 | { 78 | "Host": "localhost", 79 | "Port": 5100 80 | } 81 | ], 82 | "UpstreamPathTemplate": "/ws/{catchAll}", 83 | "UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE", "OPTIONS" ], 84 | "AuthenticationOptions": { 85 | "AuthenticationProviderKey": "Bearer", 86 | "AllowedScopes": [] 87 | } 88 | }, 89 | { 90 | "DownstreamPathTemplate": "/ws", 91 | "UpstreamPathTemplate": "/ws", 92 | "DownstreamScheme": "ws", 93 | "DownstreamHostAndPorts": [ 94 | { 95 | "Host": "localhost", 96 | "Port": 5100 97 | } 98 | ], 99 | "AuthenticationOptions": { 100 | "AuthenticationProviderKey": "Bearer", 101 | "AllowedScopes": [] 102 | } 103 | } 104 | ], 105 | "GlobalConfiguration": { 106 | "BaseUrl": "https://0.0.0.0:5000", 107 | "RequestIdKey": "OcRequestId" 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /frontend/src/ApiClient.js: -------------------------------------------------------------------------------- 1 | import * as signalR from "@microsoft/signalr"; 2 | export default class ApiClient { 3 | constructor(host, username, password) { 4 | console.log("ApiClient"); 5 | this.host = host; 6 | this.username = username; 7 | this.password = password; 8 | this.connection = null; 9 | this.expires = null; 10 | } 11 | async GetAccessToken() { 12 | if (this.expires != null && Date.now() < this.expires) return; 13 | console.log("GetAccessToken") 14 | const response = await fetch( 15 | `https://${this.host}:5000/api/auth/access_token`, { 16 | retries: 3, 17 | retryDelay: 1000, 18 | method: "POST", 19 | headers: { 20 | Accept: "application/json", 21 | "Content-Type": "application/json", 22 | }, 23 | body: JSON.stringify({ 24 | Username: this.username, 25 | Password: this.password 26 | }), 27 | } 28 | ); 29 | const data = await response.json(); 30 | this.token = data.access_token; 31 | this.expires = data.expires; 32 | } 33 | 34 | async LoadData(currency, tframe, end, limit) { 35 | await this.GetAccessToken(); 36 | console.log("LoadData") 37 | const response = await fetch(`https://${this.host}:5000/api/data/${currency}?tframe=${tframe}&limit=${limit}&endDate=${end}`, { 38 | retries: 3, 39 | retryDelay: 1000, 40 | method: "GET", 41 | headers: new Headers({ 42 | Authorization: "Bearer " + this.token, 43 | }), 44 | }) 45 | const json = await response.json(); 46 | return json; 47 | } 48 | 49 | async LoadForcast(currency, tframe, end, limit) { 50 | await this.GetAccessToken(); 51 | console.log("LoadForcast") 52 | const response = await fetch(`https://${this.host}:5000/api/forcast/${currency}?tframe=${tframe}&limit=${limit}&endDate=${end}`, { 53 | retries: 3, 54 | retryDelay: 1000, 55 | method: "GET", 56 | headers: new Headers({ 57 | Authorization: "Bearer " + this.token, 58 | }), 59 | }) 60 | const json = await response.json(); 61 | return json; 62 | } 63 | 64 | async Connect() { 65 | if (this.connection != null && this.connection.state == "Connected") return; 66 | console.log("New connection for SignalR") 67 | this.connection = new signalR.HubConnectionBuilder() 68 | .configureLogging(signalR.LogLevel.Debug) 69 | .withUrl(`https://${this.host}:5000/ws`, { 70 | accessTokenFactory: () => this.token, 71 | }) 72 | .withAutomaticReconnect([0, 0, 10000]) 73 | .build(); 74 | this.connection.onreconnecting((error) => 75 | console.log(`Connection lost due to error "${error}". Reconnecting.`) 76 | ); 77 | await this.connection.start(); 78 | window.connection = this.connection; 79 | } 80 | async Subscribe(currency, tframe, DataChange) { 81 | await this.Connect(); 82 | let topic = `${currency}/${tframe}` 83 | this.connection.on(topic, DataChange); 84 | this.connection.invoke("Subscribe", topic).catch(console.log); 85 | console.log(`Subscribed to ${topic}`) 86 | } 87 | async Unubscribe(currency, tframe) { 88 | if (this.connection == null || this.connection.state != "Connected") return; 89 | let topic = `${currency}/${tframe}` 90 | this.connection.invoke("Unsubscribe", topic).catch(console.log); 91 | console.log(`Unsubscribed to ${topic}`) 92 | } 93 | } -------------------------------------------------------------------------------- /CryptoPredictor.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31205.134 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "APIGateway", "APIGateway\APIGateway.csproj", "{E69C7594-1D61-424A-BA04-A58DBDF1B515}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared", "Shared\Shared.csproj", "{FFCE64D9-BBE4-430A-B914-393D269587FA}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ticker", "Ticker\Ticker.csproj", "{D7DD8B6A-AAC9-4831-9296-1E3C3294A4E4}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotifyHub", "NotifyHub\NotifyHub.csproj", "{ED879081-F152-44BA-9C54-7AF42BB7658E}" 13 | EndProject 14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Auth", "Auth\Auth.csproj", "{7B1600ED-E883-4253-AAFE-7D72E351F30D}" 15 | EndProject 16 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HistoricalData", "HistoricalData\HistoricalData.csproj", "{DDD3689D-2AD6-4B21-9090-A84309238D3D}" 17 | EndProject 18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PricePredictorController", "PricePredictorController\PricePredictorController.csproj", "{FE348546-757E-4B26-BF1A-5438CAD82087}" 19 | EndProject 20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Predictor1", "Predictor1\Predictor1.csproj", "{41F89A03-0AD5-4919-BB5A-6252BBB0F4D2}" 21 | EndProject 22 | Global 23 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 24 | Debug|Any CPU = Debug|Any CPU 25 | Release|Any CPU = Release|Any CPU 26 | EndGlobalSection 27 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 28 | {E69C7594-1D61-424A-BA04-A58DBDF1B515}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {E69C7594-1D61-424A-BA04-A58DBDF1B515}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {E69C7594-1D61-424A-BA04-A58DBDF1B515}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {E69C7594-1D61-424A-BA04-A58DBDF1B515}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {FFCE64D9-BBE4-430A-B914-393D269587FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {FFCE64D9-BBE4-430A-B914-393D269587FA}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {FFCE64D9-BBE4-430A-B914-393D269587FA}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {FFCE64D9-BBE4-430A-B914-393D269587FA}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {D7DD8B6A-AAC9-4831-9296-1E3C3294A4E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {D7DD8B6A-AAC9-4831-9296-1E3C3294A4E4}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {D7DD8B6A-AAC9-4831-9296-1E3C3294A4E4}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {D7DD8B6A-AAC9-4831-9296-1E3C3294A4E4}.Release|Any CPU.Build.0 = Release|Any CPU 40 | {ED879081-F152-44BA-9C54-7AF42BB7658E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 41 | {ED879081-F152-44BA-9C54-7AF42BB7658E}.Debug|Any CPU.Build.0 = Debug|Any CPU 42 | {ED879081-F152-44BA-9C54-7AF42BB7658E}.Release|Any CPU.ActiveCfg = Release|Any CPU 43 | {ED879081-F152-44BA-9C54-7AF42BB7658E}.Release|Any CPU.Build.0 = Release|Any CPU 44 | {7B1600ED-E883-4253-AAFE-7D72E351F30D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 45 | {7B1600ED-E883-4253-AAFE-7D72E351F30D}.Debug|Any CPU.Build.0 = Debug|Any CPU 46 | {7B1600ED-E883-4253-AAFE-7D72E351F30D}.Release|Any CPU.ActiveCfg = Release|Any CPU 47 | {7B1600ED-E883-4253-AAFE-7D72E351F30D}.Release|Any CPU.Build.0 = Release|Any CPU 48 | {DDD3689D-2AD6-4B21-9090-A84309238D3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 49 | {DDD3689D-2AD6-4B21-9090-A84309238D3D}.Debug|Any CPU.Build.0 = Debug|Any CPU 50 | {DDD3689D-2AD6-4B21-9090-A84309238D3D}.Release|Any CPU.ActiveCfg = Release|Any CPU 51 | {DDD3689D-2AD6-4B21-9090-A84309238D3D}.Release|Any CPU.Build.0 = Release|Any CPU 52 | {FE348546-757E-4B26-BF1A-5438CAD82087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 53 | {FE348546-757E-4B26-BF1A-5438CAD82087}.Debug|Any CPU.Build.0 = Debug|Any CPU 54 | {FE348546-757E-4B26-BF1A-5438CAD82087}.Release|Any CPU.ActiveCfg = Release|Any CPU 55 | {FE348546-757E-4B26-BF1A-5438CAD82087}.Release|Any CPU.Build.0 = Release|Any CPU 56 | {41F89A03-0AD5-4919-BB5A-6252BBB0F4D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 57 | {41F89A03-0AD5-4919-BB5A-6252BBB0F4D2}.Debug|Any CPU.Build.0 = Debug|Any CPU 58 | {41F89A03-0AD5-4919-BB5A-6252BBB0F4D2}.Release|Any CPU.ActiveCfg = Release|Any CPU 59 | {41F89A03-0AD5-4919-BB5A-6252BBB0F4D2}.Release|Any CPU.Build.0 = Release|Any CPU 60 | EndGlobalSection 61 | GlobalSection(SolutionProperties) = preSolution 62 | HideSolutionNode = FALSE 63 | EndGlobalSection 64 | GlobalSection(ExtensibilityGlobals) = postSolution 65 | SolutionGuid = {309A46C3-873D-4190-AEDF-4E9D4F9AA0D0} 66 | EndGlobalSection 67 | EndGlobal 68 | -------------------------------------------------------------------------------- /frontend/src/App.vue: -------------------------------------------------------------------------------- 1 | 81 | 82 | 101 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Oo]ut/ 33 | [Ll]og/ 34 | [Ll]ogs/ 35 | 36 | # Visual Studio 2015/2017 cache/options directory 37 | .vs/ 38 | # Uncomment if you have tasks that create the project's static files in wwwroot 39 | #wwwroot/ 40 | 41 | # Visual Studio 2017 auto generated files 42 | Generated\ Files/ 43 | 44 | # MSTest test Results 45 | [Tt]est[Rr]esult*/ 46 | [Bb]uild[Ll]og.* 47 | 48 | # NUnit 49 | *.VisualState.xml 50 | TestResult.xml 51 | nunit-*.xml 52 | 53 | # Build Results of an ATL Project 54 | [Dd]ebugPS/ 55 | [Rr]eleasePS/ 56 | dlldata.c 57 | 58 | # Benchmark Results 59 | BenchmarkDotNet.Artifacts/ 60 | 61 | # .NET Core 62 | project.lock.json 63 | project.fragment.lock.json 64 | artifacts/ 65 | 66 | # ASP.NET Scaffolding 67 | ScaffoldingReadMe.txt 68 | 69 | # StyleCop 70 | StyleCopReport.xml 71 | 72 | # Files built by Visual Studio 73 | *_i.c 74 | *_p.c 75 | *_h.h 76 | *.ilk 77 | *.meta 78 | *.obj 79 | *.iobj 80 | *.pch 81 | *.pdb 82 | *.ipdb 83 | *.pgc 84 | *.pgd 85 | *.rsp 86 | *.sbr 87 | *.tlb 88 | *.tli 89 | *.tlh 90 | *.tmp 91 | *.tmp_proj 92 | *_wpftmp.csproj 93 | *.log 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Microsoft Azure Build Output 210 | csx/ 211 | *.build.csdef 212 | 213 | # Microsoft Azure Emulator 214 | ecf/ 215 | rcf/ 216 | 217 | # Windows Store app package directories and files 218 | AppPackages/ 219 | BundleArtifacts/ 220 | Package.StoreAssociation.xml 221 | _pkginfo.txt 222 | *.appx 223 | *.appxbundle 224 | *.appxupload 225 | 226 | # Visual Studio cache files 227 | # files ending in .cache can be ignored 228 | *.[Cc]ache 229 | # but keep track of directories ending in .cache 230 | !?*.[Cc]ache/ 231 | 232 | # Others 233 | ClientBin/ 234 | ~$* 235 | *~ 236 | *.dbmdl 237 | *.dbproj.schemaview 238 | *.jfm 239 | *.pfx 240 | *.publishsettings 241 | orleans.codegen.cs 242 | 243 | # Including strong name files can present a security risk 244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 245 | #*.snk 246 | 247 | # Since there are multiple workflows, uncomment next line to ignore bower_components 248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 249 | #bower_components/ 250 | 251 | # RIA/Silverlight projects 252 | Generated_Code/ 253 | 254 | # Backup & report files from converting an old project file 255 | # to a newer Visual Studio version. Backup files are not needed, 256 | # because we have git ;-) 257 | _UpgradeReport_Files/ 258 | Backup*/ 259 | UpgradeLog*.XML 260 | UpgradeLog*.htm 261 | ServiceFabricBackup/ 262 | *.rptproj.bak 263 | 264 | # SQL Server files 265 | *.mdf 266 | *.ldf 267 | *.ndf 268 | 269 | # Business Intelligence projects 270 | *.rdl.data 271 | *.bim.layout 272 | *.bim_*.settings 273 | *.rptproj.rsuser 274 | *- [Bb]ackup.rdl 275 | *- [Bb]ackup ([0-9]).rdl 276 | *- [Bb]ackup ([0-9][0-9]).rdl 277 | 278 | # Microsoft Fakes 279 | FakesAssemblies/ 280 | 281 | # GhostDoc plugin setting file 282 | *.GhostDoc.xml 283 | 284 | # Node.js Tools for Visual Studio 285 | .ntvs_analysis.dat 286 | node_modules/ 287 | 288 | # Visual Studio 6 build log 289 | *.plg 290 | 291 | # Visual Studio 6 workspace options file 292 | *.opt 293 | 294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 295 | *.vbw 296 | 297 | # Visual Studio LightSwitch build output 298 | **/*.HTMLClient/GeneratedArtifacts 299 | **/*.DesktopClient/GeneratedArtifacts 300 | **/*.DesktopClient/ModelManifest.xml 301 | **/*.Server/GeneratedArtifacts 302 | **/*.Server/ModelManifest.xml 303 | _Pvt_Extensions 304 | 305 | # Paket dependency manager 306 | .paket/paket.exe 307 | paket-files/ 308 | 309 | # FAKE - F# Make 310 | .fake/ 311 | 312 | # CodeRush personal settings 313 | .cr/personal 314 | 315 | # Python Tools for Visual Studio (PTVS) 316 | __pycache__/ 317 | *.pyc 318 | 319 | # Cake - Uncomment if you are using it 320 | # tools/** 321 | # !tools/packages.config 322 | 323 | # Tabs Studio 324 | *.tss 325 | 326 | # Telerik's JustMock configuration file 327 | *.jmconfig 328 | 329 | # BizTalk build output 330 | *.btp.cs 331 | *.btm.cs 332 | *.odx.cs 333 | *.xsd.cs 334 | 335 | # OpenCover UI analysis results 336 | OpenCover/ 337 | 338 | # Azure Stream Analytics local run output 339 | ASALocalRun/ 340 | 341 | # MSBuild Binary and Structured Log 342 | *.binlog 343 | 344 | # NVidia Nsight GPU debugger configuration file 345 | *.nvuser 346 | 347 | # MFractors (Xamarin productivity tool) working folder 348 | .mfractor/ 349 | 350 | # Local History for Visual Studio 351 | .localhistory/ 352 | 353 | # BeatPulse healthcheck temp database 354 | healthchecksdb 355 | 356 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 357 | MigrationBackup/ 358 | 359 | # Ionide (cross platform F# VS Code tools) working folder 360 | .ionide/ 361 | 362 | # Fody - auto-generated XML schema 363 | FodyWeavers.xsd -------------------------------------------------------------------------------- /frontend/src/views/Chart.vue: -------------------------------------------------------------------------------- 1 | 85 | 86 | 221 | 222 | 227 | -------------------------------------------------------------------------------- /frontend/src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 122 | 123 | 124 | 241 | 242 | --------------------------------------------------------------------------------