An open API service indexing awesome lists of open source software.

https://github.com/data-miner00/react-rescript-template

An opionionated React template powered by ReScript and Esbuild
https://github.com/data-miner00/react-rescript-template

esbuild react rescript tailwindcss

Last synced: 8 months ago
JSON representation

An opionionated React template powered by ReScript and Esbuild

Awesome Lists containing this project

README

          

[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]






React-Rescript Template


An opionionated React Project Template with Rescript!


Explore the docs »




View Demo
·
Report Bug
·
Request Feature


Table of Contents



  1. About The Project



  2. Getting Started


  3. Usage

  4. Roadmap

  5. Contributing

  6. License

  7. Acknowledgments

## About The Project

![Template screenshot](/public/assets/screenshot.png)

An extremely opinionated template for building React applications with Rescript. Focus on the application itself rather than all these low-level configuration stuffs.

Incentives:

- Wanted to try out Rescript
- Don't want to use `create-react-app`
- Don't want to use Next.js
- Buitl this React template so I can use for other projects.

Of course, no one template will serve all projects since your needs may be different. So I'll be adding more in the near future. You may also suggest changes by forking this repo and creating a pull request or opening an issue. Thanks to all the people have contributed to expanding this template!

(back to top)

### Built With

The technologies and tools used within this template.

- React
- Esbuild
- Rescript
- TailwindCSS

(back to top)

## Getting Started

### Prerequisites

The list of tools that is used when development.

- npm
```sh
npm install npm@latest -g
```
- Pnpm
```sh
npm i -g pnpm
```
- [Git](https://git-scm.com/downloads)

### Installation

_To use this template for personal use or contribution, simply perform the following._ A total of **3 terminals** are required to get 3 of the core components of application up and running for development. However, it is possible to start all the necessary processes with one terminal by using `pnpm dev` as shown on step 4.

1. Clone the repo
```sh
git clone https://github.com/data-miner00/react-rescript-template.git
```
2. Install Node dependencies
```sh
pnpm i
```
3. Optionally update the dependencies
```sh
pnpm up --latest
```
4. Start Esbuild, Tailwind JIT and local dev server concurrently. Skip 5,6,7, 8
```sh
pnpm dev
```
5. Start Rescript watcher (requires 1 terminal)
```sh
pnpm watch:res
```
6. Start Tailwind JIT (requires 1 terminal)
```sh
pnpm watch:tw
```
7. Start Esbuild (requires 1 terminal)
```sh
pnpm watch:esb
```
8. Finally start local dev server (requires 1 terminal)
```sh
pnpm start
```
9. Compile for production
```sh
pnpm build
```
10. Purge dist folder
```sh
pnpm purge
```

(back to top)

## Roadmap

- [x] Add Rescript
- [x] Add 404 page
- [x] Add Styling
- [ ] Sass
- [x] Tailwind
- [x] Dark mode
- [ ] Add PWA Manifest
- [ ] Responsive styles
- [ ] Mobile Sidebar
- [ ] New features page

See the [open issues](https://github.com/data-miner00/react-rescript-template/issues) for a full list of proposed features (and known issues).

(back to top)

## Contributing

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!

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

(back to top)

## License

Distributed under the MIT License. See `LICENSE` for more information.

(back to top)

## Acknowledgments

List of resources that are helpful and would like to give credit to.

- [ReScript](https://rescript-lang.org/)
- [Rescript Cheatsheet](https://yangdanny97.github.io/blog/2022/09/14/rescript-tutorial)
- [The ultimate answer to Belt vs Js in ReScript](https://dev.to/dzakh/the-ultimate-answer-to-belt-vs-js-in-rescript-4dlp)
- [useHooks](https://usehooks.com/)
- [Configuring Public Path](https://esbuild.github.io/api/#public-path)
- [Issue Template](https://github.com/Josee9988/project-template)
- [global is not defined](https://github.com/WalletConnect/walletconnect-monorepo/issues/1144)
- [Router Fix](https://stackoverflow.com/questions/51214294/react-router-refused-to-execute-script-or-styles/51219328#51219328?newreg=9830084f8fd145e9b8397c02a5b85435)
- [How to do document.createElement in ReScript](https://stackoverflow.com/questions/67625468/how-to-do-document-createelement-in-rescript)
- [tinymce/rescript-webapi](https://github.com/tinymce/rescript-webapi)

(back to top)

[contributors-shield]: https://img.shields.io/github/contributors/data-miner00/react-rescript-template.svg?style=for-the-badge
[contributors-url]: https://github.com/data-miner00/react-rescript-template/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/data-miner00/react-rescript-template.svg?style=for-the-badge
[forks-url]: https://github.com/data-miner00/react-rescript-template/network/members
[stars-shield]: https://img.shields.io/github/stars/data-miner00/react-rescript-template.svg?style=for-the-badge
[stars-url]: https://github.com/data-miner00/react-rescript-template/stargazers
[issues-shield]: https://img.shields.io/github/issues/data-miner00/react-rescript-template.svg?style=for-the-badge
[issues-url]: https://github.com/data-miner00/react-rescript-template/issues
[license-shield]: https://img.shields.io/github/license/data-miner00/react-rescript-template.svg?style=for-the-badge
[license-url]: https://github.com/data-miner00/react-rescript-template/blob/master/LICENSE