This is an example of a simple checkout with Stripe that uses React for the frontend application and Genezio for deploying and developing the backend.
Inside the project folder, you will find the following files and folders:
├── server/
│ ├── StripeHandler.js
│ └── package.json
├── client/
│ ├── README.md
│ ├── dist
│ ├── index.html
│ ├── node_modules
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ ├── src
│ └── vite.config.ts
├── genezio.yaml
├── README.md
├── .genezioignore
└── tsconfig.json
Genezio looks for genezio.yaml
to read the settings for deploying the project or for spinning a local dev server for testing.
The backend
directory contains the implementation of the server side of the project.
The frontend
directory contains a simple NodeJS application that talks with the genezio server.
To glue this two component together, an auto-generated SDK is installed in the client/node_modules
folder.
This can be used by simply importing it into the frontend source code like any other dependency of your project.
Clone the repository:
git clone https://github.com/Genez-io/genezio-examples
Navigate to the following directory:
cd ./genezio-examples/javascript/stripe-js
Test the project locally:
genezio local
Open a new terminal, navigate to the following directory, and run npm start to launch the React application:
cd ./client
npm run dev
If you wish to deploy your project to the Genezio infrastructure, follow these steps:
Log in to Genezio using the command genezio login:
genezio login
Deploy your project using the genezio deploy command from the ./genezio-examples/javascript/stripe-js
directory.
genezio deploy
All commands are run from the root of the project, from a terminal:
Command | Action |
---|---|
npm install -g genezio |
Installs genezio globally |
genezio login |
Logs in to genezio |
genezio local |
Starts a local server |
genezio deploy |
Deploys a production project |
genezio --help |
Get help using genezio |
Check out:
If you need support or you have any questions, please join us in our Discord channel. We'd love to chat!