Is a starter kit for react in server side rendering set up using go.
Go to file
Alejandro Lembke Barrientos 7a0e512bbd
Merge pull request #5 from aleleba/PR-988743
PR-988743: Adding support to Prefix url and updating packages.
2023-10-17 12:59:41 -06:00
.github/workflows PR-149165: Fixing cypress. 2023-10-07 03:55:24 +00:00
bin PR-988743: Adding support to Prefix url and updating packages. 2023-10-17 18:56:22 +00:00
config PR-394587: Adding support to custom host. 2023-10-07 04:42:03 +00:00
cypress PR-149165: adding cypress folder. 2023-10-07 03:43:44 +00:00
public First commit creating version 0.0.1 2023-09-22 16:56:31 +00:00
src PR-988743: Adding support to Prefix url and updating packages. 2023-10-17 18:56:22 +00:00
.babelrc First commit creating version 0.0.1 2023-09-22 16:56:31 +00:00
.env.example PR-988743: Adding support to Prefix url and updating packages. 2023-10-17 18:56:22 +00:00
.eslintignore First commit creating version 0.0.1 2023-09-22 16:56:31 +00:00
.eslintrc.js First commit creating version 0.0.1 2023-09-22 16:56:31 +00:00
.gitignore Adding Redux to project, updating to version 0.1.0 2023-10-06 23:13:57 +00:00
cypress.config.ts First commit creating version 0.0.1 2023-09-22 16:56:31 +00:00
jest.config.js First commit creating version 0.0.1 2023-09-22 16:56:31 +00:00
LICENSE First commit creating version 0.0.1 2023-09-22 16:56:31 +00:00
package-lock.json PR-988743: Adding support to Prefix url and updating packages. 2023-10-17 18:56:22 +00:00
package.json PR-988743: Adding support to Prefix url and updating packages. 2023-10-17 18:56:22 +00:00
PRNameGenerator.ts First commit creating version 0.0.1 2023-09-22 16:56:31 +00:00
README.md PR-988743: Adding support to Prefix url and updating packages. 2023-10-17 18:56:22 +00:00
service-worker.ts First commit creating version 0.0.1 2023-09-22 16:56:31 +00:00
serviceWorkerRegistration.ts First commit creating version 0.0.1 2023-09-22 16:56:31 +00:00
setupTest.ts First commit creating version 0.0.1 2023-09-22 16:56:31 +00:00
tsconfig.json First commit creating version 0.0.1 2023-09-22 16:56:31 +00:00
webpack.config.ts Configure the build and the start of the app in prod. Updating to version 0.1.1 2023-10-07 00:55:40 +00:00
webpack.cy.config.ts First commit creating version 0.0.1 2023-09-22 16:56:31 +00:00

Create React SSR

This project aims to have a starter kit for creating a new React app with Server Side Rendering with a backend in go and tools that generally go along with it.

It is not a project like create-react-app, create-react-app is used as a starter kit that handles all your scripts underneath, this is a project for developers who want more control over their application.

Tech(Library or Framework) Version
React (Render Library) 18.2.0
Redux (Global State Management) 4.2.1
React Router DOM (Routing) 6.17.0
Jest (Testing) 29.7.0
Cypress (E2E Testing) 13.3.1
Typescript 5.2.2

Setup

To create a new project run in the terminal:

npx @aleleba/create-react-go-ssr app-name

Then run:

cd app-name

You will need to create a new .env file at the root of the project for global config. This is an exaple of config.

#Environment
ENV= #Default production
#App Port
PORT= #Default 80
#Host
HOST= #Default localhost
#Prefix URL
PREFIX_URL= #Default ''

The default environment is production and the app port defauld is 80.

For Development

In the terminal run:

npm run start-frontend:dev
npm run start-server:dev

The ENV enviroment variable should be "development" and choose the port of your preference with the enviroment variable PORT.

You will find the root component on:

src/frontend/components/App.tsx

You will find the Initial Component on:

src/frontend/components/InitialComponent.tsx

The manage of the routes you should find on:

src/routes

It is using "useRoutes" hook for working, more information for this here: (https://reactrouter.com/docs/en/v6/api#useroutes)

This will start the app in development mode, also it have Hot Reloading! Enjoy coding!

For Production

In the terminal run:

npm run build

It will create a build folder and run:

npm start

This will start the app.

Cheers

Hope you enjoy this proyect! Sincerely Alejandro Lembke Barrientos.