{"id":20153670,"url":"https://github.com/anupsarkar-dev/spotlights","last_synced_at":"2025-04-09T21:33:30.655Z","repository":{"id":233310455,"uuid":"786979897","full_name":"anupsarkar-dev/SpotLights","owner":"anupsarkar-dev","description":"SpotLights |  Dev Community Blog Portal","archived":false,"fork":false,"pushed_at":"2024-06-26T17:33:31.000Z","size":1871,"stargazers_count":3,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T23:27:04.248Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anupsarkar-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-15T16:57:54.000Z","updated_at":"2024-06-03T01:52:06.000Z","dependencies_parsed_at":"2024-06-08T12:34:49.641Z","dependency_job_id":"520bf3cb-853c-458d-9176-0ee0f57c8c91","html_url":"https://github.com/anupsarkar-dev/SpotLights","commit_stats":null,"previous_names":["anupsarkar-dev/spotlights"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anupsarkar-dev%2FSpotLights","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anupsarkar-dev%2FSpotLights/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anupsarkar-dev%2FSpotLights/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anupsarkar-dev%2FSpotLights/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anupsarkar-dev","download_url":"https://codeload.github.com/anupsarkar-dev/SpotLights/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248115017,"owners_count":21050154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T23:20:29.219Z","updated_at":"2025-04-09T21:33:30.626Z","avatar_url":"https://github.com/anupsarkar-dev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cbr\u003e\n\u003ch3 align=\"center\"\u003eSpotLights | Developer Community Blog Portal \u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n    SpotLights is a self-hosted open source publishing platform written in .NET Core 8.0 and Blazor WebAssembly with Clean Architecture. \n    It can be used to quickly and easily set up a lightweight, but fully functional personal or community blog.\n\u003c/p\u003e\n\u003cbr\u003e\n\n  \n## UI\n\n### Homepage\n\n![Project flow diagram](./docs/homepage.png)\n\n\n### Blog view\n\n![Project flow diagram](./docs/blog.png)\n\n\n### Dashboard\n\n![Project flow diagram](./docs/dashboard.png)\n\n\n### Post manager\n\n![Project flow diagram](./docs/dashboard2.png)\n\n\n\n\n## Installation and Development\nIf you want to customize the SpotLights, or contribute:\n\n1. Download, fork, or clone the repository.\n2. [Download](https://dotnet.microsoft.com/zh-cn/download) .NET 8.0 SDK Choose to install the system version on your host. \n3. Nodejs 14 and above and install it on your host. [Download](https://nodejs.org/) \n4. Requires RDBMS whichever you prefer (Mssql Server, Postgres or Sqlite all are supported)\n5. Requires Redis for caching\n6. Set SpotLights.Application as start up project.\n7. Open the project with your favorite IDE (VS Code, Visual Studio, Atom, etc).\n8. Run the app with your IDE or these commands:\n```\n$ cd /your-local-path/SpotLights/src/SpotLights.Application\n$ dotnet run\n```\nThen you can open `localhost:5000` with your browser\n \n\n\n ## To change Database Provider (Choose any preferred database)\nUpdate provider and connection string in the `appsettings.json`:\n\n\n#### Microsoft Sql Server\n``` json\n\"SpotLights\": {\n   \"DbProvider\": \"Mssql\",\n   \"ConnString\": \"Data Source=mssql; User Id=sa; Password=Password; Initial Catalog=SpotLights;TrustServerCertificate=True\",\n   ...\n}\n```\nIn the latest version of sql server connection, SqlClient will perform a secure connection by default, and you need to add a server certificate to the system. \n\n#### SQLite\n``` json\n\"SpotLights\": {\n  \"DbProvider\": \"Sqlite\",\n  \"ConnString\": \"Data Source=App_Data/SpotLights.db\",\n   ...\n}\n```\nIt is recommended to put the database file under the App_Data folder. The logs and local pictures in the project will be stored in this path for persistence.\n\n\n#### Postgres\n``` json\n\"SpotLights\": {\n   \"DbProvider\": \"Postgres\",\n   \"ConnString\": \"Host=postgres;Username=postgres;Password=password;Database=SpotLights;\",\n   ...\n}\n```\nIn the above example, ConnString requires you to fill in the correct database host address username and password to connect normally\n\n\n\n## In Memory Caching Database\nCurrently redis is configured and required for running the application\n\n#### Redis\n``` json\n\"SpotLights\": {\n   \"Redis\": \"127.0.0.1:6379,defaultDatabase=0\",\n   ...\n}\n```\n\n## When a change to an entity field requires a database migration\n\nThe database migration is stored in the src/SpotLights.Data/Migrations  directory. \n\n\n## Migration Command \nShould run all the commands in root solution directory (Solution root -\u003e Right Click -\u003e Open In Terminal)\n\n``` shell\n\n# Before proceed make sure you have dotnet-ef tools are installed in your system\ndotnet tool install --global dotnet-ef\n\n# Create New Migration\ndotnet ef migrations add  Migration_Name   --project=src\\SpotLights.Data\\SpotLights.Data.csproj --startup-project=src\\SpotLights\\SpotLights.csproj --context ApplicationDbContext\n\n# Update Database\ndotnet ef database update   --project=src\\SpotLights.Data\\SpotLights.Data.csproj --startup-project=src\\SpotLights\\SpotLights.csproj --context ApplicationDbContext\n\n```\n\n\n## Project Structure\n\n![Project flow diagram](./docs/flow.png)\n\n\n``` shell\n\nSolution\n├── SpotLights.Admin(Contains Admin Dashboard related files)\n│   ├── Webassembly dependencies\n│   ├── Views, Components, Pages\n│   └── Assests, wwwroot\n│ \n├── SpotLights.Application (Startup Web Project)\n│   ├── Api Controller\n│   ├── View Controller\n│   └── Views\n│   \n├── SpotLights.Core\n│   ├── Services\n│   └── Views\n│\n├── SpotLights.Infrastructure\n│   ├── Repositories\n│   ├── Identity\n│   ├── Caches\n│   ├── Managers\n│   └── Providers\n│   \n├── SpotLights.Data\n│   ├── DbContext\n│   ├── Entity Configurations\n│   └── Migrations\n│\n├── SpotLights.Domain\n│   ├── Entity Model\n│   ├── Dao\n│   └── Dto\n│\n└── SpotLights.Shared\n    ├── Constants\n    ├── Enums\n    ├── Dto\n    ├── Extensions\n    ├── Viewmodels\n    ├── Resources\n    └── Helpers\n\n\n```\n\n\n### User Login and Registration\nOn the first login, user gets redirected to the `admin/register` page to register a new account. \nOnce account created, registration page is disabled and this user becomes a blog owner.\n\n### Authentication\nThe blog posts, including blog themes, are all run as public, server-side rendered MVC site. \n\nAnything under `admin` is Blazor Web Assembly application and is guarded by custom authentication provider (`BlogAuthenticationStateProvider`). \nUser password is one-way hashed and saved in the `Authors` table on the back-end. \nThe salt used to hash password pulled from `appsettings.json` configuration file and should be updated **before** creating user account.\n\n```\n\"SpotLights\": {\n  ...\n  \"Salt\": \"SECRET-CHANGE-ME!\"\n}\n```\n\n\n### Serilog\n\nLogging done using [Serilog Sink File](https://github.com/serilog/serilog-sinks-file) package.\nAll logs saved to the `/Logs` folder as configured in the application startup:\n\n```\nLog.Logger = new LoggerConfiguration()\n  .Enrich.FromLogContext()\n  .WriteTo.File(\"Logs/log-.txt\", rollingInterval: RollingInterval.Day)\n  .CreateLogger();\n\nLog.Warning(\"Test log\");\n```\n\n\n### Warn \nDo not add or delete database migration at will. After the application generates data, random migration may cause data loss. This project will automatically apply the migration when it starts.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanupsarkar-dev%2Fspotlights","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanupsarkar-dev%2Fspotlights","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanupsarkar-dev%2Fspotlights/lists"}