Skip to content

TeamHypertrophy/Protein

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

165 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Protein - Rust Web API πŸ’š

forthebadge

Information πŸ“„

This is Protein, the Rust API that is used to Serve Hypertrophy, A Fully Featured Gym Mobile App.

Tech Stack 🍱

Postgres Redis DigitalOcean VS Code Insiders Rust Docker Git GitHub GitHub Actions

Prerequisites πŸ§‘β€πŸ’»

Building πŸ—οΈ

Docker 🐳

Building with docker is so simple!

  1. Create an docker.env file and follow .env.example to full out the variables.

  2. Run docker compose:

    $ docker compose up -d --build
  3. When Uptime Kuma and Prometheus are running, You will need to Create An API Key and enter it in prometheus/uptime_kuma.pwd, allowing them to communicate with each other.

Local πŸ‘·

  1. Install All Prerequisites

  2. Clone The Repo

    $ git clone https://github.com/TeamHypertrophy/Protein.git
  3. Create Local Database

    $ psql -U postgres
    postgres=# CREATE DATABASE your_local_db;
    postgres=# \c your_local_db
  4. Rename example.env -> .env and Fill Out Variables

    DATABASE_URL - PostgreSQL URI, usually postgresql://username:password@host:port/database_name
    POSTGRES_BACKUP_ENCRYPTION_KEY - Secret Key For Database Backups
    
    ROCKET_SENTRY_DSN - The Link To Where rocket-sentry can send panic!() logs to
    
    REDIS_URI - Redis URI, follows same schema as DATABASE_URL
    
    HOST_URL - API Base URL
    MASTER_API_KEY - API Key For Development Purposes
    PASSWORD_SALT - Unique Password Salt For User Authentication
    
    SMTP_USER - User That Will Be Displayed
    SMTP_USERNAME - Host Username Configured
    SMTP_PASSWORD - Host Password Configured
    SMTP_SERVER - SMTP Server
    
    DISCORD_WEBHOOK_URL - Discord Webhook For Audit Logging
    
    APP_ENV - development, production or staging
    
    GITHUB_TOKEN - Github Token For Releasing
  5. Install and Setup Diesel

     $ cargo install diesel_cli --no-default-features --features postgres
  6. Run Diesel Setup

    $ diesel setup
  7. Start Redis Server

    $ sudo service redis-server start
  8. Run Protein!

    $ protein
  9. Start Ngrok Server (Local Mobile Access)

    $ ngrok config add-authtoken YOURAUTHTOKEN
    $ ngrok http 8000
  10. Access The API at http://127.0.0.1:8000 or https://your-ngrok-instance.ngrok-free.app

Roadmap 🚚

  • Better Error Messages
  • Sync Layer
  • User Sessions
  • Meal Plans
  • Shared Workout Plans, Workouts and Custom Exercises
  • Trainer/Client Chat & Video Interactions
  • Workout & Workout Plan Templates
  • Sensor Support (Steps, Physical Activity)
  • Personalized Recommendations (AI/Formulas)
  • Internationalization (i18n) Support

Folders πŸ—ƒοΈ

β”œβ”€β”€.cargo β€” Cargo Configuration
β”œβ”€β”€.github β€” GitHub configuration including CI/CD workflows
β”œβ”€β”€.vscode β€” VSCode Related Settings and Extension Recommendations
β”œβ”€β”€assets β€” User Uploaded Assets
β”œβ”€β”€images - Images Relating to Protein
β”œβ”€β”€migrations β€” Database Migrations
β”œβ”€β”€prometheus β€” Prometheus Configuration
β”œβ”€β”€scripts β€” Utility Scripts
β”œβ”€β”€src β€” Source Code
β”œβ”€β”€templates β€” HTML Templates Used For Email

About

Rust Backend

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors