Giter Club home page Giter Club logo

forustm's Introduction

Forustm

Forustm is a forum written in Rust.

External Dependencies

Now, we use postgresql as main db, to store all things, and use redis to store user login session key.

  • Redis, version > 2
  • Postgresql, version > 9

Structure

This forum is developed by Sapper, which is a rapid web developing framework (which is based on syncronized hyper v0.10.26 now, but later will update to latest async/await branch).

Although it is not well documented now, it ran as a community forum for three years (wow :) )

But I will surely supply more documentations on it, in fact I am waiting the release of async-std and correspoding hyper branch version, or other http server crate version.

Features

  • Section CRUD
  • Article CRUD
  • User blog
  • User blog planet
  • I18n
  • Fulltext searching based on tantivy (but now commented, need to update to latest tantivy version)
  • User system oauthed by github.com (this is the only user system currently, we don't supply opening registration)
  • Tera rendering engine
  • Markdown text support for article content and comment content
  • Rss subscribing

We write this project for:

  1. Making a forum for rust community (must use rust to implement it)
  2. Giving a practical example for sapper project
  3. Keeping code clean and easy to learn

Db Operation

You will find ./schema/schema.sql, you need use pg client, such as psql, to make a new empty db in postgresql before bootuping forustm bin.

  1. use psql to connect to pg: psql
  2. create an new db: create database foobar;
  3. connect this new db: \c foobar;
  4. import sql file: \i {project_path}/schema/schema.sql;

That's all operations on db.

Configuration

You need an .env file in your project directory, whose content as like bellow:

DBURL=postgres://postgres:pwd@localhost/forustm
REDISURL=redis://127.0.0.1/0
BINDADDR=127.0.0.1
BINDPORT=8081
RUSODA_LANG=en
#HOST_DOMAIN=https://rust.cc
#HOST_DOMAIN=http://127.0.0.1:8080
NUMBER_ARTICLE_PER_PAGE=20
NUMBER_COMMENT_PER_PAGE=20
CACHE=0
GITHUB_APP_CLIENT_ID=xxxx
GITHUB_APP_CLIENT_SECRET=xxxxxx

Bootup

cargo build
cargo run --bin page_forum_bin

and you will see a boot up server which is bounded to the port you configured just now.

Operating

And then, you can operate everything in the browser.

  • You can go to http://127.0.0.1:{port}/login_with_admin, and account: [email protected], password: admin to initialize the bootup content of this site.
  • go http://127.0.0.1:{port}/admin_secion to create sections, manage section orders, manage the top articles in one section, etc

Scripts

You can use ./scripts/create_test_user.sh to create some test user to login in browser.

The parameters in this script file could be modified by your need.

Good Lucky

This is not a detailed documentation, so, forgive me, will do more on it.

Future Plan

Rust community should own its own full-featured forum application, the long aim of this project, is to replace the officail Rust users forum keeped by Rust officail team.

Referrences

forustm's People

Contributors

miketang84 avatar tarvos21 avatar

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.