Skip to content

platfone-com/temp-number-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Temp Number Backend

A Node.js backend application built with AdonisJS that provides API endpoints for web and mobile applications to manage temporary phone numbers for SMS verification. It includes user authentication, payment processing, and integration with Platfone Retail API.

Features

  • πŸ” Authentication with Firebase
  • πŸ“± Temporary phone number management
  • πŸ’³ Payment processing (Stripe, Apple Pay, Google Pay and more...)
  • πŸ”” Push notifications
  • 🌐 RESTful API
  • πŸ“Š Database migrations with Lucid ORM

Tech Stack

  • Framework: AdonisJS
  • Language: TypeScript
  • Database: MySQL (via Lucid ORM)
  • Authentication: Firebase Auth
  • Payment: Stripe API, In-App Purchase verification and more...
  • Notifications: Firebase Cloud Messaging and SMTP

Prerequisites

  • Node.js >= 22.x
  • MySQL >= 8.0
  • npm or yarn

Getting Started

πŸš€ Recommended: Automated Deployment

The easiest way to get started is using our temp-number-deploy repository, which provides automated deployment scripts for the complete stack (MySQL, Backend, Web UI):

  • Production: Google Cloud deployment with automated setup
  • Local Development: Docker Compose environment with one command

πŸ‘‰ Go to temp-number-deploy β†’

Manual Installation

For manual setup or custom configurations:

# Clone the repository
git clone https://github.com/platfone-com/temp-number-backend.git
cd temp-number-backend

# Install dependencies
npm install

# Copy environment variables
cp .env.example .env

# Configure your .env file with required credentials

Environment Variables

Key environment variables to configure:

NODE_ENV=development
PORT=3333
HOST=0.0.0.0

# Database
DB_HOST=localhost
DB_PORT=3306
DB_USER=temp_number_user
DB_PASSWORD=temp_number_password
DB_DATABASE=temp_number

# Firebase
GOOGLE_APPLICATION_CREDENTIALS=/path/to/firebase-service-account.json

# Platfone Retail API
PLATFONE_API_URL=https://get_url_from_platfone_dashboard.com
PLATFONE_API_KEY=your_api_key

Database Setup

# Run migrations
node ace migration:run

Running the Application

# Development mode
npm run dev

# Production mode
npm run build
npm start

The server will start at http://localhost:3333

Project Structure

β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ controllers/     # Request handlers
β”‚   β”œβ”€β”€ models/          # Database models
β”‚   β”œβ”€β”€ services/        # Business logic
β”‚   β”œβ”€β”€ middleware/      # Custom middleware
β”‚   └── helpers/         # Utility functions
β”œβ”€β”€ config/              # Configuration files
β”œβ”€β”€ database/
β”‚   └── migrations/      # Database migrations
β”œβ”€β”€ start/               # Application bootstrap
β”‚   β”œβ”€β”€ routes.ts        # Route definitions
β”‚   └── kernel.ts        # Middleware registration
└── tests/               # Test files

API Documentation

Full API documentation available at platfone.com/docs

Development

Code Style

This project uses ESLint for code quality. Run linting:

npm run lint

Testing

# Run all tests
npm test

# Run with coverage
npm run test:coverage

Deployment

This application is designed to be containerized. A Dockerfile is included for easy deployment.

# Build Docker image
docker build -t temp-number-backend .

# Run container
docker run -p 3333:3333 --env-file .env temp-number-backend

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

Security

For security concerns, please see SECURITY.md.

License

This project is licensed under the MIT License with API Restriction Clause - see the LICENSE file for details.

Support

Acknowledgments

Built with ❀️ by the Platfone team

About

Temp-number backend for retail SMS activation apps

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages