| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A simple, lightweight frontend stack for quickly building web apps or SPAs.
Powered by SolidJS 💎, TailwindCSS 🎨 & DaisyUI 🌼 for styling, with a rich ecosystem of libraries for everything from icon support to state management.
Runs on Bun 🚀 and Vite ⚡️ for an ultra-fast development workflow.
Want to see it in action? Check out the live demo at simple-frontend-stack.ltl.re.
This project serves as a starting point for small, static web applications or extensions to existing projects. Whether you're adding just a tiny JavaScript snippet or building a full Single Page Application (SPA), this stack is designed to be as simple as possible while providing robust functionality.
The stack shines when used together with PocketBase — your "Open Source backend in 1 file" offering features such as:
With PocketBase, you can easily construct a full-stack application complete with user management, backups, job scheduling, and more. Alternatively, you can use this stack purely on the frontend.
The idea is to leverage standardized languages, libraries, tools, and frameworks to lower the entry barrier—even for developers with limited IT background.
While languages like Elm or Gleam might offer superior type-safety for complex applications, PocketBase (written in Go) strikes a balance for a powerful yet simple backend solution.
Combined with TypeScript, SolidJS, and a vibrant ecosystem of libraries, you'll have a practical and maintainable environment for rapid development.
Clone the Repository 🌀
git clone https://github.com/yerTools/simple-frontend-stack
cd simple-frontend-stackInstall Dependencies 📦
Run the following to install all required packages with Bun:
bun installStart Development 🎬
Launch the development server with watch mode and live preview (default port 8161):
bun run devThe app should now be available at http://localhost:8161.
Code Quality Tools 🔍
bun run formatbun run lint-checkOptional: CI/CD & Husky 🤖
Husky pre-push hooks ensure tests and linting run automatically. For more details, review the Husky configuration and GitHub CI/CD setup.
Check out these useful Vite plugins included in the project:
This project includes several npm scripts to streamline your development workflow:
# Start production build with preview
bun run start
# Start development server with hot reloading
bun run dev
# Build for production
bun run build
# Preview production build
bun run serve
# Check for outdated dependencies
bun run update
# Update all dependencies
bun run upgrade
# Type checking with TypeScript
bun run type-check
# Format code with Prettier
bun run format
# Check code formatting
bun run format-check
# Lint and fix code issues
bun run lint
# Check for linting issues without fixing
bun run lint-check
# Backend-specific commands
bun run backend:build # Build the Go backend
bun run backend:serve # Run the PocketBase server
bun run backend:format # Format Go codeThe project follows a simple and intuitive structure:
simple-frontend-stack/ ├── src/ # Source code │ ├── images/ # Image assets │ ├── pages/ # Page components │ ├── styles/ # CSS stylesheets │ │ └── general/ # General styling utilities │ ├── backend/ # Go backend code (PocketBase integration) │ ├── types/ # TypeScript type definitions │ ├── index.html # Main HTML template │ └── index.tsx # Application entry point ├── .github/ # GitHub-specific files │ └── workflows/ # GitHub Actions CI/CD workflows ├── .husky/ # Git hooks for code quality ├── .vscode/ # VS Code configuration ├── bun.lock # Bun lockfile ├── Dockerfile # Docker container definition ├── eslint.config.mjs # ESLint configuration ├── go.mod, go.sum # Go module definitions ├── main.go # Go entry point ├── package.json # Project dependencies ├── prettier.config.js # Prettier configuration ├── tsconfig.json # TypeScript configuration └── vite.config.ts # Vite configuration
This organization promotes separation of concerns and makes it easy to locate specific components and files within the project.
This project includes a comprehensive CI/CD workflow using GitHub Actions to automate testing, building, and deploying your application.
The CI/CD pipeline consists of these main jobs:
The workflow runs on:
build:
runs-on: ubuntu-latest
steps:
# Setup and dependency installation steps
- name: Checkout Repository
- name: Setup Go
- name: Setup Bun
- name: Cache Bun Dependencies
- name: Install Frontend Dependencies
- name: Install Backend Dependencies
# Quality and security checks
- name: Security Scan Dependencies
- name: Run Type Check
- name: Run Format Check
- name: Run Tests
- name: Build Fullstack Application
- name: Run Lint Check
# Artifact creation for other jobs
- name: Upload Frontend Artifact
- name: Upload Go BinariesThis job sets up the environment, installs dependencies with caching for performance, runs various code quality checks, builds the application, and saves the build artifacts for use in subsequent jobs.
deploy-pages:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
steps:
- name: Download Frontend Artifact
- name: Copy index.html to 404.html for SPA fallback
- name: Setup Pages
- name: Upload artifact
- name: Deploy to GitHub PagesThis job deploys the frontend to GitHub Pages, but only when changes are pushed to the main branch. It also creates a 404.html page that redirects to the main application, enabling proper client-side routing for SPAs.
deploy-docker:
needs: build
name: Publish Docker Image
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout code
- name: Extract Version
- name: Log in to GitHub Packages
- name: Set up Docker Buildx
- name: Cache Docker layers
- name: Scan Docker image for vulnerabilities
- name: Build and push Docker imageThis job builds and publishes multi-architecture Docker images to GitHub Packages. It runs on pushes to main or when version tags are created. The job also:
To use this workflow in your own project:
Set up GitHub repository secrets:
Enable GitHub Pages:
Configure Docker registry:
tags: |
ghcr.io/YOUR_USERNAME/YOUR_REPO:${{ steps.version.outputs.TAG }}
ghcr.io/YOUR_USERNAME/YOUR_REPO:latestTo create a versioned release with proper Docker image tagging:
# Tag a new version
git tag v1.0.0
# Push the tag to trigger the workflow
git push origin v1.0.0This will create a Docker image tagged with both latest and v1.0.0.
You can customize the workflow by:
The CI/CD workflow is designed to catch issues early in the development process and provide a smooth path to production deployment.
This project can be deployed in several ways:
For a purely static frontend deployment, build the project and deploy the generated files:
bun run frontend:buildDeploy the generated dist folder to any static site hosting service like:
The project includes a robust, multi-stage Dockerfile for containerized deployment of both frontend and PocketBase backend:
# Build the Docker image
docker build -t simple-frontend-stack .
# Run the container
docker run -p 8161:8161 simple-frontend-stackPre-built Docker images are available from GitHub Container Registry with the following tags:
You can pull these images directly for testing:
# Pull latest stable version
docker pull ghcr.io/yertools/simple-frontend-stack:latest
# Pull specific version
docker pull ghcr.io/yertools/simple-frontend-stack:v1.0.0
# Pull from a branch
docker pull ghcr.io/yertools/simple-frontend-stack:branch-feature-xyz
# Pull from a pull request
docker pull ghcr.io/yertools/simple-frontend-stack:pr-123The Docker implementation includes several production-ready features:
docker run -p 8161:8161 \
-v ./pb_data:/app/pb_data \
-v ./pb_public:/app/pb_public \
-v ./pb_hooks:/app/pb_hooks \
-v ./pb_migrations:/app/pb_migrations \
simple-frontend-stackdocker run -p 8161:8161 \
-e APP_ENV=production \
-e DEBUG=false \
simple-frontend-stackdocker buildx build --platform linux/amd64,linux/arm64 \
-t simple-frontend-stack . --pushBuild both frontend and backend:
bun run buildThen deploy the generated binary and static files to your server.
The repository includes GitHub Actions workflows for:
Contributions are welcome! Here's how you can contribute:
git clone https://github.com/your-username/simple-frontend-stack
cd simple-frontend-stackgit checkout -b my-feature-branchgit commit -m "Add feature: description of your changes"bun run type-check
bun run lint-check
bun run format-checkgit push origin my-feature-branchThis project offers a practical, no-nonsense frontend stack that gets you up and running with a modern development workflow quickly. The combination of Bun, Vite, and a carefully curated set of libraries provides the speed, simplicity, and flexibility needed for both small enhancements and complete web applications.
Happy coding! 🎉
This project is licensed under the MIT License.
Code has no borders – neither should solidarity 🌍✊
Last updated: March 27, 2025
| Back | FazBrowse Home | New Git URL |