Is a starter kit for react in server side rendering set up.
Go to file
2024-11-13 09:15:18 -06:00
.github/workflows PR-640209: Updating packages. 2024-11-13 15:09:14 +00:00
.vscode Updating npm packages. 2022-05-19 13:57:17 +00:00
bin PR-640209: Updating packages. 2024-11-13 15:09:14 +00:00
config PR-420915: Changing the logic for aliases for one source of truth on tsconfig.json and updating packages. 2023-02-21 00:10:34 +00:00
cypress PR-579798: trying to fix Cypress component testing. 2023-03-07 12:19:15 -06:00
public PR-049111: making mayor change for add support to prefix url. 2023-02-10 21:09:27 +00:00
src PR-012419: fixing issue of routing of subroute and updating dependencies. 2024-08-29 02:59:06 +00:00
.babelrc PR-753737: Se saca el proyecto al directorio Raíz y se actualizan dependencias. 2022-04-28 21:37:20 +00:00
.env.example PR-049111: making mayor change for add support to prefix url. 2023-02-10 21:09:27 +00:00
.eslintignore PR-579798: Adding Component cypress testing. 2023-03-07 11:03:19 -06:00
.eslintrc.js PR-753737: Se saca el proyecto al directorio Raíz y se actualizan dependencias. 2022-04-28 21:37:20 +00:00
.gitignore PR-579798: trying to fix Cypress component testing. 2023-03-07 11:26:35 -06:00
.npmrc PR-001838: Actualización de tokens de autenticación de NPM y versión de paquete 2024-02-13 23:51:28 +00:00
cypress.config.ts PR-579798: trying to fix Cypress component testing. 2023-03-07 12:19:15 -06:00
jest.config.js PR-579798: Fixing unit testing. 2023-03-07 11:11:45 -06:00
LICENSE PR-753737: Moviendo Licence a raíz. 2022-04-13 20:17:54 +00:00
package-lock.json PR-640209: Updating packages. 2024-11-13 15:09:14 +00:00
package.json PR-640209: Updating packages. 2024-11-13 15:09:14 +00:00
PRNameGenerator.ts Fixing some errors and deleting unnesessary code. 2022-05-23 15:02:21 +00:00
README.md PR-003293: Updating packages. 2024-09-18 18:03:42 +00:00
service-worker.ts Adding final files from js to ts. 2022-05-24 14:09:48 +00:00
serviceWorkerRegistration.ts PR-753737: Se saca el proyecto al directorio Raíz y se actualizan dependencias. 2022-04-28 21:37:20 +00:00
setupTest.ts PR-421183: Adding Cypress and updating packages. 2023-03-02 07:57:42 -06:00
tsconfig.json PR-228725: Updating packages. 2023-10-09 19:01:50 +00:00
webpack.config.dev.server.ts PR-180453: adding support for sass modules and updating packages. 2023-11-22 14:51:09 +00:00
webpack.config.dev.ts PR-180453: adding support for sass modules and updating packages. 2023-11-22 14:51:09 +00:00
webpack.config.ts PR-180453: adding support for sass modules and updating packages. 2023-11-22 14:51:09 +00:00
webpack.cy.config.ts PR-180453: adding support for sass modules and updating packages. 2023-11-22 14:51:09 +00:00

Create React SSR

This project aims to have a starter kit for creating a new React app with Server Side Rendering 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.3.1
Redux (Global State Management) 5.0.1
React Router DOM (Routing) 6.26.2
Jest (Testing) 29.7.0
Cypress (E2E Testing) 13.14.2
Typescript 5.6.2

Setup

To create a new project run in the terminal:

npx @aleleba/create-react-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
#PUBLIC URL
PUBLIC_URL= #Default 'auto'
#Prefix URL
PREFIX_URL= #Default ''
#ONLY EXACT PATH
ONLY_EXACT_PATH= #Default false

The default environment is production, the app port defauld is 80 and the default public url is "auto", use prefix url if you want a prefix on base url, use exact path to validate if you want to have strict exact paths.

For Development

In the terminal run:

npm run start: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:

scr/frontend/components/App.tsx

You will find the Initial Component on:

scr/frontend/components/InitialComponent.tsx

The manage of the routes you should find on:

scr/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.