Build a real fullstack app (backend+website+mobile) in 100% Typescript
Build a real fullstack app (backend+website+mobile) in 100% Typescript
Live Demo: https://hd283.net/
| Supported Clients | Preview |
|---|---|
| Web | |
| Web (Mobile) | |
| Android | |
| iOS |
This project built a real blog app for all platforms in TypeScript.
TypeScript is a typed super set of JavaScript. If you are new to TypeScript it is highly recommended to become familiar with it first before proceeding. You can check out its documentation here.
MERN stands for MongoDB, Express.js, React/ReactNative, and Node.js.
TypeScript has brought the following benefits to MERN:
Not only using TypeScript, but this project is also featured by:
User as well as Article. This is a real starter for who would like to build a blog app or extend it to a community app using MERN.To build and run this app locally you will need a few things:
git clone https://github.com/shanhuiyang/TypeScript-MERN-Starter.git cd
yarn(you'll probably have to start another command prompt)
mongodNote! While you just installed MongoDB (for both on OSX or Windows), it may remind you that you can run MongoDB as service, then your MongoDB will always be running even after you restart your computer.
yarn startFinally, navigate to http://localhost:3000 and you should see the blog page being served and rendered locally!
Note! You cannot open the localhost website on IE and Edge browser. In contrast, you can open it on Safari, Firefox, and Chrome. However, we will ensure the compatibility of the production app on IE and Edge browser.
The command yarn start will also start the react-native project using expo-cli.
So you can navigate to http://localhost:19002 and you will see the Expo DevTool page.
From that page you can easily start your app for both Android and iOS by clicking corresponding buttons.
For more detail of prerequisite please refer to Installation of Expo document.
Briefly speaking, you should prepare for devices you would like to debug on, either emulator/simulator or physical devices.
[TODO] Elaborate this part.
Note! Currently you cannot test Android app on emulator without configure the host url manually. This is because in Android emulator you cannot access
http://localhostwhich hosted on the same server/PC/Mac. You can test your app in the same LAN, see next section for detail.
By default the request url connect client and service are http://localhost, i.e. you can only test client and service in the same server/PC/Mac.
To test your app in LAN, you can do following before enter command yarn start.
HOST_NAME_DEV in client/core/src/models/HostUrl.ts with the IP address you got.This project implement the auth service, as well as account verification by sending OTP to user's registered email account.
By default the account verification is turned off since SMTP transporter is not configured with account and password.
To test this part of functionality, you can:
true in client/core/src/shared/constants.ts.Up to 2020, React is the most popular front-end framework. For novice web developers, if they would like to build a full-stack project using Javascript, they can intuitively choose the combination of Node.js and React.
Typescript is a success Javascript alternative which can keep the maintainability as the project grows. The most famous Typescript project is Angular. Nowadays React also support Typescript officially.
Therefore, the motivation of this project is building a fullstack web app using Typescript, then we can maintain and extend a web app easily.
On the other hand, we have seen the template like TypeScript-Node-Starter, TypeScript-React-Starter, and TypeScript-React-Native-Starter. What if we mixed these 3 projects together? How could Typescript shows its advantage if we use it across client & server? So this project is intended to explore the capability of Typescript in that circumstance.
mern-starter is a famous project which combine React and Node.js in a single project.
However, it is deprecated after April, 2019.
This project is a server rendering solution.
It modeled the Post object, but did not implement the authentication module.
TypeScript-Node-Starter is an officially built starter project for Node.js by Microsoft. This project is a good starter for Node.js app using Typescript. It is also a server rendering solution, using pug.
Indeed TypeScript-MERN-Starter is built on top of TypeScript-Node-Starter. However, as you can see in TypeScript-MERN-Starter, the architecture has been totally changed comparing to TypeScript-Node-Starter.
oauth2api is a good example on how to implement OAuth2 strategy in an Node.js app. We almost totally imported this project to TypeScript-MERN-Starter.
We build this project on following philosophies:
We have already extended this project from MERN to MERRN, where the additional R stands for ReactNative.
In next period of time (Before end of Fe
No open issues yet, or sync has not completed.