mu

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

README

mu

A muslim app platform

Overview

Mu is an app platform that provides a simple set of building blocks for life. It was born out of a frustration with existing services. Most tech platforms create addictive behaviours through their algorithms. The intention is to create a separate system that fixes this.

Apps

The current list of apps:

  • Chat - General knowledge AI Q&A
  • News - Hadiths, headlines and crypto
  • Pray - Prayer times by location
  • Reminder - Read the Quran in English
  • Watch - Search for YouTube videos

Dependencies

  • Go toolchain

Usage

Download source

go install github.com/asim/mu/cmd/mu@latest

Run it

mu

Then go to http://localhost:8080

Admin

A basic user admin on /admin displays the users. It requires USER_ADMIN to be set to the user who can view it

export USER_ADMIN=asim

Goto localhost:8080

APIs

Set OPENAI_API_KEY from openai.com for ability to chat with AI

export OPENAI_API_KEY=xxx

Set SUNNAH_API_KEY from sunnah.com for daily hadith in news app

export SUNNAH_API_KEY=xxx

Set CRYPTO_API_KEY from cryptocompare.com for crypto market tickers

export CRYPTO_API_KEY=xxx

Set YOUTUBE_API_KEY from Google Cloud for YouTube data

export YOUTUBE_API_KEY

PWA

Mu operates as a progressive web app. The main app can be installed just like a native app.

Caching and offline mode is still a WIP.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cache string

the file cache

View Source
var Home string

user home dir

the secret key

Functions

func Backoff

func Backoff(attempts int) time.Duration

Backoff is for exponential backoff

func Decrypt

func Decrypt(text string) string

Decrypt text using AES-256 and secret key

func Encrypt

func Encrypt(text string) string

Encrypt text using AES-256 and secret key

func ID

func ID() string

ID generates a new uuid

func Load

func Load(data interface{}, file string, decrypt bool) error

Load data from cache

func Render

func Render(w http.ResponseWriter, tmpl string) error

Render the template

func Save

func Save(data interface{}, file string, encrypt bool) error

Save data to the cache

func Serve

func Serve(port int) error

func Template

func Template(name, desc, nav, content string) string

The standard HTML template

Types

This section is empty.

Directories

Path Synopsis
cmd
mu
Package user is for authentication
Package user is for authentication

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL