A modern, responsive website for EmptyMug built with React and Python FastAPI, featuring a sleek Apple-inspired design with smooth animations, database storage, and AI-powered content moderation.
- Modern Design: Apple-inspired UI with clean aesthetics
- Interactive Background: Subtle animated Voronoi diagram
- Responsive: Works perfectly on all devices
- Smooth Animations: Subtle animations powered by Framer Motion
- Advanced Contact Form: Enhanced validation with country code selection
- Database Storage: Multi-database support (In-memory, PostgreSQL, DynamoDB)
- AI Content Moderation: Ollama LLM integration for content filtering
- Enhanced Validation: Email format, phone number, and input validation
- TypeScript: Full TypeScript support for better development experience
- Dev Containers: Ready-to-use development environment
- Docker Ready: Production-ready Docker containers with automated builds
- CI/CD: GitHub Actions for automated testing, building, and publishing
The application is automatically built and published to GitHub Container Registry:
- Frontend:
ghcr.io/abderraza8k/emptymug-project-frontend:latest - Backend:
ghcr.io/abderraza8k/emptymug-project-backend:latest
# Using Docker Compose (Recommended)
docker-compose -f docker-compose.prod.yml up -d
# Or run individual containers
docker run -p 3000:80 ghcr.io/abderraza8k/emptymug-project-frontend:latest
docker run -p 8000:8000 ghcr.io/abderraza8k/emptymug-project-backend:latest- React 18 with TypeScript
- Tailwind CSS for styling
- Framer Motion for animations
- React Hook Form for form handling
- Axios for API calls
- FastAPI for REST API
- Pydantic for data validation
- Aiosmtplib for email sending
- Python 3.11
- Docker and Docker Compose
- VS Code (recommended for dev container support)
-
Clone the repository
git clone <your-repo-url> cd emptymug-website
-
Configure Environment Variables
cp backend/.env.example backend/.env
Edit
backend/.envand update the email configuration:EMAIL_HOST=smtp.gmail.com EMAIL_PORT=587 EMAIL_USER=contact@emptymug.fr EMAIL_PASSWORD=your_app_password_here
-
Start with Docker Compose
docker-compose -f docker-compose.dev.yml up --build
-
Access the Application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- PostgreSQL: localhost:5432
- Ollama: http://localhost:11434
- Open the project in VS Code
- Install the "Dev Containers" extension
- Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) - Select "Dev Containers: Reopen in Container"
- VS Code will build and open the dev container automatically
The application supports multiple database backends:
Perfect for development and testing:
DATABASE_TYPE=memoryDATABASE_TYPE=postgres
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your_password
POSTGRES_DB=emptymugDATABASE_TYPE=dynamodb
DYNAMODB_REGION=us-east-1
DYNAMODB_TABLE_NAME=emptymug_contacts
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_keyThe application uses Ollama for AI-powered content moderation:
OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=llama2- Install Ollama:
curl -fsSL https://ollama.ai/install.sh | sh - Start service:
ollama serve - Pull model:
ollama pull llama2
The contact form sends emails using SMTP. For Gmail:
- Enable 2-factor authentication on your Gmail account
- Generate an "App Password" for the application
- Use the app password in the
EMAIL_PASSWORDenvironment variable
For other email providers, update the EMAIL_HOST and EMAIL_PORT accordingly.
- Glass Effect: Modern glassmorphism design elements
- Gradient Backgrounds: Beautiful gradient overlays
- Floating Animations: Subtle floating animations for visual appeal
- Smooth Transitions: All interactions have smooth transitions
- Mobile First: Responsive design that works on all screen sizes
- Form Validation: Client-side and server-side validation
- Country Code Selection: Dropdown with country flags and dial codes
- Email Formatting: Professional HTML email templates
- Error Handling: Comprehensive error handling and user feedback
- Success States: Clear success/error feedback to users
The contact form includes a comprehensive list of countries with their:
- Country flags (emoji)
- Dial codes
- Country names
- Sorted alphabetically for easy selection
Note: Israel is excluded from the country list as requested.
cd frontend
npm install
npm startcd backend
pip install -r requirements.txt
uvicorn main:app --reload# Build frontend
cd frontend
npm run build
# The backend is ready for production deployment as-isGET /- Health checkGET /health- Detailed health checkPOST /api/contact- Submit contact form
The application is containerized and ready for deployment to any container orchestration platform:
- Docker images for both frontend and backend
- Environment variable configuration
- Health check endpoints
- CORS configuration for production
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Copyright 2024 EmptyMug
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Built with β€οΈ for EmptyMug - Creating digital experiences that matter.