# Full-Stack Web Application A modern full-stack web application built with React, FastAPI, and PostgreSQL. ## Features - 🎯 **React 18** with TypeScript for the frontend - 🚀 **FastAPI** for high-performance backend API - 🗄️ **PostgreSQL** database with SQLAlchemy ORM - 🐳 **Docker** containerization for development and production - 🔐 **JWT Authentication** and authorization - 📚 **Automatic API documentation** with OpenAPI/Swagger - ✅ **Comprehensive testing** setup - 🎨 **Tailwind CSS** for beautiful, responsive UI - 📱 **Mobile-first** responsive design ## Quick Start ### Prerequisites - Docker and Docker Compose - Node.js 18+ (for local development) - Python 3.9+ (for local development) ### Development Setup 1. **Clone and setup environment:** ```bash cp .env.example .env # Edit .env with your configuration ``` 2. **Start development environment:** ```bash docker-compose up -d ``` 3. **Access the application:** - Frontend: http://localhost:3000 - Backend API: http://localhost:8000 - API Documentation: http://localhost:8000/docs - Database: localhost:5432 ### Local Development **Frontend:** ```bash cd frontend npm install npm start ``` **Backend:** ```bash cd backend python -m venv venv source venv/bin/activate pip install -r requirements.txt uvicorn app.main:app --reload ``` ## Project Structure ``` ├── frontend/ # React TypeScript frontend │ ├── src/ │ │ ├── components/ │ │ ├── pages/ │ │ ├── services/ │ │ └── hooks/ │ └── package.json ├── backend/ # FastAPI backend │ ├── app/ │ │ ├── api/ │ │ ├── core/ │ │ ├── models/ │ │ └── schemas/ │ └── requirements.txt ├── database/ # Database initialization ├── docs/ # Documentation └── docker-compose.yml ``` ## API Documentation The API is automatically documented using OpenAPI/Swagger. Access the interactive documentation at: - **Swagger UI:** http://localhost:8000/docs - **ReDoc:** http://localhost:8000/redoc ## Testing **Frontend tests:** ```bash cd frontend npm test ``` **Backend tests:** ```bash cd backend pytest ``` ## Deployment ### Production Deployment 1. **Build production images:** ```bash docker-compose -f docker-compose.prod.yml build ``` 2. **Deploy to production:** ```bash docker-compose -f docker-compose.prod.yml up -d ``` ### Environment Variables Key environment variables (see `.env.example`): - `DATABASE_URL`: PostgreSQL connection string - `SECRET_KEY`: JWT secret key - `CORS_ORIGINS`: Allowed CORS origins - `ENVIRONMENT`: Development/production environment ## Contributing 1. Fork the repository 2. Create a feature branch 3. Make your changes 4. Add tests for new functionality 5. Submit a pull request ## License This project is licensed under the MIT License - see the LICENSE file for details.