TechSphere is a pet project that I created to learn new technologies and improve my skills. Specifically, I wanted to learn how to use Sanity.io as a headless CMS, how to use GraphQL with React, and refresh my knowledge of Redux Toolkit.
View Site
·
Report Bug
·
Request Feature
Table of Contents
This project is a simple ecommerce website that allows users to browse products, add them to cart, and checkout. It is built with React.js and Sanity.io as a headless CMS. It uses GraphQL to query data from Sanity.io. It also uses Redux Toolkit for state management and Stripe for payments.
There is also a blog, which is built with Sanity.io and GraphQL. It allows users to read blog posts and admins to create, edit, and delete blog posts.
The website is fully responsive and works on all screen sizes.
- Sanity.io - I have never used Sanity.io before, so I had to learn how to use it as well as integrating headless CMS with React application. I also had to learn how to use GraphQL with Sanity as it has some specific syntax.
- GraphQL - I have never used GraphQL before, so I had to learn how to use it with React. It wasn't too difficult as I already knew how API work. In the end, I decided to use Apollo Client and a GraphQL codegen plugin for generating types from GraphQL queries.
To get a local copy up and running follow these simple example steps.
- Clone the repo
git clone https://github.com/v-mokhun/ecommerce-frontend.git .
- Install NPM packages
npm install
- Run the app (Will not work without environment variables)
npm run dev
- Create a .env file in the root of the project and copy all contents from .env.example file.
- Register an account on Sanity.io and create a new project. You can use the free plan. Then insert api url into VITE_API_URL variable.
- Register an account on Stripe.com and create a new project. You can use the free plan. Then insert public key into VITE_STRIPE_PUBLISHABLE_KEY variable.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Project Link: https://ecommerce-frontend.up.railway.app