Welcome to the Fullstack Authentication Boilerplate repository! This boilerplate provides a robust foundation for building secure, full-stack web applications with authentication features. It combines the power of Express.js and MongoDB on the backend with Next.js on the frontend, all written in TypeScript. Additionally, it includes Jest for testing, SendGrid for sending emails, Framer Motion for animations, and Formik for form handling, Playwright for E2E tests.
- Authentication: Implement a complete user authentication system with registration, login, password reset, and account activation.
- Express.js Backend: Utilize Express.js to create a scalable and RESTful API.
- MongoDB Database: Store user data securely in a MongoDB database.
- JWT Authentication: Secure your API endpoints with JSON Web Tokens (JWT).
- Email Verification: Send verification emails to users during registration.
- Password Reset: Enable users to reset their passwords through email.
- Testing: Use Jest for unit and integration testing to ensure code reliability.
- Frontend with Next.js: Develop a modern and responsive user interface with Next.js.
- Framer Motion: Add smooth animations and transitions to enhance the user experience.
- Formik: Simplify form handling and validation on the frontend.
- TypeScript: Ensure type safety throughout the application for improved development productivity.
- Playwright: E2E coveradge
To get started with this boilerplate, follow these steps:
- Clone the repository to your local machine:
git clone [email protected]:drejcreative/Next.js-Express.js-MongoDB-Authentication-Boilerplate-code-2023-24.git- Install backend dependencies and create an
.envfile (example provided):
cd auth-boilerplate/api
npm install
cp .env.example .env- Start the backend server:
npm run dev- Install frontend dependencies:
cd ../app
npm install- Start the frontend development server:
npm run devNow you have a fully functional authentication boilerplate running locally. You can start building your application on top of this foundation.
This boilerplate includes a comprehensive testing setup using Jest. To run the tests, use the following command:
cd api
npm run testcd app
npm run test |or| npm run test:uiContributions to this project are welcome! Whether you want to fix a bug, add a feature, or improve documentation, please feel free to open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
- This boilerplate was inspired by the need for a reliable and secure foundation for authentication in web applications.
- Many thanks to the open-source community for providing tools and libraries that make projects like this possible.
If you have any questions or run into any issues, please don't hesitate to reach out. Happy coding!
