Coder Social home page Coder Social logo

zeekrey / teini Goto Github PK

View Code? Open in Web Editor NEW
149.0 2.0 10.0 46.94 MB

👶 Teini (tiny, [ˈtīnē]) is an extremely small webshop leveraging awesome and free solutions like Github and Vercel.

Home Page: https://teini.vercel.app

License: MIT License

TypeScript 97.89% JavaScript 2.11%
ecommerce nextjs vercel stripe typescript

teini's Introduction

Teini

Teini (tiny, [ˈtīnē]) is an extremely small webshop leveraging awesome and free solutions like Github and Vercel.

Main purpose is to get you started fast and cheap. Hit the deploy button to create your own version of Teini or see a working demo here: https://teini.vercel.app/

Deploy with Vercel

Installation

...if you're not a developer

💡 If you need help at any stage contact me. If you want me to setup Teini contact me as well.

Accounts needed

Running Teini should be easy and for free. Although you'll need to create some accounts to make it work:

Account Description/What it does Link
Vercel Deploys and keeps the actual website running. It's awesome. https://vercel.com/
Stripe Provides the whole checkout and payment infrastructure. It's awesome, too. https://stripe.com
Github/Gitlab The place where the source code is stored. Awesome - yep. https://github.com

🤑 While Vercel and Github should be free while respecting their fair use policies, Stripe will cost some money. Fortunately, these are transaction-dependent.

Environment Variables

To configure your store you need to set some meta data and credentials upfront. The following data needs to be set:

Environment Variable Description Default
STRIPE_SECRET_KEY The Stripe secret key: https://stripe.com/docs/keys#obtain-api-keys
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY The Stripe publishable key: https://stripe.com/docs/keys#obtain-api-keys
SHOP_NAME Will show up in the browser tab and in the seo config.
SHOP_CONTACT A way customers can contact your. Could be an email or a Twitter handle. Will show up in the footer.
SHOP_HEADLINE Will show up on the index (start) page and in the seo config.
SHOP_SUBHEADLINE Will show up on the index (start) page and in the seo config.

Once you got everything together you can finally deploy your own version for Teini:

Deploy with Vercel

Usage

Once your store is up and running you definitly what to add your own products. Here is how to do this:

1. Access the repository

To make changes you need to access the repository and change the actual source code. To do this you'll need the following tools (all of them are for free):

Once you got everything installed open a terminal and type the following command:

git clone https://github.com/username/reponame

💡 The repo url depends on your choosen service, username and repo name.

2. Make changes to the product database

Open Prisma Studio and open the product.db file. It is located at the root level of your repo and called products.db. Once the database add, update or delete products.

3. Add product images

Teini holds all its static files like product images in the public folder. Product images in particular are store under public/prodcuts/[productid]. To add product images you just need to add a folder with the corresponding product-id (see your products.db) and put all product images in there.

💡 Google recommends using the WebP as image format. You can convert your files here: https://cloudconvert.com/webp-converter

3. Make changes to the store itself

Open a terminal and navigate (cd) to your local repository copy. Run this command:

code .

Now VSCode should open and you can change what ever you want.

4.Push your changes

To make your changes visible you need to run the following commands:

git add .
git commit -m "A message describing your work like; Added images for product 1."
git push

If your go to https://vercel.com and open your project you should see that a deployment is started. If it is successfull you customers can see your changes. If it failed feel free to create an issue: https://github.com/zeekrey/teini/issues/new/choose

...if you're a developer

Clone, Edit, Push. Do what ever you want.

Notes

Credits for the used photos:

Product photos Photo by Boxed Water Is Better on Unsplash

Success Page photo Photo by Jason Dent on Unsplash

teini's People

Contributors

zeekrey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

teini's Issues

Question: Why remove zustand?

Hi!
I've been walking through the teini repo and it has been a wonderfully simple example to follow for nextjs, Vercel and stripe integration! (Not to mention stitches!) Thank you!

I noticed you recently removed zustand and was just interested to hear why?

Did you have issues or found it more complicated than the context API?

I was planning on using the jotai library from the same creators.. but just curious to hear first hand experience 😁

Configure Stripe Checkout via env var

Add the following env vars and reference them within the checkout call.

  • STRIPE_SHIPPING_ADDRESS_REQ = True if a shipping address should be gathered via stripe
  • STRIPE_SHIPPING_COUNTRIES = ISO country codes seperated by '-'

Create tutorial and link it to deploy button

Create a tutorial which covers the following steps:

  • How to add products
  • How to product images
  • How to change something

Create a markdown file, put in the repo and put this reference in the deploy button.

Add configurable meta data

The following data should be controlled via env vars:

  • SHOP_NAME = The shop name
  • SHOP_CONTACT = A eMail address users can contact in case of trouble
  • SHOP_HEADLINE = The headline that shows up on the index page
  • SHOP_SUBHEADLINE = The subheadline that shows up on the index page

Add shipping data

  • Add shipping table: shipping type, costs, isFreeFrom,...
  • Show shipping selection on cart page
  • Add shipping costs to checkout amount

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.