Is a starter kit for react in server side rendering set up.
Go to file
Alejandro Lembke Barrientos 442f5ae9ee
Merge pull request #23 from aleleba/PR-973353
PR-973353: Trying to solve remove bin from package.json
2022-08-03 11:48:04 -06:00
.github/workflows PR-926282: updating packages and fixing CI commands. 2022-08-01 15:02:40 +00:00
.vscode Updating npm packages. 2022-05-19 13:57:17 +00:00
bin PR-973353: Trying to solve remove bin from package.json 2022-08-03 17:46:08 +00:00
config Passing Test, routes and config to ts and tsx format. 2022-05-23 15:32:14 +00:00
public PR-753737: Se saca el proyecto al directorio Raíz y se actualizan dependencias. 2022-04-28 21:37:20 +00:00
src Updating packages and using scss. 2022-07-07 04:36:26 +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-753737: Se saca el proyecto al directorio Raíz y se actualizan dependencias. 2022-04-28 21:37:20 +00:00
.eslintignore Updating packages and fixing eslingignore. 2022-05-26 13:29:27 +00: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-753737: Se saca el proyecto al directorio Raíz y se actualizan dependencias. 2022-04-28 21:37:20 +00:00
jest.config.js Updating packages and using scss. 2022-07-07 04:36:26 +00:00
LICENSE PR-753737: Moviendo Licence a raíz. 2022-04-13 20:17:54 +00:00
package-lock.json PR-057563: updating package and removing bin command from package json on npx. 2022-08-03 14:56:13 +00:00
package.json PR-973353: Trying to solve remove bin from package.json 2022-08-03 17:46:08 +00:00
PRNameGenerator.ts Fixing some errors and deleting unnesessary code. 2022-05-23 15:02:21 +00:00
README.md Updating packages. 2022-07-13 18:35:09 +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 Adding final files from js to ts. 2022-05-24 14:09:48 +00:00
tsconfig.json Changing server.js to server.jsx 2022-05-24 13:49:35 +00:00
webpack.config.dev.server.ts Change webpack configs to ts. 2022-05-24 02:08:23 +00:00
webpack.config.dev.ts Changing server.js to server.jsx 2022-05-24 13:49:35 +00:00
webpack.config.ts Adding final files from js to ts. 2022-05-24 14:09:48 +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.2.0
Redux (Global State Management) 4.2.0
React Router DOM (Routing) 6.3.0
Jest (Testing) 28.1.3
Typescript 4.7.4

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=development #Default production
#App Port
PORT=3000 #Default 80
#PUBLIC URL
#PUBLIC_URL= #Default /

The default environment is production, the app port defauld is 80 and the default public url is "/".

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.