2024-01-25 16:57:38 +01:00
2024-01-25 16:47:06 +01:00
2024-01-25 16:47:06 +01:00
2024-01-03 18:05:56 +01:00
2024-01-25 16:47:06 +01:00
2024-01-25 16:47:06 +01:00
2024-01-03 18:05:56 +01:00
2024-01-25 16:47:06 +01:00
2024-01-25 16:47:06 +01:00
2024-01-25 16:57:38 +01:00
2024-01-25 16:47:06 +01:00

Forum Backend

Backend for the forum project. This project is under development and is not ready for production.

License: MIT

Table of Contents

About

This is the backend for a forum you can self host. It is written in NodeJS and uses the Surrealdb database. It is a REST API that uses JSON for communication. It is uses the Express framework. Further it uses the following packages:

  • auth-guardian: "^1.1.1",
  • cookie-parser: "^1.4.6",
  • cors": "2.8.5",
  • dotenv: "^16.3.1",
  • express: "^4.18.2",
  • jsonwebtoken: "^9.0.2",
  • surrealdb.node: "^0.3.0"

The frontend will be written in NextJS and will be a seperate repository. This project is under development and is not ready for production.

Features

  • User authentication
  • User registration
  • User login
  • User logout
  • User profile
  • User profile update
  • User profile delete
  • Create post
  • Like post
  • Comment on post
  • Save post
  • Comment on comment
  • Like comment
  • Save comment
  • Search posts
  • Search users
  • Trending posts
  • Most active users
  • Most liked posts
  • Most commented posts
  • Most saved posts

Installation

Prerequisites

NodeJS and NPM are required to run this project. You can download them here.

Clone

Clone this repository to your local machine using

git clone https://gitea.quiztimes.nl/kajvans/forum-backend.git

Setup

Edit .env.example and rename it to .env. Fill in the required information.

Install dependencies

Install the required dependencies using

npm install

Running

Run the project using

npm start

Routes

Method Path
GET /logout
GET /register/password
POST /register/
POST /login/
GET /user/:username
PUT /user/description
PUT /user/password
PUT /user/username
PUT /user/visibility
GET /user/description/:username
GET /user/visibility
GET /user/activity/:type
DELETE /user/delete
POST /create/
DELETE /create/:id
GET /post/:id
POST /post/like/:postId
POST /post/comment/:postId
POST /post/comment/:postId/:commentId
POST /post/like/:postId/:commentId
POST /post/save/:postId
POST /post/save/:postId/:commentId
POST /search/:search
GET /home/
GET /home/trending
GET /home/mostLiked
GET /home/mostCommented
GET /home/mostSaved

License

This project is licensed under the MIT License - see the LICENSE file for details.

Creators

  • kaj van schalkwijk
  • ruben jimmink

Contact

S
Description
opdracht voor school
Readme 196 KiB
Languages
JavaScript 100%