Skip to content

tyronejosee/prototype_actix_web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prototype Actix Web


A Backend-only e-commerce system built with Rust and Actix Web, designed with a Modular Monolith architecture for selling custom mechanical keyboards and accessories.

rust-version actix-web sqlx serde jwt bcrypt utoipa

✅ Prerequisites

  • Rust 1.70+
  • PostgreSQL 12+

⚙️ Installation

Configure Environment.

cp .env.example .env
# Edit .env with your database credentials

Create database.

createdb prototype_actix_web

# Run migrations (automatically handled on startup)

Run the Application.

cargo run

The server will start on http://localhost:8080

Visit http://localhost:8080/swagger-ui/ for interactive API documentation.

🗀 Folder Structure

# Modular Structure
src/
├── main.rs                # Application entry point
├── lib.rs                 # Library exports
├── core/                  # Shared functionality
│   ├── config.rs          # Configuration management
│   ├── database.rs        # Database connection
│   ├── error.rs           # Error handling
│   └── middleware/        # Custom middleware
├── catalog/               # Product catalog module
├── orders/                # Order processing module
├── users/                 # User management module
├── payments/              # Payment processing module
└── shipping/              # Shipping calculations module

Each module contains:

  • models.rs - Data structures and DTOs
  • routes.rs - HTTP route handlers
  • services.rs - Business logic
  • db.rs - Database operations

📡 Endpoints

Authentication

  • POST /api/v1/auth/register - Register new user
  • POST /api/v1/auth/login - User login

Products

  • GET /api/v1/products - List products (filterable by category)
  • POST /api/v1/products - Create product
  • GET /api/v1/products/{id} - Get product details

Orders

  • POST /api/v1/orders - Create order
  • GET /api/v1/orders - Get user orders
  • GET /api/v1/orders/{id} - Get order details

Payments

  • POST /api/v1/payments/intents - Create payment intent
  • GET /api/v1/payments/intents/{id} - Get payment status
  • POST /api/v1/payments/intents/{id}/confirm - Confirm payment

Shipping

  • POST /api/v1/shipping/calculate - Calculate shipping rates

⚖️ License

This project is under the MIT License.

Enjoy! 🎉

About

A Backend-only e-commerce system built with Rust and Actix Web, designed with a Modular Monolith architecture for selling custom mechanical keyboards and accessories.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages