Code Monkey home page Code Monkey logo

top-forum-backend's Introduction

CircleCI


Logo

TOP-FORUM.ONLINE BACK-END

Back-end of web forum application.

View Demo · Report Bug · Report Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Contributing
  4. License
  5. Contact

About The Project

The back-end of an application that enables users to exchange information, viewpoints, experiences, and opinions on a wide range of topics.

Third-party libraries used in project

(back to top)

Getting Started

These are the instructions for setting up the project locally. To get a local copy up and running, follow these simple example steps.

Prerequisites

Installation

Setup Application

1. Clone this repository to your local machine

$ git clone https://github.com/swawozny/top-forum-backend

2. Install backend packages via npm

$ cd top-forum-backend
$ npm install

3. Create .env file

$ touch .env

4. Sign up for the following services

  • Mailtrap:create a virtual mailbox for sending emails.

5. Store environment variables in .env file then save

#SERVER DATA
APP_HOST=SKIP
PORT=SKIP

#POSTGRESQL DATA
TEST_DB=SKIP
DEV_DB=SKIP
DB_USERNAME=SKIP
DB_PASSWORD=SKIP
DB_PORT=SKIP
DB_HOST=SKIP

#MAILTRAP DATA
MAIL_HOST=SKIP
MAIL_PORT=SKIP
MAIL_USER=SKIP
MAIL_PASSWORD=SKIP
MAIL_DEFAULT=SKIP

#JWT DATA
JWT_PRIVATE_KEY=SKIP
JWT_EXPIRATION=SKIP

6. Create database, Run migration, Add Seeder

$ npx sequelize db:create
$ npx sequelize db:migrate
$ npx sequelize db:seed:all

7. Run server

$ npm start

Server is now available under http://localhost:PORT, where PORT is the same as you define in .env file.

(back to top)

Contributing

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Sebastian Wąwoźny - [email protected]

Project Link: https://github.com/swawozny/top-forum-backend

(back to top)

top-forum-backend's People

Contributors

swawozny avatar

Watchers

 avatar

top-forum-backend's Issues

Add topic model

Each forum can have topics, and the topic model should include the following attributes:

  1. Title
  2. Timestamps
  3. Author's ID who created the topic
  4. Forum ID

Add forum model

There should be a forum model that includes the following attributes:

  1. Title
  2. Description
  3. User ID of the forum creator
  4. Timestamps
  5. Parent forum ID (which can be null; in that case, it is considered the main forum).
    This model is designed to accommodate both main forums and subforums.

Add post model

Each topic can have posts, and the post model should encompass the following attributes:

  1. Author's ID
  2. Topic ID in which it was created
  3. Timestamps
  4. Content

Add topics routes

GET topic/id - should return all posts in topic, each post should have all author data

Add forums routes

There should be the following endpoints:

  1. GET /forums - It should return all main forums (where parentForumId is null) and their first level subforums with descriptions.
  2. GET /forum:id - It should return all subforums that have parentForumId equal to id and all topics that have forumId equal to id.
  3. POST /forum - It should create a new forum (a main forum if parentForumId is null in the request, or a subforum otherwise).
  4. DELETE /forum:id - It deletes the forum with id (and all its subforums, topics, and posts).
  5. UPDATE /forum:id - It updates the forum (can update the title, description, or parentForumId).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.