Skip to content

ASP.NET Core full-stack application - An educational discussion platform for students and teachers, featuring many beautiful features.

License

Notifications You must be signed in to change notification settings

Raofin/TopicTalks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TopicTalks Logo
Talk about it. Learn about it.

πŸ”΄ Live Demo

πŸ“š Table of Contents

⭐ Give It a Star

If you find this project useful or interesting, please consider giving it a star. Thank you! πŸ€—

GitHub stars

πŸ’Ž Features

TopicTalks is an educational discussion platform designed to foster knowledge sharing between students and teachers. Here's a look at its key features:

  • Q&A at its finest: Ask questions, receive answers from teachers or peers, and engage in threaded discussions for in-depth exploration.
  • Always informed: Stay up-to-date with email notifications for new replies and discussion thread activity.
  • Offline access: Export discussions with question and user details as PDFs for easy offline reference.
  • Data in your hands: Export user lists with details in Excel format.
  • Secured and permissioned: Role-based authorization ensures a safe and controlled environment for all users.
  • A joy to use: Experience a user-friendly interface with a pixel-perfect design that prioritizes both form and function.

And much more! Explore additional functionalities designed to enrich educational discussions and learning experience.

πŸš€ Getting Started

I. Requirements πŸ“

II. Installation βš™οΈ

1. Clone the Repository

gh repo clone Raofin/TopicTalks

2. Setup Google Cloud API Credentials (Optional) ☁️

βœ… Free forever.

After researching free cloud storage options, Google Drive storage through Google Cloud seemed to be the best fit for this project. Given the limited resources available on the internet for interacting with the Google Drive APIs, it took me a while to understand andΒ implement the functionalities.

However, in order for the project to run with full functionality, you'll need to have your own Google Drive API credentials inserted in the GoogleCredentials.json.Β Here are the steps to follow to create a free Google Cloud project and get the credentials πŸ”½

  1. Create a project in the Google Cloud Console
  2. Enable Google Drive API for the project

  3. Select Create Credentials

  4. Select Application Data -> Click Next

  5. Fill out the details -> Select Owner in Role -> Click Done

  6. Go to Service Accounts -> Select the newly created service account
  7. Select Keys -> Click Add Key -> Choose JSON -> Click Create
    (The credentials json file should be automatically downloaded)

  8. Open the file and copy the value of client_email
  9. Go to Google Drive -> Create a folder named TopicTalks
  10. Share the folder with the client_email

  11. Finally, paste everything from the downloaded json file into GoogleCredentials.json
  12. Star this project

3. Database Migration

The project is configured to automatically apply migrations with some seed data on its first run. To create a database with more data, including the beautiful user portraits and question covers, execute the TopicTalks.sql script. You can manually apply migrations using the following commands:

  • For Package Manager πŸ‘‡
    Update-Database -Context AppDbContext -Project TopicTalks.Infrastructure -StartupProject TopicTalks.Api
  • For CLI πŸ‘‡
    dotnet ef database update --project TopicTalks.Infrastructure/TopicTalks.Infrastructure.csproj --startup-project TopicTalks.Api/TopicTalks.Api.csproj
🌻 Useful Commands
Add-Migration Init -Context AppDbContext -Project TopicTalks.Infrastructure -StartupProject TopicTalks.Api
Remove-Migration -Project TopicTalks.Infrastructure -StartupProject TopicTalks.Api -Force
Update-Database -Context AppDbContext -Project TopicTalks.Infrastructure -StartupProject TopicTalks.Api
Update-Database -Migration Init -Context AppDbContext -Project TopicTalks.Infrastructure -StartupProject TopicTalks.Api

4. Configure Email Settings via User Secrets πŸ“¬

To use Gmail's smtp server, you will need to use an app password. Note that this requires having 2-step verification enabled in your account.

Use the following Commands to store the credentials in user secrets πŸ‘‡

dotnet user-secrets --project src/TopicTalks.Api set EmailSettings:Email you@gmail.com
dotnet user-secrets --project src/TopicTalks.Api set EmailSettings:Password your-password

If you are using a different server, set the server and port as well accordingly.

5. Build the Projects

cd TopicTalks/src
dotnet build TopicTalks.Api/TopicTalks.Api.csproj
dotnet build TopicTalks.Web/TopicTalks.Web.csproj

6. Run the Projects (Seperately)

dotnet run --project TopicTalks.Api/TopicTalks.Api.csproj --urls "https://localhost:9998"
dotnet run --project TopicTalks.Web/TopicTalks.Web.csproj --urls "https://localhost:9999"

7. Access the Projects 🌐

πŸ› οΈ Technologies and Design Patterns

Frameworks πŸ”§

  • ASP.NET Core 8.0 Web API
  • ASP.NET Core 8.0 MVC
  • Entity Framework Core 8.0

Database πŸ›’

  • Microsoft SQL Server

Frontend Library πŸ“‘

  • jQuery
  • jQuery Validate
  • Bootstrap 5
  • Popper.js
  • Tippy.js
  • FontFace Observer

Architectural and Design Patterns πŸ“

  • Clean Architecture 🦾
  • Result Pattern
  • Database Code First Approach with Fluent API
  • Repository Pattern
  • Unit of Work (UoW)

πŸ“¦ Nuget Packages

Package Name Used to πŸ‘‡
Swashbuckle Generate API documentation from Web API controllers
ErrorOr Handle errors and return results efficiently
Serilog Log events in a very structured way
FluentValidation Apply server-side data validation rules
FluentEmail Send emails using SMTP servers
Google Apis Interact with cloud storage
RazorTemplating Render .cshtml files into string
DinkToPdf Generate beautiful PDFs from HTML
ClosedXML Generate Excel (.xlsx) files
WebOptimizer Bundle and minify CSS & JavaScript files for faster loading
WebMarkupMin Minify MVC HTML content to reduce file size for improved performance

πŸ“Š ER Diagram

TopicTalks Logo

πŸ“Έ Screenshots

View at πŸ‘‰ be.net/TopicTalks

πŸͺͺ License

Distributed under the BSD 3-Clause License. See LICENSE for more information.