1.0.2 • Published 1 year ago

react-ts-mern-template v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Quickstart

$ npx react-ts-mern-template <your-app-name>

Project Starter 🚀

MERN app template + Vite + TypeScript + Testing Library, with ESLint and Prettier configs, and a RESTful API with full CRUD functionality for a user database.

This template is designed for anyone wanting to build a full stack web application and immediately focus on writing the code, rather than spending time creating folders, files, configs and databases. All packages needed are included in the package.json files and can be installed with one command from the top level (see further below).


Info 🤓

Template includes:

  1. React with TS & Vite configuration
  2. ESLint and Prettier (airbnb)
  3. Concurrently npm package
  4. React Router
  5. Template frontend file structure
  6. Template CSS file structure with generic variables (not setup with a library in mind)
  7. Template server file structure with example Rest API for a user database
  8. JWT, bcrypt, CORS and auth middleware
  9. .env template file which includes the variables you need to fill in with your info
  10. React testing library, vitest + MSW
  11. Module aliases for client and server folders

Note: you will need to create a MongoDB database collection, and input info into the .env file provided.


Clone Repo 😎😎

Navigate to where you want to store the repo, then npm install all node modules

$ git clone https://github.com/pipelineSoftwareTeam/react-ts-mern-template.git

$ cd mern-app-template
$ npm run setup

Spinning up project 🚗

Client (individually):

$ npm run dev

Server (individually):

$ npm run dev

or using Concurrently...

From top level of project:

$ npm run dev

From server folder:

$ npm run serve

API endpoints

FunctionalityRouteHTTP MethodProtected?
Get users/api/authGETY
Login user/api/auth/loginPOSTN
Register user/api/auth/registerPOSTN
Update user/api/auth/:idPUTY
Update user password/api/auth/password/:idPUTY
Delete user/api/auth/:idDELETEY

Any protected routes require a JWT bearer token in the HTTP request header.


Romeo done! Happy coding 💪🏻

Please send a PR for any suggestions for improvement to this template 😃

Contributors 👇🏻

portfolio portfolio

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago