Version: 1.0.0
Last Updated: September 1, 2024
- Introduction
- Prerequisites
- Installation
- Configuration
- Project Structure
- Makefile Commands
- Key Features
- Customization
- Third-Party Services Setup
- Security Considerations
- Support and Troubleshooting
- License
- Contributing
- Changelog
- Acknowledgments
Welcome to the Technosaas Boilerplate documentation. This boilerplate is designed to accelerate the development of small SaaS applications and side projects for developers and solopreneurs. It provides a robust starting point with pre-configured integrations and features, allowing you to focus on building your application's core functionality.
Key Highlights:
- Built with Laravel and React using Inertia.js
- Integrated Tailwind CSS and Material UI (MUI) for rapid UI development
- Ready-to-use authentication and OAuth setup with Laravel Breeze
- Stripe integration for seamless payment processing
- Docker support for easy environment setup and deployment
- Responsive design with dark and light mode support
- SEO optimization through customizable head templates
Before setting up the Technosaas Boilerplate, ensure that your system meets the following requirements:
- PHP: Version 8.2 or higher
- Node.js: Latest stable version
- Composer: Latest stable version
- Docker: Installed and running (for Docker installation method)
- Laravel Herd: Installed (for Laravel Herd installation method)
There are three methods to set up the Technosaas Boilerplate:
Choose the method that best fits your development environment and preferences.
git clone https://github.com/yourusername/technosaas-boilerplate.git
cd technosaas-boilerplate
Install PHP Dependencies:
composer install
Install Node.js Dependencies:
npm install
- Create a copy of the example environment file:
cp .env.example .env
- Update the
.env
file with your specific configuration details (database credentials, API keys, etc.).
php artisan key:generate
php artisan migrate
php artisan serve
Start Frontend Development Server:
npm run dev
Your application should now be running at http://localhost:8000
.
The Makefile provided with TechnoSaas simplifies the setup and deployment process on a server. This is ideal for setting up your project in a production environment.
After purchasing, download the .zip file and extract it to your server.
Use the provided Makefile to automate the setup process.
Run the Full Setup:
make all
This command will guide you through setting up your environment, creating SSL certificates with Cloudflare and Certbot, configuring Nginx, and setting up your GitHub repository.
Alternatively, You Can Run Each Step Individually:
- Set up Configuration:
make setup
- Create GitHub Repository and Cloudflare CNAME:
make create_repo
- Create SSL Certificate:
make create_ssl
- Create Nginx Configuration:
make create_nginx
After running the setup scripts, your application will be accessible at the domain you configured in the setup.
Install Laravel Herd by following the official documentation: Laravel Herd Installation Guide
git clone https://github.com/yourusername/technosaas-boilerplate.git
cd technosaas-boilerplate
Install PHP Dependencies:
composer install
Install Node.js Dependencies:
npm install
- Create a copy of the example environment file:
cp .env.example .env
- Update the
.env
file with your specific configuration details.
php artisan key:generate
php artisan migrate
Laravel Herd will automatically serve your application. Access it via the URL provided by Herd, typically http://technosaas-boilerplate.test
.
The application uses a .env
file to manage configuration settings. After copying .env.example
to .env
, update the following variables:
APP_NAME=Technosaas
APP_ENV=local
APP_KEY=base64:...
APP_DEBUG=true
APP_URL=http://localhost
DB_CONNECTION=sqlite
DB_DATABASE=./database/database.sqlite
MAIL_MAILER=smtp
MAIL_HOST=your_mail_host
MAIL_PORT=your_mail_port
MAIL_USERNAME=your_mail_username
MAIL_PASSWORD=your_mail_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=[email protected]
MAIL_FROM_NAME="${APP_NAME}"
Refer to the Third-Party Services Setup section for detailed configuration of Stripe, Google, and Facebook services.
The boilerplate uses SQLite for easy setup and portability.
- Ensure the database file exists:
touch database/database.sqlite
- Run migrations to set up the database schema:
or using Makefile:
php artisan migrate
make migrate
- Run Migrations:
php artisan migrate
- Rollback Migrations:
php artisan migrate:rollback
- Check Migration Status:
php artisan migrate:status
Understanding the project structure helps in navigating and customizing the application effectively.
technosaas-boilerplate/
├── app/
│ ├── Http/
│ │ ├── Controllers/
│ │ ├── Middleware/
│ │ └── Requests/
│ ├── Models/
│ ├── Providers/
│ └── Services/
├── bootstrap/
├── config/
├── database/
│ ├── migrations/
│ ├── factories/
│ └── seeders/
├── public/
├── resources/
│ ├── css/
│ ├── js/
│ │ ├── Components/
│ │ ├── Hooks/
│ │ ├── Layouts/
│ │ ├── Pages/
│ │ ├── lib/
│ │ └── types/
│ └── views/
├── routes/
│ ├── web.php
│ ├── api.php
│ └── console.php
├── storage/
├── tests/
│ ├── Feature/
│ └── Unit/
├── Makefile
├── package.json
├── composer.json
└── README.md
Key Directories:
- app/: Contains the core application code including controllers, models, services, and middleware.
- resources/: Contains frontend resources like React components, stylesheets, and views.
- database/: Contains migration files and database factories.
- routes/: Defines all application routes.
- tests/: Contains unit and feature tests.
- docker-compose.yml: Defines Docker services for the application.
- Makefile: Provides utility commands for managing the application and Docker containers.
The provided Makefile simplifies various development tasks. Below are the available commands and their descriptions.
Command | Description |
---|---|
make migration |
Creates a new migration file |
make migrate |
Runs database migrations |
make rollback |
Rolls back the last database migration |
make model |
Creates a new Laravel model |
make controller |
Creates a new Laravel controller |
make seed |
Runs database seeders |
make server |
Starts the Laravel development server |
make generate |
Runs custom command to generate recipes |
Usage Example:
make migrate
This command runs database migrations inside the Docker app
container.
The boilerplate uses Material UI (MUI) for building responsive and accessible user interfaces quickly.
Usage:
- MUI components are readily available throughout the project.
- Customize themes and styles in
resources/js/lib/theme.js
.
Resources:
Laravel Breeze provides a simple and minimal implementation of all Laravel's authentication features, including login, registration, password reset, email verification, and password confirmation.
Features:
- Pre-built authentication routes and controllers.
- User-friendly authentication pages built with React and Inertia.js.
Customization:
- Modify authentication views in
resources/js/Pages/Auth/
. - Customize routes in
routes/web.php
.
Resources:
Enable users to log in using their Google or Facebook accounts.
Setup:
- Configure API credentials in the
.env
file. - Implemented using Laravel Socialite.
Usage:
- OAuth routes and controllers are pre-configured.
- Customize OAuth logic in
app/Http/Controllers/Auth/SocialAuthController.php
.
Resources:
Seamless payment processing integrated with Stripe for handling one-time payments and subscriptions.
Setup:
- Add Stripe API keys to the
.env
file. - Payment routes and controllers are set up for immediate use for either one-time payments or subscriptions.
Features:
- Secure payment processing.
- Easy customization for different payment models.
Resources:
Built-in support for toggling between dark and light themes to enhance user experience.
Usage:
- Theme toggle component available in the UI.
- Themes are managed using MUI's theming capabilities.
Customization:
- Update theme configurations in
resources/js/lib/theme.js
.
Centralized Snackbar notifications for displaying brief messages to users.
Usage:
- Utilize the Snackbar context provided in
resources/js/Hooks/useSnackbar.js
. - Easily trigger notifications from any component.
Customization:
- Modify default settings such as duration and position in the Snackbar provider.
The application is designed to be fully responsive, ensuring optimal user experience across all device sizes.
Implementation:
- Utilizes Tailwind CSS and MUI for responsive layouts and components.
- Mobile-first approach in design and development.
Customization:
- Adjust responsive breakpoints and styles in Tailwind and MUI configurations.
Pre-configured SEO head templates for better search engine optimization.
Usage:
- Customize meta tags and titles in each page component.
- Dynamic generation of SEO tags based on page content.
Implementation:
- Leveraging React Helmet or similar libraries for managing head tags.
The Technosaas Boilerplate is fully customizable to suit your project's specific needs.
Areas of Customization:
- UI Components: Modify or extend existing React components in
resources/js/Components/
. - Styles: Customize styles using Tailwind CSS classes and MUI theming.
- Routes: Add or modify routes in
routes/web.php
and corresponding controllers. - Services: Implement additional services or business logic in
app/Services/
. - Database: Extend the database schema by creating new migrations and models.
- API Integrations: Integrate additional third-party services as needed.
Guidelines:
- Follow Laravel and React best practices for structuring and organizing code.
- Maintain consistent coding styles and naming conventions throughout the project.
- Leverage the existing Makefile commands for streamlined development workflows.
This section provides detailed instructions for configuring third-party services used in the boilerplate.
- Sign up or log in to your Stripe Dashboard.
- Navigate to Developers > API keys.
- Copy the Publishable key and Secret key.
STRIPE_KEY=your_publishable_key
STRIPE_SECRET=your_secret_key
- Use Stripe's test mode keys for development and testing.
- Ensure webhook endpoints are configured if needed.
Resources:
Please refer to the Google OAuth Configuration Guide for detailed setup instructions.
(Note: Provide a separate document or section detailing the steps for setting up Google OAuth, including creating a Google Cloud project, obtaining client IDs and secrets, and configuring redirect URIs.)
Please refer to the Facebook OAuth Configuration Guide for detailed setup instructions.
(Note: Provide a separate document or section detailing the steps for setting up Facebook OAuth, including creating a Facebook App, obtaining App IDs and secrets, and configuring redirect URIs.)
Ensuring the security of your application is paramount. The boilerplate includes several security features and best practices.
- Laravel Breeze handles standard authentication mechanisms securely.
- OAuth integrations with Google and Facebook use secure protocols.
- Utilize Laravel's Gate and Policy features for fine-grained access control.
- Define authorization logic in
app/Policies/
.
- Sensitive data such as passwords are hashed using bcrypt.
- HTTPS should be enforced in production environments.
- Never commit your
.env
file to version control. - Use environment-specific configurations and secrets management solutions.
- Utilize Laravel's Form Requests for validating and sanitizing user input.
- Define validation rules in
app/Http/Requests/
.
- Protect against CSRF attacks using Laravel's built-in CSRF protection.
- Use prepared statements and ORM features to prevent SQL Injection.
- Sanitize outputs to prevent XSS attacks.
Resources:
- Symptom: Running
make up
fails. - Solution: Ensure Docker is installed and running. Restart Docker service if necessary.
- Symptom: Errors during
composer install
ornpm install
. - Solution: Ensure you have the latest versions of Composer and Node.js installed.
- Symptom: Application cannot connect to services or database.
- Solution: Verify all required environment variables are correctly set in the
.env
file.
- Symptom: Errors when running
php artisan migrate
. - Solution: Check database connection settings and ensure the database file exists and is writable.
- Issue Tracker: Report issues on the project's GitHub repository issue tracker.
- Email: Contact support at [email protected].
- Community Forum: Join the community forum at forum.technosaas.com.
We welcome contributions from the community. Please refer to the Contributing section for more information.
The Technosaas Boilerplate is open-source software licensed under the MIT License.
MIT License Details:
Permission is hereby granted, free of charge, to any person obtaining a copy...
Please refer to the LICENSE file for the full license text.
v1.0.0 - September 1, 2024
- Initial release with core features:
- Laravel and React integration using Inertia.js
- Authentication setup with Laravel Breeze
- OAuth integration with Google and Facebook
- Stripe payment integration
- Responsive design with dark and light mode
- SEO optimization features
We would like to thank the following:
- Laravel Team: For providing an excellent PHP framework.
- React and Inertia.js Teams: For enabling seamless frontend development.
For any further assistance or inquiries, please contact [email protected].