Skip to content

nativeapptemplate/nativeapptemplateapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

142 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

NativeAppTemplate API

Mentioned in Awesome Rails

A Rails 8.1 API backend for NativeAppTemplate iOS/Android mobile applications. It's a multi-tenant SaaS application with token-based authentication, role-based authorization, and RESTful API endpoints.

Extracted from the Rails API backend for MyTurnTag Creator for iOS and MyTurnTag Creator for Android.

For more information, visit nativeapptemplate.com.

API Documentation

API Documentation

Features

Included Features

  • Sign Up / Sign In / Sign Out
  • Email Confirmation
  • Forgot Password
  • CRUD Operations for Shops (Create/Read/Update/Delete)
  • CRUD Operations for Shops' Nested Resource, Number Tags (ItemTags) (Create/Read/Update/Delete)
  • URL Path-Based Multitenancy (prepends /:account_id/ to URLs)
  • User Invitation to Organizations
  • Role-Based Permissions and Access Control
  • Organization Switching UI
  • Admin Panel
  • Force App Version Update
  • Force Privacy Policy Version Update
  • Force Terms of Use Version Update
  • And more!

Related Repositories

Paid Clients

Free Clients

Requirements

You'll need the following installed to run the template successfully:

  • Ruby 4.0.2+
  • PostgreSQL 16+
  • Libvips - brew install vips
  • Overmind - brew install tmux overmind - helps run all your processes in development

If you use Homebrew, dependencies are listed in Brewfile so you can install them using:

brew bundle install --no-upgrade

Then you can start the database servers:

brew services start postgresql

Initial Setup

First, edit config/database.yml and change the database credentials for your server.

Run bin/setup to install Ruby and JavaScript dependencies and setup your database and seed initial data to the database.

bin/setup

Running NativeAppTemplate API on your Wi-Fi

Copy .env.sample to .env and set HOST to your current Wi-Fi IP. On macOS: ipconfig getifaddr en0. bin/dev binds Rails to that address so the dev server is reachable from both the host browser and from any phone on the same network at http://<wifi-ip>:3000. When your Wi-Fi IP changes, update HOST here and the matching NATEMPLATE_API_DOMAIN in the mobile apps (Xcode scheme for iOS, ~/.gradle/gradle.properties for Android) — Rails fails loudly if HOST is unset, which keeps the three sides honest. Never use 127.0.0.1, localhost, or 0.0.0.0.

To run your application, you'll use the bin/dev command:

bin/dev

This starts up Overmind running the processes defined in Procfile.dev. We've configured this to run the Rails server out of the box.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines on reporting issues, proposing changes, and submitting pull requests.

This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.

Security

If you discover a security vulnerability, please follow the disclosure process in SECURITY.md. Do not open public issues for security concerns.

License

This project is licensed under the MIT License — see LICENSE for details.