This is Protein, the Rust API that is used to Serve Hypertrophy, A Fully Featured Gym Mobile App.
Building with docker is so simple!
-
Create an
docker.envfile and follow.env.exampleto full out the variables. -
Run
docker compose:$ docker compose up -d --build
-
When
Uptime KumaandPrometheusare running, You will need to Create An API Key and enter it inprometheus/uptime_kuma.pwd, allowing them to communicate with each other.
-
Install All Prerequisites
-
Clone The Repo
$ git clone https://github.com/TeamHypertrophy/Protein.git
-
Create Local Database
$ psql -U postgres postgres=# CREATE DATABASE your_local_db; postgres=# \c your_local_db
-
Rename
example.env->.envand Fill Out VariablesDATABASE_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
-
Install and Setup Diesel
$ cargo install diesel_cli --no-default-features --features postgres
-
Run Diesel Setup
$ diesel setup
-
Start Redis Server
$ sudo service redis-server start
-
Run Protein!
$ protein
-
Start Ngrok Server (Local Mobile Access)
$ ngrok config add-authtoken YOURAUTHTOKEN $ ngrok http 8000
-
Access The API at
http://127.0.0.1:8000orhttps://your-ngrok-instance.ngrok-free.app
- 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
βββ.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