Code Monkey home page Code Monkey logo

godiscourse's Introduction

GoDiscourse

GoDiscourse is a 100% open source, discourse-like forum written in Go. For demo, please visit https://live.godiscourse.com/. For feedback, you can submit issues or join our slack(https://bit.ly/2IV6LCW), Let's learn Go together!

Built With

  1. Go version go1.12.1 darwin/amd64
  2. postgres (PostgreSQL) 11.1
  3. react ^16.8.4

Features

  1. REST API back-end written in Golang
  2. React-based frontend
  3. PostgreSQL, one of the best open source, flexible database
  4. Social login (OAuth 2.0) only support Github now
  5. JSON Web Tokens (JWT) are used for user authentication in the API
  6. Markdown supported topic and comment
  7. Model tested

Structure

  1. ./ is back-end service, we followed golang-standards project-layout.
  2. ./web is front-end service, contains React, Parcel and etc.
  3. ./deploy contains example of deploy, nginx and systemd.

Screenshot

Go Discourse

Getting Started

Backend

  1. Set the following environment variables on your system:
export GODISCOURSE_URL=http://localhost
export GODISCOURSE_PORT=4000
export DB_USER=db user
export DB_PASSWORD=db pass
export DB_HOST=localhost
export DB_NAME=godiscourse_dev
export DB_PORT=5432
export ENV=test|development|production
  1. cd ./internal, copy config/example.cfg to config/config.go. Replace config with yours.
  2. Prepare and start database, the database schema under ./internal/models/schema.sql, how to install postgresql.
  3. cd ./ && make install && make build && ./bin/godiscourse to start Golang server

Frontend

  1. cd ./web, copy .env.example to .env and .env.development and change the following fields:

    SITE_NAME=your site name
    API_HOST=http://localhost:4000 or production url
    GITHUB_CLIENT_ID=put your client id
    
  2. run npm install to prepare front-end.

  3. npm run dev and open http://localhost:1234

Docker

  1. go to godiscourse folder
  2. type docker-compose up

License

https://opensource.org/licenses/MIT

godiscourse's People

Contributors

jadeydi avatar guohuang 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.