Skip to content

vivian-dai/Primes-as-a-Service

Repository files navigation

Primes as a Service

cover image

About

Participants

Description

Primes as a service is a medusa store and e-commerce web application for selling prime numbers for cryptography and RSA encryption.

Features

  • Multiple types of primes offered
  • Custom purchase and stripe checkout page
  • Automated encrypted emails with your prime information
  • 24/7 support and more!

Preview

Expand to see screenshots

Home page order products admin products client profile purchase shipping emailed prime

Setup

Prerequisites

Installation

Run npm install in the root folder, the frontend folder, and the admin folder

Set up a Minio bucket, make it public and add MINIO_ENDPOINT, MINIO_BUCKET, MINIO_ACCESS_KEY, and MINIO_SECRET_KEY environment variables in the .env file. Check .env.template for what environment variables exist. MINIO_ENDPOINT is already configured in the env.template. Keep that. Refer to Medusa.js's guide on setting up MinIO for more information.

Create a Stripe account and add your stripe API key as STRIPE_API_KEY in the .env file in root and your public key as NEXT_PUBLIC_STRIPE_KEY in the .env file in the frontend folder. This will be used for the Medusa checkout feature.

Running

  1. Start MinIO: ./minio.exe server ./ --address 127.0.0.1:9001 --console-address :9090
  2. Start Medusa in a new command line window: medusa develop
  3. Open another instance of your command line and navigate to frontend: cd frontend
  4. Then to run frontend: yarn dev
  5. Open yet another instance of your command line and go to admin: cd admin
  6. To run the admin: npm start

Your frontend should be running at http://localhost:8000/! Your medusa API is running at port 9000, and the admin portal is running at port 7000.

Existing Accounts

Type Username (Email) Password Where
User test@test.test test Frontend
Admin admin@medusa-test.com supersecret Admin panel
Minio minioadmin minioadmin Minio console

Backend

The backend of our app (prime generation) is a FastAPI endpoint hosted on Deta.

You can test it out here: https://lpdet4.deta.dev/gentestprime
The documentation for the API endpoint is here: https://lpdet4.deta.dev/docs
Note: An API key is required for production prime generation.

To self host the FastAPI endpoint, run uvicorn main:app --reload, and see your app running at http://127.0.0.1:8000.

An Azure VM hosts an email script to automate the prime checkout process.

Resources