An opinionated express.js setup using typescript for creating APIs paired with a React frontend also using typescript.
I primarily made this for my own use in an other project but I will be updating it once I add more features to that project.
- MVC architecture (well, no views since it's for APIs only)
- Secure authentication and authorization using tokens
- Prisma ORM
- Redis based message queue (BullMQ)
- Email sending (Nodemailer)
- Easy request validation using zod
- Typed requests
- Exception handling
- Rate limiting middleware using redis
- Support for multiple routes files
- Logging using winston and morgan
- Shared libraries between frontend and backend (validation, respose types, etc)
- User management
- Utils for working with file uploads and downloads
- Permissions system for more complex authorization
- Better configurability for integrating with the frontend
- Websockets using socket.io
- Vite for asset bundling
- Basic configuration of vite for working with the backend conveniently
- Mantine beacuse it's awesome
- Frontend for the default features of the backend (currently only auth)
- Redux for state management and RTK Query for working with the backend api
- React Router for routing
- A simple cli for generating controllers, jobs, react components, etc
- Clone the repository and run
pnpm install
- Copy
.env.example
to.env
and fill in the values in bothapps/backend
andapps/frontend
- Apply prisma migrations and generate the prisma client in
apps/backend
- Run both the backend and frontend with
pnpm dev
in their corresponding directories