Skip to content

Feat: Migration to Vite & Live Preview Updates #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Browsers that we support

# For production
last 2 versions
not dead
> 0.5%
not IE 11

# For development
last 1 chrome version
last 1 firefox version
last 1 safari version
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# production
/build
/dist

# misc
.DS_Store
Expand Down
10 changes: 10 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,14 @@ fileignoreconfig:
- filename: .github/workflows/secrets-scan.yml
ignore_detectors:
- filecontent
- filename: src/vite-env.d.ts
checksum: ffda6404f84b35b7e81317ddebcbe69cb2b1aed2727c61a58217dcbb475aaf15
- filename: index.html
checksum: c285279b74fe0f3b7b387049dceeb5634f4a0a3431bdcca5fdef35c360ac2101
- filename: package-lock.json
checksum: 62297ed5002d10755b01385713562cfb3f78e1032e38f15f8f433c0e00a4fd71
- filename: src/sdk/utils.ts
checksum: 00fb0674684ede99467f5d77012d92136481d54c75894768646e58703ae0fa5a
- filename: src/sdk/entry.ts
checksum: 33b8aa8ad61a79911b22c61b418094034b308ca96bdebdc2619398337433fa1d
version: "1.0"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Contentstack
Copyright (c) 2025 Contentstack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
[![Contentstack Logo](/public/contentstack.png)](https://www.contentstack.com/)


# Build a Starter Website with React.js and Contentstack

About Contentstack: Contentstack is a headless CMS with an API-first approach that puts content at the centre. It is designed to simplify the process of publication by separating code from content.

About this project: React.js is a JavaScript library for dynamic websites with rich user interfaces. This guide will help you create a starter marketing website built using the React.js framework with minimal steps.


![contentstack-react-starter-app-vercel-app](/public/starter-app.png)


## Live Demo

You can check the [live demo](https://contentstack-react-starter-app.vercel.app/) to get first-hand experience of the website.


## Tutorial

We have created an in-depth tutorial on how you can create a React.js starter website using Contentstacks Node.js SDK and fetch its content from Contentstack.
We have created an in-depth tutorial on how you can create a React.js starter website using Contentstack's Node.js SDK and fetch its content from Contentstack.

[Build Website using React.js and Contentstack](https://www.contentstack.com/docs/developers/sample-apps/build-a-starter-website-using-react-js-and-contentstack/)

## More Resources

- [Contentstack Documentation](https://www.contentstack.com/docs/)
- [Region Support Documentation](https://www.contentstack.com/docs/developers/selecting-region-in-contentstack-starter-apps)
- [React.js Documentation](https://reactjs.org/docs/getting-started.html)

## Build System

**More Resources**
This project uses [Vite](https://vitejs.dev/) as a build tool for faster development and production builds. Vite offers:

Read Contentstack [docs](https://www.contentstack.com/docs/)
- Lightning-fast cold server start
- Instant hot module replacement (HMR)
- True on-demand compilation
- Out-of-the-box TypeScript support

Region support [docs](https://www.contentstack.com/docs/developers/selecting-region-in-contentstack-starter-apps)
## Development Commands

Learn about [React.js](https://reactjs.org/docs/getting-started.html)
- **Development Server**: Run `npm run dev` or `npm start` to start the development server
- **Production Build**: Run `npm run build` to create an optimized production build
- **Preview Production**: Run `npm run preview` to locally preview the production build
25 changes: 25 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Contentstack React Starter App" />
<link rel="apple-touch-icon" href="/icon/icon-192x192.png" />

<link href="https://fonts.googleapis.com/css?family=Inter&amp;display=swap" rel="stylesheet" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta2/css/all.min.css" integrity="sha512-YWzhKL2whUzgiheMoBFwW8CKV4qpHQAEuvilg9FAn5VJUDwKZZxkJNuGM4XkWuk94WCrrwslk8yWNGmY1EduTA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="manifest" href="/manifest.json" />

<title>Contentstack-React-Starter-App</title>
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
Loading
Loading