/v2cs

A tiny and user-friendly fourm.

Primary LanguagePython

V2CS

Description:

V2CS is a tiny and user-friendly fourm.

To get start on development mode, You need to:

  1. Install redis by following the link: https://redis.io/docs/getting-started/installation/
  2. Start redis on its default port, or configure the port to which v2cs will connect with app.config['SESSION_REDIS'] = address:port in app.py
  3. Register at mailgun, create SMTP account, and save SMTP username and password
  4. Export mail username and password as environment variable:
    $ export MAIL_USERNAME=xxx@xxxx.ltd
    $ export MAIL_PASSWORD=xxxxxxxxxx
  5. To run the program locally with out TLS, you must set:
    $ export DEV_MODE=on
  6. Use
    $ pip3 install -r requirements.txt
    to install requirements
  7. Use
    $ flask run
    to run.

The default database v2cs.db has 6 users, and all their passwords are adminadmin, just for test. They are:

UID username email
1 admin admin@example.com
2 malan malan@harvard.edu
3 brian brian@cs.harvard.edu
4 jack jack@example.com
5 jerry jerry@example.com
6 jitewaboh jitewaboh@lagify.com

Open http://127.0.0.1:5000, and you can see the page.

User registration

  1. Click on the button Sign up, type in your email address, and click submit.
  2. Open the link sent to your mail box (check spam), and fill in username, password to finish your registration.
  3. After your registration, you will be automatically logged in

Compose a post

  1. Post must has a title, but content is not neccessary.
  2. Post content support markdown, UTF-8 and even code highlight.
  3. To make sure you didn’t mess up the layout, you must preview it before post it when the content is not empty.
  4. Click submit, and your post is submitted!

Leave a comment

  1. Comments support markdown as well.
  2. Latest comments are always on the top.
  3. Click submit and your comment is submitted.

Nodes

  1. Every node has a color attached to it. (Inspired by Discourse)
  2. Admins can add or edit nodes.
  3. Every node has a unique id and a unique node name, node id is used for foreign key, and node name is used for url so lowercased letters are recommended, while node display name can be actually UTF-8 characters.

User profile

  1. You can view the posts posted by the user, comments commented by the user, and more awesome information on user profile page.
  2. Times (Joined at XXXX) are shown in your timezone and the format habit in your country set in the browser.
  3. Avatar is provided by Gravatar.

Settings

  1. You can easily change your username, email, and password in settings, just in few clicks.
  2. If anything goes wrong, a prompt will give you some advice.

Admin

  1. Admins can update the meta data of the posts, update nodes, and add new nodes.
  2. However, for security, we don’t allow them to edit or update user info.

Latest, Hot, NSFW

  1. Latest is a posts table sorted by the last activity.
  2. Hot is a posts table sorted by comments number and in 24h.
  3. NSFW is a table of posts tagged as NSFW, either by user or admins.

More features, just run and try!

!!! Although I have tried my best, never use this for production unless you have analyzed the whole project for security!!!