Skip to content

IGNE-Agency/vite-react-template

Repository files navigation

Vite React Template

A template for quick-starting any React app.

Table of Contents

🏃‍♂️ Getting started

To run this project, use bun:

# Install dependencies
bun install
bun run gen
bun run dev

🟢 OpenAPI

If the api endpoints changed, you need to re-generate the api-related files.

# Run code generators for API schemas and validators
bun run gen

This will read the provided openapi spec and generate some files. These files provide typesafe API clients and form validators.

⚠️ The provided spec is an example. You should delete openapi.json and reference your own OpenAPI specification by changing the input in heyapi.config.ts

💻 Editor setup

Most of us work with VSCode or clones thereof. Project settings are applied automatically. Make sure you've installed the BiomeJS and prettier editor extensions. They let your editor format files.
You should find them in the "Recommended" section of the extensions tab.

If you use another editor, the same applies: make sure it understands how to format according to the Biome & prettier configs.

🚀 Deployments

🔁 Github Workflows / Bitbucket pipeline (todo)

Use the provided Github Workflows, just add the last step in .github/workflows/deploy_develop.yml.

🛠️ DIY

If you want to do it yourself, run the following command(s):

# Install the exact versions of each package specified in the lockfile for reproducible installs.
bun install --frozen-lockfile
# If you are deploying for production, remove the mode parameter
bun run build --mode develop

The app is now built in ./dist and ready to be hosted.

⚠️ Note that the web app is configured to send requests to the server it's hosted on. This is to prevent CORS issues while developing our projects.

In order to support this, the server must reverse proxy requests according to the following rules in vite.config.ts:

"/api": "https://api.example.CHANGE_ME.com/api/v1",
"/oauth2": "https://CHANGE_ME.exampleauthservice.com/v3/oauth2"

About

A template for quick-starting any React app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •