Skip to content

godie007/webapp-python-reactjs

Repository files navigation

πŸš€ WebApp Python - Advanced Full-Stack Template

Professional template for modern web applications with React, FastAPI, Vercel and Supabase

Deploy with Vercel

License: MIT TypeScript React FastAPI Vercel Supabase


πŸ’ Support this Project

Ko-fi YouTube

If this template helps you, consider supporting my work! β˜•

πŸ“‹ Table of Contents

🎯 Project Description

WebApp Python is an advanced and professional template for modern web application development. Designed to be a robust and scalable starting point, it combines best practices for both frontend and backend development.

🎯 Template Objectives

  • βœ… Rapid Development: Pre-configured setup for immediate development
  • βœ… Scalability: Modular and extensible architecture
  • βœ… Performance: Optimized for speed and efficiency
  • βœ… Security: Implementation of security best practices
  • βœ… Maintainability: Clean and well-documented code
  • βœ… Automatic Deployment: Complete integration with Vercel

✨ Key Features

🎨 Advanced Frontend

  • βš›οΈ React 18 with TypeScript for robust development
  • 🎨 Professional Design System with Tailwind CSS
  • πŸ“± Responsive Design optimized for all devices
  • πŸ”„ State Management with React Hooks
  • 🎯 Smart Forms with advanced validation
  • πŸ”” Notifications with react-hot-toast
  • 🎭 Smooth Animations and transitions

πŸ”§ Robust Backend

  • ⚑ FastAPI for high-performance APIs
  • πŸ” Complete JWT Authentication and secure
  • πŸ“Š Data Validation with Pydantic
  • πŸ—„οΈ Database with Supabase
  • πŸ“ Automatic Documentation with Swagger/OpenAPI
  • πŸ§ͺ Testing with pytest

πŸš€ Deployment and DevOps

  • ☁️ Vercel for automatic deployment
  • πŸ”„ CI/CD integrated
  • πŸ“Š Monitoring and analytics
  • πŸ”’ SSL/HTTPS automatic
  • 🌍 Global CDN for better performance

πŸ—οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend      β”‚    β”‚   Backend       β”‚    β”‚   Database      β”‚
β”‚   (React)       │◄──►│   (FastAPI)     │◄──►│   (Supabase)    β”‚
β”‚                 β”‚    β”‚                 β”‚    β”‚                 β”‚
β”‚ β€’ TypeScript    β”‚    β”‚ β€’ Python        β”‚    β”‚ β€’ PostgreSQL    β”‚
β”‚ β€’ Tailwind CSS  β”‚    β”‚ β€’ JWT Auth      β”‚    β”‚ β€’ Real-time     β”‚
β”‚ β€’ Vite          β”‚    β”‚ β€’ Pydantic      β”‚    β”‚ β€’ Row Level     β”‚
β”‚ β€’ React Router  β”‚    β”‚ β€’ CORS          β”‚    β”‚   Security      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚                       β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   Vercel        β”‚
                    β”‚   (Deployment)  β”‚
                    β”‚                 β”‚
                    β”‚ β€’ Auto Deploy   β”‚
                    β”‚ β€’ Edge Network  β”‚
                    β”‚ β€’ Analytics     β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Technology Stack

Frontend

Technology Version Purpose
React 18.2.0 UI Framework
TypeScript 5.0.0 Static typing
Vite 4.4.0 Build tool
Tailwind CSS 3.3.0 CSS Framework
React Router 6.8.0 Routing
React Hook Form 7.43.0 Form handling

Backend

Technology Version Purpose
Python 3.9+ Main language
FastAPI 0.100.0 Web framework
Uvicorn 0.23.0 ASGI server
Pydantic 2.0.0 Data validation
PyJWT 2.8.0 JWT authentication
python-dotenv 1.0.0 Environment variables

Infrastructure

Technology Purpose
Vercel Deployment and hosting
Supabase Database and auth
GitHub Version control

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.9+
  • Git
  • Vercel account
  • Supabase account

1. Clone the Repository

git clone https://github.com/godie007/webapp-python.git
cd webapp-python

2. Configure Environment Variables

# Copy example files
cp backend/env.example backend/.env
cp frontend/.env.example frontend/.env

# Configure variables in backend/.env
JWT_SECRET=your_super_secure_jwt_secret
DATABASE_URL=your_supabase_url

3. Install Dependencies

# Frontend
cd frontend
npm install

# Backend
cd ../backend
pip install -r requirements.txt

4. Run in Development

# Terminal 1 - Backend
cd backend
python main.py

# Terminal 2 - Frontend
cd frontend
npm run dev

5. Deploy to Vercel

# From project root
npx vercel --prod

πŸ“ Project Structure

webapp-python/
β”œβ”€β”€ πŸ“ frontend/                 # React application
β”‚   β”œβ”€β”€ πŸ“ src/
β”‚   β”‚   β”œβ”€β”€ πŸ“ components/       # Reusable components
β”‚   β”‚   β”œβ”€β”€ πŸ“ services/         # API services
β”‚   β”‚   β”œβ”€β”€ πŸ“ types/           # TypeScript definitions
β”‚   β”‚   β”œβ”€β”€ πŸ“ utils/           # Utilities
β”‚   β”‚   └── πŸ“„ main.tsx         # Entry point
β”‚   β”œβ”€β”€ πŸ“ public/              # Static assets
β”‚   β”œβ”€β”€ πŸ“„ package.json         # Frontend dependencies
β”‚   β”œβ”€β”€ πŸ“„ vite.config.ts       # Vite configuration
β”‚   β”œβ”€β”€ πŸ“„ tailwind.config.js   # Tailwind configuration
β”‚   └── πŸ“„ vercel.json          # Vercel configuration
β”œβ”€β”€ πŸ“ backend/                  # FastAPI API
β”‚   β”œβ”€β”€ πŸ“ app/
β”‚   β”‚   β”œβ”€β”€ πŸ“ models/          # Data models
β”‚   β”‚   β”œβ”€β”€ πŸ“ services/        # Business logic
β”‚   β”‚   β”œβ”€β”€ πŸ“ repositories/    # Data access
β”‚   β”‚   β”œβ”€β”€ πŸ“ utils/           # Utilities
β”‚   β”‚   └── πŸ“„ main.py          # Main application
β”‚   β”œβ”€β”€ πŸ“„ requirements.txt      # Python dependencies
β”‚   └── πŸ“„ main.py              # Entry point
β”œβ”€β”€ πŸ“ docs/                     # Documentation
β”œβ”€β”€ πŸ“„ vercel.json              # Vercel configuration
β”œβ”€β”€ πŸ“„ README.md                # This file
└── πŸ“„ LICENSE                  # MIT License

🎨 Design System

Color Palette

/* Primary Colors */
--primary-50: #eff6ff;
--primary-500: #3b82f6;
--primary-900: #1e3a8a;

/* Secondary Colors */
--secondary-50: #f8fafc;
--secondary-500: #64748b;
--secondary-900: #0f172a;

/* States */
--success: #10b981;
--warning: #f59e0b;
--error: #ef4444;

Available Components

  • Panels: .panel, .panel-elevated, .panel-glass
  • Cards: .card, .card-elevated, .card-glass
  • Forms: .form-group, .form-label, .form-input
  • Buttons: .btn-primary, .btn-secondary, .btn-success
  • Badges: .badge-primary, .badge-success, .badge-error

πŸ”§ Configuration

Environment Variables

Backend (.env)

# JWT Configuration
JWT_SECRET=your_super_secure_jwt_secret
JWT_ALGORITHM=HS256
JWT_EXPIRATION=3600

# Database
DATABASE_URL=postgresql://user:password@host:port/database

# CORS
ALLOWED_ORIGINS=http://localhost:5173,https://your-domain.vercel.app

# Environment
ENVIRONMENT=development
DEBUG=true

Frontend (.env)

# API Configuration
VITE_API_BASE_URL=http://localhost:3000/api
VITE_APP_NAME=WebApp Python

# Environment
VITE_ENVIRONMENT=development

πŸ“¦ Deployment

Automatic Deployment with Vercel

  1. Connect with GitHub

    • Go to Vercel Dashboard
    • Import your GitHub repository
    • Vercel will automatically detect the configuration
  2. Configure Environment Variables

    # In Vercel Dashboard > Settings > Environment Variables
    JWT_SECRET=your_production_jwt_secret
    DATABASE_URL=your_production_supabase_url
  3. Manual Deployment

    npx vercel --prod

Deployment URLs

πŸ§ͺ Testing

Frontend Testing

cd frontend
npm run test
npm run test:coverage

Backend Testing

cd backend
pytest
pytest --cov=app

E2E Testing

npm run test:e2e

πŸ“š Documentation

Available Guides

Useful Commands

# Development
npm run dev          # Frontend development
python main.py       # Backend development

# Build
npm run build        # Build frontend
npm run preview      # Preview build

# Testing
npm run test         # Run tests
npm run test:watch   # Watch mode

# Linting
npm run lint         # ESLint
npm run lint:fix     # Auto-fix

# Type checking
npm run type-check   # TypeScript check

🀝 Contributing

How to Contribute

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Code Standards

  • βœ… TypeScript for all frontend code
  • βœ… ESLint + Prettier for formatting
  • βœ… Conventional Commits for messages
  • βœ… Testing for new features
  • βœ… Documentation updated

Commit Structure

feat: add user authentication
fix: resolve CORS issue
docs: update API documentation
style: improve button styling
refactor: optimize database queries
test: add unit tests for auth service

πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.


πŸŽ‰ Thanks for Using WebApp Python!

If this template has been helpful, please consider:

⭐ Star this repository β€’ πŸ› Report issues β€’ πŸ’‘ Suggest improvements β€’ 🀝 Contribute

πŸ’– Support the Project

Ko-fi

Learn more: Subscribe to my YouTube Channel for web development tutorials


Developed with ❀️ by @godie007

Deploy with Vercel

About

Login Supabase con FastAPI y ReactJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published