Giter Club home page Giter Club logo

wechat-yoga-miniprogram's Introduction

瑜伽约课微信小程序

一个使用 Rust 开发的,用于瑜伽约课的微信小程序。

该程序,包括后端服务器、数据库、浏览器管理员前端、微信小程序,再加上相关的架设和配置,有一定的复杂性。但同时也是一个训练开发能力的很好的项目。

除一些敏感信息外,已公开包括数据库的所有代码。

开发环境

  • 微信开发工具
  • Rust 语言
  • PostgreSQL 数据库

微信小程序截图

课程表

本地运行

  1. 安装 PostgreSQL
  2. 安装 Rust
  3. 安装 微信开发者工具(稳定版 Stable Build)

后端

Windows 系统 PowerShell 终端可使用如下命令启动后端服务器:

# 使用恰当的参数替换中文描述的内容
$ENV:DATA_SOURCE_NAME="host=数据库公网IP port=数据库侦听端口 user=数据库用户名 password=数据库密码 dbname=数据库名称 sslmode=disable";$ENV:AUTH_URL="https://api.weixin.qq.com/sns/jscode2session?appid=小程序Id&secret=小程序密钥&grant_type=authorization_code&js_code=";$ENV:SECRET="长度32的字符串"; go run main.go

PowerShell 命令行

在开发中用到的,一些简化文件操作的 PowerShell 命令。

将当前目录切换为 Rust 模块所在的目录,然后创建单独的 Rust 源代码文件,最后获取该目录下的所有 Rust 源代码文件,进行过滤后,将其全部写入 mod.rs,以便在其他位置的代码可以使用该模块内的所有代码
$dir="C:\Users\Administrator\Desktop\file\yg\server\src";$name="models";$filename="settings.rs";Set-Location $dir;New-Item -Type "directory" $name;Set-Location $name; New-Item mod.rs;New-Item $filename;Get-ChildItem | Where-Object {$_.Name -ne "mod.rs"} | Split-Path -LeafBase | Join-String -FormatString "pub mod {0};`r`n" | Set-Content -Path .\mod.rs;` 

用于创建微信小程序页面文件夹,和其包含的 4 个同名文件
$name="adminLesson";$dir="C:\Users\Administrator\Desktop\file\yg\miniprogram\pages";Set-Location $dir;New-Item -Type "directory" $name;Set-Location $name;New-Item $name".js";New-Item $name".wxml";New-Item $name".wxss";New-Item $name".json";

wechat-yoga-miniprogram's People

Contributors

grandiloquent 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.