All Projects → bashmohandes → go-askme

bashmohandes / go-askme

Licence: MIT license
My GoLang learning journey by building an AskFm clone

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
CSS
56736 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to go-askme

Stator
Stator, your go-to template for the perfect stack. 😍🙏
Stars: ✭ 217 (+126.04%)
Mutual labels:  project
Learn X By Doing Y
🛠️ Learn a technology X by doing a project - Search engine of project-based learning
Stars: ✭ 242 (+152.08%)
Mutual labels:  project
todo-cli
✅ Command-line tool to manage Todo lists
Stars: ✭ 88 (-8.33%)
Mutual labels:  project
Masterplan
MasterPlan is a project management software / visual idea board software. It attempts to be easy to use, lightweight, and fun.
Stars: ✭ 221 (+130.21%)
Mutual labels:  project
Generate
A new command line tool and developer framework for scaffolding out GitHub projects. Generate offers the robustness and configurability of Yeoman, the expressiveness and simplicity of Slush, and more powerful flow control and composability than either.
Stars: ✭ 238 (+147.92%)
Mutual labels:  project
project-structure-sample
Shows how to keep front end and back end separated
Stars: ✭ 91 (-5.21%)
Mutual labels:  project
Pollinate
Template your base files and generate new projects from Git(Hub).
Stars: ✭ 213 (+121.88%)
Mutual labels:  project
tmpo
Command line interface to create new workspaces based on templates
Stars: ✭ 25 (-73.96%)
Mutual labels:  project
Eshop
Eshop + Content Management System (CMS) written in Node.js / Total.js.
Stars: ✭ 243 (+153.13%)
Mutual labels:  project
quickstartup-template
Django Boilerplate Template for SaaS applications
Stars: ✭ 44 (-54.17%)
Mutual labels:  project
Forge
F# CLI tool for project, file, and solution management
Stars: ✭ 233 (+142.71%)
Mutual labels:  project
Goapp
An opinionated guideline to structure & develop a Go web application/service
Stars: ✭ 238 (+147.92%)
Mutual labels:  project
jira-project-export
Export issues and metadata for a single JIRA project as JSON.
Stars: ✭ 18 (-81.25%)
Mutual labels:  project
Javascript Total
Сборник практических вопросов, задач разного уровня сложности, сниппетов (утилит), паттерны проектирования, а также полезные ссылки по JavaScript
Stars: ✭ 214 (+122.92%)
Mutual labels:  project
emptyproject-flow
Empty project: Flow
Stars: ✭ 77 (-19.79%)
Mutual labels:  project
Curiosity
Find Amazing Github Projects ⚡️
Stars: ✭ 216 (+125%)
Mutual labels:  project
Todokit
TodoKit - A beautiful bug and issue tracking software.
Stars: ✭ 253 (+163.54%)
Mutual labels:  project
todo.link
基于项目的任务管理系统
Stars: ✭ 90 (-6.25%)
Mutual labels:  project
SnowTrail
No description or website provided.
Stars: ✭ 22 (-77.08%)
Mutual labels:  project
examrank-02-03-04-05-06
exam project 2020
Stars: ✭ 195 (+103.13%)
Mutual labels:  project

Go-ASKME Build Status

This GitHub repo has my attempt to build a web application in Go without any Web Frameworks

Introduction

The idea is a Q/A website where users can send questions to a user they follow, the user may choose to answer all or some of these questions, the answers are public to everyone.

This is not meant to be a production ready product at least initially, it is meant as an educational vehicle to learn good design principals, Go language, as well as other DevOps toolchain like Docker, Kubernetes, ...etc.

Design Goals

The code base follows Uncle Bob's Clean Architecture principals, where the code is broken down to

  1. Entities (model folder)
  2. Components
    1. Questions
    2. Answers
    3. Users
  3. Use Cases
  4. Shared

Entities

The main domain models, which in our case so far Question, Answer, User as well as base entity types and helpers, and basic domain operations on domain models using the domain ubiquitous language, like Ask, Answer, Like ... etc

Components

Each component consists of all the basic layers needed to complete this component from top to bottom, like Use Cases, Repositories, Tests

Framework

This is shaping up to be a tiny MVC framework, interesting

Dependencies

This is not meant to depend on any fat frameworks, especially web frameworks, although a couple of things were used to tie things together.

  1. Uber's dig Dependency Injection framework
  2. Buffalo's box asset management
  3. Google's UUID package
  4. joho/godotenv godotenv
  5. gorm
  6. Okta Jwt Verifier

Build and Run

  • Install Go
  • Make sure your GOPATH environment variable is set correctly
  • Clone the project in any directory outside of your $GOPATH location, this will ensure go modules work as expected, and all dependencies will be downloaded on first run
  • (Optional) Install Docker
  • Clone the repo on your machine
  • Create a new .env file using the .env.dist as a template
    • Fill in the missing secrets suitable for your environment
    • Never check in the .env file, it is already included in .gitignore, and never add actual secrets in .env.dist
  • There are two authentications methods supported
    • Basic Username / Password Auth
      • if you want to use this mode, make sure that AuthController is used in the ask.go instead of OktaController
    • Okta based auth
      • You will need to sign up for Okta developer account, more information on setting up mentioned below
  • From root of the repo on your terminal run the following command
    docker-compose -f docker-local.yml up
    
    go run main.go
  • (Optional) if you prefer Docker, run the following commands
    docker build -t go-askme .
    
    docker run --env-file=.env --rm -p 8080:8080 go-askme
  • (Optional) Use docker compose
    docker-compose build
    
    docker-compose up

Then from a browser window, navigate to http://localhost:8080

Setting up Okta Developer Account

For more up to date information make sure to read through Okta developer docs

  1. Sign up for a new Okta developer account
  2. Create a new Application
    1. Choose Web as an application type
  3. Add a login redirect URI
    1. For local development add http://localhost:8080/authorization-code/callback
  4. Add a logout redirect URI
    1. For local development add http://localhost:8080
  5. Accept other defaults, then Save
  6. Copy generated ClientID, Client Secret, and set them to corresponding OKTA_CLIENT_ID, OKTA_CLIENT_SECRET in your .env file
  7. Navigate to API > Authorization Servers
    1. Copy the default Authorization Server, and set it to OKTA_ISSUER in your .env file
    2. Click on the Trusted Origins tab
      1. Add a new origin, for local development add http://localhost:8080 as both a Redirect & CORS
  8. To enable Registration, navigate to Users > Registration
    1. Click on Enable Registration, fill in the details you need
    2. Make sure to set the Default redirect to http://localhost:8080

Want to Contribute?

All contributions are welcomed, check here for details

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].