Giter Site home page Giter Site logo

manjit683 / ts-fullstack-starter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alaneparisot/ts-fullstack-starter

0.0 0.0 0.0 1.39 MB

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

Home Page: https://ts-fullstack-starter.herokuapp.com

License: MIT License

Shell 0.42% HTML 2.39% TypeScript 96.96% CSS 0.05% JavaScript 0.18%

ts-fullstack-starter's Introduction

TS Fullstack Starter

โญ Motivation

Well, I don't you 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.