Skip to content

rafasilva9537/CollabStories

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📔 CollabStories

A web platform for real-time collaborative storytelling, built with ASP.NET Core Web API for the backend and React for the frontend.


✨ Features

  • Story Creation and Collaboration
    • Authors can create new stories and write together in real-time.
  • Story Participants
    • Each story session has a user owner who manages the session and authors who contribute to the story. The owner is always the first author.
  • Turn-Based Writing
    • Each author has a limited time per turn, and the next user continues writing after the turn ends.
    • Each session has it own timer validated on the backend.
  • Session Rules Management
    • Owners can define session parameters: duration, maximum authors, etc.
  • Authentication
    • Users can register and log in securely using JWT authentication.
  • Testing
    • The backend includes unit tests to validate individual components and integration tests to ensure end-to-end functionality.

📸 Media

Backend

Account Endpoints account-endpoints
Story Endpoints story-endpoints
Data Flow Diagram data-flow-diagram
Database Diagram database-diagram

Chat Demo (temporary)

Will be removed after frontend completion, this is just a prototype.

chat-demo-video.mp4

Frontend

Building ...


🛠 Setup

Prerequisites

Steps (Backend)

  1. Clone the repository.
  2. Inside backend/, copy .env.example to .env.
    • In .env, update the passwords for MSSQL_PASSWORD, MSSQL_CONNECTION_STRING and JWT_SECRET, if you want to change the default values.
  3. Open a terminal and navigate to the backend/ directory.
  4. Run the following command to initialize database inside container.
    docker compose up db --build
  5. Configure User Secrets (optional)
    • You may skip this step if API will be running only inside container and not locally.
    • Navigate to backend/api inside the terminal.
    • Set the required secrets using the following commands (you can change the password in the first three commands, just like in the .env file, seen in step 2):
      dotnet user-secrets set "ConnectionStrings:DefaultConnection" "Server=localhost,1434; Database=CollabStoriesDB; MultipleActiveResultSets=True;User ID=sa;Password='examplePassword1234'; Encrypt=False;"
      dotnet user-secrets set "ConnectionStrings:DbTestConnection" "Server=localhost,1434; Database=CollabStoriesDBTest; MultipleActiveResultSets=True;User ID=sa;Password='examplePassword1234'; Encrypt=False;"
      dotnet user-secrets set "JwtConfig:Secret" "a-string-secret-at-least-256-bits-long"
      dotnet user-secrets set "JwtConfig:ValidIssuer" "http://localhost:5014/"
      dotnet user-secrets set "JwtConfig:ValidAudiences" "http://localhost:5014/"
  6. Run the API:
    1. Using Docker
      • Navigate to the backend/ directory.
      • Run the docker command:
        docker compose up --build
        
      • ⚠️ Note: On the first run, the application will seed the database. Wait until you see the confirmation in the console before making API requests.
    2. Locally
      • In the backend/api/ directory.
      • Run the application:
        dotnet run
      • ⚠️ Note: On the first run, the application will seed the database. Wait until you see the confirmation in the console before making API requests.
  7. Access the API documentation:

⚙ Technologies

Backend

  • Language: C#
  • Framework: ASP.NET Core Web API 8
  • Database: SQL Server 2022
  • ORM: Entity Framework Core 8
  • Authentication: JWT with ASP.NET Identity
  • Real-time Communication: SignalR
  • Containerization: Docker
  • Testing: xUnit
  • Fake Data: Bogus
  • API Documentation: Swagger

Frontend

  • Languages: JavaScript, HTML, CSS
  • Frameworks: React, Vue
  • Real-time Communication: SignalR Client

🙋‍♂️ Authors

About

Web platform to write collaborative stories in real time

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published