This is a charity platform dedicated to helping people in Gaza through donations and aid.
The Good Shop is built using a modern stack with the following components:
- Framework: Vike with React
- UI: TailwindCSS with DaisyUI
- Payment: Stripe integration via Stripe.js and React Stripe.js for accepting donations
- Routing: Vike's built-in routing system
- Framework: Actix-web (Rust)
- Database: SQLite with SQLx for type-safe queries
- Payment Processing: Stripe API integration for donation processing
- Type Sharing: Specta for generating TypeScript types from Rust types
thegoodshop/ # Frontend application
├── components/ # Reusable UI components
├── database/ # Frontend data management
├── layouts/ # Page layouts
├── pages/ # Application pages and routes
├── renderer/ # Vike rendering configuration
└── src/ # Frontend source code
src/ # Backend Rust code
├── main.rs # Server entrypoint and API routes
├── db.rs # Database connection and queries
├── model.rs # Data models shared between frontend and backend
└── lib.rs # Library exports
migrations/ # SQLite database migrations
- Type Safety: Full stack type safety with TypeScript on the frontend and Rust on the backend
- Server-Side Rendering: SSR enabled by default
- Donation Processing: Stripe integration for secure donation processing
- Data Management: Aid programs and donations stored in SQLite database
- The Rust backend serves the API endpoints and static frontend files
- Frontend is built with Vike for optimized production builds
- Types are automatically shared between frontend and backend using Specta
GET /api/products
- Retrieve all aid programsPOST /api/create-checkout-session
- Create a Stripe checkout session for donations
The application uses a SQLite database with the following schema:
CREATE TABLE products (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
price REAL NOT NULL,
created_at INTEGER NOT NULL DEFAULT (...)
);
Note: While the table is named "products", these entries represent aid programs for Gaza that users can donate to.
This project uses Nix with direnv for dependency management, making setup extremely simple.
-
Clone the repository:
git clone <repository-url> cd thegoodshop
-
Allow direnv to set up the environment:
direnv allow
This single command will:
- Install all required dependencies (Rust, Node.js, pnpm, SQLite, etc.)
- Set up the development environment
- Configure necessary environment variables
-
Start the application:
# Build and run the backend cargo run
-
The application will be available at
http://localhost:5526
For payment processing, you'll need to configure your Stripe API key:
-
Edit the
.envrc
file to add your Stripe API key:DATABASE_URL="sqlite://./db/shop.db" export DATABASE_URL export STRIPE_API_KEY="sk_test_your_stripe_secret_key" use flake
-
Run
direnv allow
again to apply the changes.
-
Clone the repository:
git clone <repository-url> cd thegoodshop
-
Install frontend dependencies:
cd thegoodshop pnpm install
-
Install Rust dependencies:
# From the project root cargo build
-
Create a
.env
file in the project root:DATABASE_URL=sqlite://db/mydb.sqlite STRIPE_API_KEY=sk_test_your_stripe_secret_key
-
Replace
sk_test_your_stripe_secret_key
with your actual Stripe secret key.
The database will be automatically set up when you first run the application, with migrations applied to create the necessary tables.
-
Start the development server:
# From the project root cargo run
-
The application will be available at
http://localhost:5526
-
Build the frontend:
cd thegoodshop pnpm build
-
Build the Rust backend:
# From the project root cargo build --release
-
Run the production server:
./target/release/thegoodshop
To add new aid programs to the platform:
-
You can manually insert entries into the SQLite database:
INSERT INTO products (name, price) VALUES ('Emergency Food Package', 25.00); INSERT INTO products (name, price) VALUES ('Medical Supplies Kit', 50.00);
-
Or modify the initial migration file at
migrations/20250318163726_Initial_Migration.sql
to include your desired aid programs.
- Main page content: Edit
thegoodshop/pages/index/+Page.tsx
- Checkout process: Modify files in
thegoodshop/pages/checkout/
- Styles: Update Tailwind configuration in
thegoodshop/tailwind.config.js
For production deployment:
- Set up a server with Rust installed
- Configure a reverse proxy (like Nginx) in front of the application
- Set up environment variables with production values
- Use a process manager like systemd or supervisor to keep the application running
For more information on Vike, see the Vike documentation.