Skip to content

Base structure to start any web app at light speed ⚑ Powered by TypeScript, Node.js, and React πŸš€

License

Notifications You must be signed in to change notification settings

alaneparisot/ts-fullstack-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

97 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TS Fullstack Starter

⭐ Motivation

Well, I don't know about you, but for me, when I have an idea, I don't want my time, energy, and motivation to be eaten by some boilerplate hassle or tedious configuration, which can very quickly become very tiresome πŸ₯±

What I want, at least at first, is to move fast and take the shortest path to make my idea real and alive πŸš€

Here comes TS Fullstack Starter πŸŽ‰

Now you have the base structure to start the development of your next fullstack web application at light speed ⚑

Check out the demo! Note: You can log in by submitting test as username and password.

πŸ“… Update (December 2021)

Software crafting is a never-ending challenge, with always more modern ways to do things, especially in the fast-paced JavaScript environment. In December 2021, considering what I’ve learned since the beginning of this project, there are things I would do differently:

  • I would use Apollo GraphQL combined with TypeGraphQL, or at least RTK Query, for productivity reasons.
  • I would use PostgreSQL combined with TypeORM, for performance reasons.
  • I would use Redis to handle session-based authentication, for security reasons.
  • And many other things, but I try not to be too hard with myself πŸ˜„

Anyway, for a starter project, good enough is good enough, and done is better than perfect βœ…

✨ Features

🏭 Architecture

🧱 Backend

src
β”œβ”€β”€ __tests__
β”œβ”€β”€ components
β”‚   β”œβ”€β”€ auth
β”‚   β”œβ”€β”€ logs
β”‚   └── users
β”œβ”€β”€ config
β”œβ”€β”€ loaders
β”‚   β”œβ”€β”€ api
β”‚   β”œβ”€β”€ database
β”‚   β”œβ”€β”€ errorHandler
β”‚   β”œβ”€β”€ middlewares
β”‚   β”œβ”€β”€ server
β”‚   └── app.ts
β”œβ”€β”€ types
β”œβ”€β”€ utils
└── index.ts

🧱 Frontend

client
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ __tests__
β”‚   β”œβ”€β”€ app
β”‚   β”‚   β”œβ”€β”€ App.tsx
β”‚   β”‚   β”œβ”€β”€ store.ts
β”‚   β”‚   └── theme.ts
β”‚   β”œβ”€β”€ components
β”‚   β”‚   β”œβ”€β”€ styled
β”‚   β”‚   β”‚   └── StyledLink.tsx
β”‚   β”‚   β”œβ”€β”€ ErrorFallback.tsx
β”‚   β”‚   β”œβ”€β”€ Page.tsx
β”‚   β”‚   β”œβ”€β”€ PageFallback.tsx
β”‚   β”‚   β”œβ”€β”€ ProcessButton.tsx
β”‚   β”‚   β”œβ”€β”€ Spinner.tsx
β”‚   β”‚   └── TopBar.tsx
β”‚   β”œβ”€β”€ features
β”‚   β”‚   β”œβ”€β”€ auth
β”‚   β”‚   β”œβ”€β”€ home
β”‚   β”‚   └── user
β”‚   β”œβ”€β”€ types
β”‚   └── utils
β”‚       └── test-utils.tsx
β”œβ”€β”€ i18n.ts
└── index.tsx

πŸƒ Getting Started

πŸ”§ How to Fork

  • Import code directly on GitHub.
  • Delete .git folder.
  • Delete .git folder in client folder.
  • $ git init
  • Change git remote.
  • Update package.json.
  • Update README.md.
  • On MongoDB Atlas, create a new project.
  • In this new project, create a new user.
  • In this new project, create a database (main), and a collection (users).
  • Create a .env file.
  • In .env file, fill AUTH_ACCESS_TOKEN_SECRET property.
  • In .env file, fill DATABASE_URI property, with user password, and database.
  • $ git checkout -b main
  • $ git add .
  • $ git commit -m "Initial commit"
  • $ git push -u origin main

⚠️ Warnings

client > package.json

  • Add INLINE_RUNTIME_CHUNK=false before script react-scripts build.
  • Write set INLINE_RUNTIME_CHUNK=false&&react-scripts build for Windows.
  • Set proxy value (port should match default value in src > config > index.ts).

src > tests

  • Global environment variables are defined in src > utils > test-utils.ts.
  • You may need to add jasmine.DEFAULT_TIMEOUT_INTERVAL = 600000 to be able to download MongoDB binaries.

src > config > index.ts

  • Server port should be read from the variable name PORT in process.env.PORT.
  • Server port default value should match port value in client > package.json > proxy.

src > loaders > errorHandlers.ts

  • Avoid JSON.stringify() error.
  • Keep _next in the method catching Express middleware errors.

package.json

  • Avoid naming a script install.

πŸ“„ License

This project is MIT licensed.

About

Base structure to start any web app at light speed ⚑ Powered by TypeScript, Node.js, and React πŸš€

Topics

Resources

License

Stars

Watchers

Forks

Languages