A modern web application that helps calculate inheritance distribution according to Turkish Civil Law.
- Framework: React with TypeScript
- Build Tool: Vite
- State Management: React Context API
- Styling: Tailwind CSS
- Hosting: Firebase Hosting
- Domain Management: Cloudflare
- URL: https://mirasyedi.com
- Framework: FastAPI (Python)
- API Documentation: OpenAPI/Swagger
- Hosting: Google Cloud Run
- URL: https://mirasyedi-api-227035341689.us-central1.run.app
The application follows a modern client-server architecture:
- Frontend and backend are completely decoupled
- RESTful API communication
- CORS enabled for secure cross-origin requests
- Serverless deployment for both frontend and backend
- Real-time inheritance calculation
- Support for complex family tree structures
- Responsive design for all devices
- Type-safe implementation
- Automated deployment pipeline
- Node.js (v18 or higher)
- Python 3.11 or higher
- Google Cloud SDK
- Firebase CLI
- Git
-
Clone the Repository
git clone https://github.com/yourusername/mirasyedi.git cd mirasyedi -
Backend Setup
# Create and activate Python virtual environment cd backend python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install dependencies pip install -r requirements.txt # Start the development server uvicorn app.api:app --reload --port 8000
The backend API will be available at
http://localhost:8000API documentation will be athttp://localhost:8000/docs -
Frontend Setup
# In a new terminal cd frontend # Install dependencies npm install # Start development server npm run dev
The frontend will be available at
http://localhost:5173
-
Frontend Environment Files
Create
.env.developmentin the frontend directory:VITE_API_URL=http://localhost:8000
Create
.env.productionfor production:VITE_API_URL=https://mirasyedi-api-227035341689.us-central1.run.app
-
Backend Environment No environment variables are required for local development.
-
Running Tests
# Backend tests cd backend pytest # Frontend tests cd frontend npm test
-
Code Formatting
# Backend cd backend black . # Frontend cd frontend npm run format
-
Type Checking
# Frontend cd frontend npm run type-check
-
Initial Setup
# Install Google Cloud SDK brew install google-cloud-sdk # On macOS # Login and set project gcloud auth login gcloud config set project mirasyedi-backend # Enable required services gcloud services enable cloudbuild.googleapis.com run.googleapis.com containerregistry.googleapis.com
-
Deploy Changes
cd backend # Build and push container gcloud builds submit --tag us-central1-docker.pkg.dev/mirasyedi-backend/mirasyedi-repo/api # Deploy to Cloud Run gcloud run deploy mirasyedi-api \ --image us-central1-docker.pkg.dev/mirasyedi-backend/mirasyedi-repo/api \ --platform managed \ --region us-central1 \ --allow-unauthenticated
-
Initial Setup
# Install Firebase CLI npm install -g firebase-tools # Login to Firebase firebase login # Initialize Firebase in the project cd frontend firebase init hosting
-
Deploy Changes
cd frontend # Build the application npm run build # Deploy to Firebase firebase deploy
-
CORS Errors
- Verify backend CORS settings in
backend/app/api.py - Check that frontend API URL matches allowed origins
- Clear browser cache and reload
- Verify backend CORS settings in
-
Deployment Failures
- Ensure you have necessary permissions in Google Cloud and Firebase
- Verify billing is enabled for Google Cloud services
- Check if all required APIs are enabled
-
Local Development Issues
- Verify both frontend and backend are running
- Check console for error messages
- Ensure correct Node.js and Python versions
- Clear node_modules and reinstall if needed
-
Logs
- Backend logs: Available in Google Cloud Console
- Frontend logs: Check Firebase Hosting logs
- Local logs: Terminal output and browser console
-
Support
- Create an issue in the repository
- Check existing issues for similar problems
- Include relevant logs and error messages
VITE_API_URL: Backend API URL
- No environment variables required currently
- CORS configuration for allowed origins
- Input validation on both frontend and backend
- Secure HTTPS communication
- No sensitive data storage
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests
- Submit a pull request
Feel free to submit issues and enhancement requests.