A modern, production-ready website for the Rust Cameroon community built with React and Rust.
- 🏠 Home Page: Welcome section with community mission and recent posts
- 📖 About Page: Information about the Rust Cameroon community
- 📅 Events Page: Upcoming and past community events
- 📝 Blog: Articles and tutorials from the community
- 🔧 Admin Panel: Simple interface for managing posts
- 🚀 Production Ready: Optimized for deployment on AWS EC2
- 🔒 SSL Support: Automatic Let's Encrypt certificate management
- 📱 Responsive: Mobile-first design with TailwindCSS
- ♿ Accessible: Semantic HTML and keyboard navigation support
- 🔍 SEO Optimized: Meta tags and structured data
- React 18 with TypeScript
- React Router for navigation
- TailwindCSS for styling
- React Helmet for SEO
- Axios for API calls
- Context API for state management
- Rust with Axum web framework
- JSON file storage for posts (easily replaceable with database)
- CORS enabled for cross-origin requests
- Structured logging with tracing
- Nginx reverse proxy with SSL termination
- Let's Encrypt for free SSL certificates
- Systemd for service management
- Docker support for containerized deployment
- AWS EC2 deployment scripts
- Node.js 18+ and npm
- Rust 1.75+
- Git
-
Clone the repository
git clone <repository-url> cd rust-cameroon-website
-
Setup Frontend
cd frontend npm install cp env.example .env # Edit .env with your configuration npm run dev
-
Setup Backend
cd backend cargo run
-
Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- Admin Panel: http://localhost:5173/admin
Create a .env
file in the frontend directory:
# API Configuration
VITE_API_URL=http://localhost:8000/api
# Admin Configuration
VITE_ADMIN_PASSWORD=your-secure-password
-
Prepare your EC2 instance
- Launch Ubuntu 22.04 LTS instance
- Configure security groups (ports 22, 80, 443)
- Set up SSH key access
-
Configure deployment
# Edit deployment script nano scripts/deploy.sh # Update EC2_HOST and DOMAIN variables
-
Deploy
./scripts/deploy.sh
-
Setup SSL
# SSH into your server ssh ubuntu@your-ec2-ip # Run SSL setup sudo ./scripts/ssl-setup.sh your-domain.com
-
Build and run with Docker Compose
docker-compose -f docker-compose.prod.yml up -d
-
Setup SSL certificates
# Install certbot on host sudo apt install certbot # Obtain certificate sudo certbot certonly --webroot -w ./frontend/dist -d your-domain.com
-
Build the application
# Frontend cd frontend && npm run build # Backend cd backend && cargo build --release
-
Setup server
# Copy files to server scp -r frontend/dist user@server:/var/www/rust-cameroon/ scp backend/target/release/rust-cameroon-api user@server:/opt/rust-cameroon/ # Configure Nginx sudo cp nginx-https.conf /etc/nginx/sites-available/rust-cameroon sudo ln -s /etc/nginx/sites-available/rust-cameroon /etc/nginx/sites-enabled/ sudo systemctl reload nginx
rust-cameroon-website/
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ │ ├── layout/ # Layout components
│ │ │ └── ui/ # UI components
│ │ ├── pages/ # Page components
│ │ ├── context/ # React context
│ │ ├── types/ # TypeScript types
│ │ └── utils/ # Utility functions
│ ├── public/ # Static assets
│ └── dist/ # Build output
├── backend/ # Rust backend
│ ├── src/ # Source code
│ └── posts.json # Posts data
├── scripts/ # Deployment scripts
│ ├── deploy.sh # Main deployment script
│ ├── setup-server.sh # Server setup
│ ├── ssl-setup.sh # SSL certificate setup
│ └── start-services.sh # Service management
├── nginx.conf # Nginx configuration
├── docker-compose.prod.yml # Docker Compose for production
└── README.md # This file
-
Via Admin Panel (Recommended)
- Go to
/admin
- Click "New Post"
- Fill in the form and save
- Go to
-
Via JSON File
- Edit
backend/posts.json
- Add new post object with required fields
- Restart the backend service
- Edit
{
"id": "unique-id",
"title": "Post Title",
"content": "<p>HTML content</p>",
"excerpt": "Brief description",
"author": "Author Name",
"date": "2024-01-01",
"tags": ["rust", "programming"],
"image_url": "https://example.com/image.jpg",
"slug": "post-title-slug"
}
- Admin panel is password-protected
- SSL/TLS encryption for all traffic
- Security headers configured in Nginx
- Fail2ban protection against brute force attacks
- Non-root user for backend service
- Gzip compression enabled
- Static asset caching (1 year)
- Optimized React build
- Efficient Rust backend
- CDN-ready static assets
- Systemd service management
- Log rotation configured
- Health checks for services
- Nginx access/error logs
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- GitHub Issues: Create an issue
- Discord: Rust Cameroon Community
- Email: [email protected]
- Database integration (PostgreSQL)
- User authentication system
- Comment system for posts
- Event management system
- Newsletter integration
- Multi-language support
- Dark mode toggle
- Progressive Web App features