rsmern
v0.2.4
Published
Simple MERN Stack template generator written completely in Javascript.
Maintainers
Readme
RSMERN
Simple MERN Stack template generator written completely in Javascript.
Quick Links
Usage
Install the package globally by doing:
npm install -g rsmernCreate a new project by executing:
rsmern init <project-name>Backend Specific Features
Create a new feature by executing:
cd <project-name>/backend
rsmern create:feature <featurename>Example: The command
rsmern create:feature categorywill create a CategoryModel insrc/models, a CategoryController insrc/controllersand a CategoryRouter insrc/routers. Note that, it doesn't actually add it to the API Router, you'll have to do that manually by editing thesrc/routes.tsfile.
// In: src/routes.ts
...
import CategoryRouter from "./routers/category_router";
...
...
export function ApiRouter() {
const router = Router();
// Add your router here like this..
router.use("/category", CategoryRouter());
...
return router;
}
...
...NOTE: The
create:featurecommand is only meant for the backend. Make sure to change the current directory to backend before proceeding.
Other Commands
npm run watch => Launches the tsc compiler in watch mode
npm run dev => Launches the development server using NodemonIt is recommended to open two terminal windows. One for
npm run watchand another one fornpm run devfor the best dev experience.
Frontend Specific Features
The frontend is generated using Vite and has TailwindCSS already set up.
You can start by editing src/screens/index.jsx.
NOTE: Running
npm run buildin the frontend directory will automatically build the static files and place them insidebackend/publicfor serving.
