Skip to content
/ WSSOVA Public

Web service interface to the Stack Overflow Viewer Application

Notifications You must be signed in to change notification settings

cris391/WSSOVA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StackOverflow Service

This project is a full-stack application as a service with data built on top of - StackOverflow. This includes functionality like searching through Posts & Marking specific posts to save for later retrieval. After sucessfull authentication, the search history will also be stored in the app.

  • The app is a Single Page App, built using pure js, jquery and knockout js framework, with Bootstrap.

  • All the data is served from our C# .Net backend. With custom fast search built on pure SQL queries and with inverted indexes...

Setup the Database

On Windows

  1. Install PostgreSQL
  2. Open Terminal to create database and execute & 'C:\Program Files\PostgreSQL\12\bin\psql.exe' -U postgres -c "create database stackoverflow"
  3. Go to WSSOVA/DatabaseService/DataModels
  4. Load database and data you downloaded by running & 'C:\Program Files\PostgreSQL\12\bin\psql.exe' -U postgres -d stackoverflow -f stackoverflow_universal.backup
  5. Scaffold normalized schema. Go to project location DatabaseService > DatabaseModels and run in the Terminal & 'C:\Program Files\PostgreSQL\12\bin\psql.exe' -U postgres -d stackoverflow -a -f stackoverflow-normalized.sql
  6. Scaffold functions, indexes, weights etc.(this will take around 1 minute) by running & 'C:\Program Files\PostgreSQL\12\bin\psql.exe' -U postgres -d stackoverflow -a -f functions-indexes-weights.sql

Setup the Client

  1. go to /WebApi/wwwroot
  2. install libman dotnet tool install -g Microsoft.Web.LibraryManager.Cli
  3. execute command libman restore (installs required dependencies)

Web Service

  1. go to the WebApi folder in your Terminal
  2. run dotnet run
  3. or dotnet watch run --no-build (development)

API Usage

Questions endpoints

GET /api/questions GET /api/questions/{questionId}

Answers endpoints

GET /api/answers/{answerId} GET /api/answers/question/{answerId}

Markings endpoints

GET /api/markings/{userId} POST /api/markings HEADERS userId BODY {"postid": 16637748} DELETE /api/markings/{markingId}

Annotations endpoints

GET /api/annotations/{markingid} GET /api/annotations HEADERS userId GET /api/annotations BODY {"markingid": 1} POST /api/annotations BODY {"markingid": 1, "body": "api"} PUT /api/annotations/{annotationId} BODY {"markingid": 1, "body": "api2"} DELETE /api/annotations/{annotationId}

Comments endpoints

GET /api/comments/{postId}

Tags endpoints

GET /api/tags/{questionId}

Posts endpoints

GET /api/posts/{questionId}

Search endpoints

GET /api/search?q=term+term GET /api/search/history HEADERS userId

Auth endpoints

POST /api/auth/users BODY {"username", "password"} POST /api/auth/tokens BODY {"username", "password"}

Users endpoints

POST /api/users BODY {"username", "password"}

About

Web service interface to the Stack Overflow Viewer Application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published