Skip to content

Commit c582a7c

Browse files
Copilotngocbd
andcommitted
Add comprehensive setup.sh script and update documentation
Co-authored-by: ngocbd <439333+ngocbd@users.noreply.github.com>
1 parent 898f3ba commit c582a7c

2 files changed

Lines changed: 642 additions & 6 deletions

File tree

README.md

Lines changed: 86 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ Unlike proprietary solutions, Container Engine provides a complete **User Manage
4343

4444
### Technical Features
4545
- **Rust + Axum Backend:** High-performance, memory-safe backend built with Rust and the modern Axum web framework
46+
- **OpenAPI Documentation:** Complete API documentation with Swagger UI integration using utoipa
4647
- **Registry Agnostic:** Pull public or private images from Docker Hub, Google Container Registry, Amazon ECR, GitHub Container Registry, or any other container registry with support for authentication.
4748
- **Environment Variables Management:** Securely inject configuration through environment variables without rebuilding images.
4849
- **Deployment Monitoring:** Real-time logs and performance metrics for all your deployments in one unified dashboard.
4950
- **Zero Downtime Updates:** Update your applications seamlessly with rolling updates that guarantee availability.
51+
- **Automated Setup:** Intelligent setup script that checks and installs all required dependencies automatically.
5052

5153
## Technology Stack
5254

@@ -318,24 +320,102 @@ We enthusiastically welcome contributions to the Container Engine project! Wheth
318320
5. Open a Pull Request
319321

320322
### Development Setup
323+
324+
Container Engine includes an automated setup script that handles dependency installation and environment configuration:
325+
321326
```bash
322327
# Clone the repository
323328
git clone https://github.com/ngocbd/Open-Container-Engine.git
329+
cd Open-Container-Engine
330+
331+
# Make setup script executable
332+
chmod +x setup.sh
333+
334+
# Check system dependencies
335+
./setup.sh check
336+
337+
# Full automated setup (installs dependencies if missing)
338+
./setup.sh setup
339+
340+
# Start development server
341+
./setup.sh dev
342+
```
343+
344+
#### Available Setup Commands
345+
346+
```bash
347+
# Get help and see all available commands
348+
./setup.sh help
349+
350+
# Development commands
351+
./setup.sh build # Build the project
352+
./setup.sh test # Run tests
353+
./setup.sh format # Format code
354+
./setup.sh lint # Run linting
355+
356+
# Database management
357+
./setup.sh db-up # Start database services
358+
./setup.sh db-down # Stop database services
359+
./setup.sh db-reset # Reset database and volumes
360+
./setup.sh migrate # Run database migrations
361+
./setup.sh sqlx-prepare # Prepare SQLx for offline compilation
362+
363+
# Docker operations
364+
./setup.sh docker-build # Build Docker image
365+
./setup.sh docker-up # Start all services with Docker
366+
./setup.sh docker-down # Stop all Docker services
367+
368+
# Cleanup
369+
./setup.sh clean # Clean build artifacts
370+
```
371+
372+
#### Manual Setup (if needed)
373+
374+
If you prefer manual setup or the automated script doesn't work for your system:
324375

376+
```bash
325377
# Install Rust and Cargo
326378
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
327379

328-
# Build the project
329-
cd Open-Container-Engine
330-
cargo build
380+
# Install SQLx CLI
381+
cargo install sqlx-cli --no-default-features --features native-tls,postgres
331382

332-
# Run tests
333-
cargo test
383+
# Start database services
384+
docker compose up postgres redis -d
334385

335-
# Start development server
386+
# Create environment file
387+
cp .env.example .env
388+
389+
# Run migrations
390+
export DATABASE_URL="postgresql://postgres:password@localhost:5432/container_engine"
391+
sqlx migrate run
392+
393+
# Prepare SQLx for offline compilation
394+
cargo sqlx prepare
395+
396+
# Build and run
397+
cargo build
336398
cargo run
337399
```
338400

401+
#### API Documentation
402+
403+
Once the server is running, you can access:
404+
405+
- **Health Check**: http://localhost:3000/health
406+
- **OpenAPI Specification**: http://localhost:3000/api-docs/openapi.json
407+
- **API Endpoints**: All endpoints are documented in the OpenAPI spec
408+
409+
#### Dependencies
410+
411+
The setup script automatically checks for and installs:
412+
413+
- **Rust** (latest stable version)
414+
- **Docker** & **Docker Compose**
415+
- **Git** & **curl**
416+
- **Python 3** (optional, for development tools)
417+
- **SQLx CLI** (for database migrations)
418+
339419
## Roadmap
340420

341421
We're continuously improving Container Engine with new features and enhancements:

0 commit comments

Comments
 (0)