A full-stack web application built with Next.js for managing invoices. This project includes functionalities for creating, editing, and viewing invoices, leveraging the capabilities of Next.js, Tailwind CSS, and Firebase for a seamless user experience.
- Create new invoices
- Edit existing invoices
- View invoice details
- Responsive design with Tailwind CSS
- State management with Redux Toolkit
- Authentication and data storage with Firebase
- Next.js Middleware for handling requests
To install and set up this project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/Valik3201/nextjs-invoice-app.git cd nextjs-invoice-app
-
Install dependencies:
npm install
-
Set up Firebase:
- Create a Firebase project at Firebase Console.
- Add your Firebase configuration to the project.
-
Run the development server:
npm run dev
-
Open your browser and navigate to
http://localhost:3000
.
To access the app, users need to authenticate. You have three sign-in options:
- Email and Password: Enter your credentials directly.
- Sign in with Google: Use your Google account to sign in.
- Sign in with Facebook: Use your Facebook account to sign in.
- Navigate to the "Create Invoice" page.
- Fill out the required details.
- Save the invoice.
- Select an invoice from the list.
- Click on "Edit."
- Modify the details as necessary.
- Save your changes.
To view an invoice, simply select it from the list to see its details.
On the profile page, users can manage their account settings:
- Change Name: Update your displayed name.
- Change Email: Modify your registered email address.
- Verify Email: Confirm your email address.
- Change Avatar: Upload or adjust your profile picture with cropping functionality.
- Change Password: Update your login password.
If you forget your password, visit the "Forgot Password?" page on the Sign-In screen for assistance.
- Next.js: Framework for server-rendered React applications
- React: JavaScript library for building user interfaces
- Tailwind CSS: Utility-first CSS framework
- TypeScript: Typed superset of JavaScript
- Redux Toolkit: State management
- Firebase: Backend as a Service for authentication and database
This project demonstrates fullstack capabilities by integrating frontend development with backend services using Firebase. The app handles user authentication, data storage, and server-side rendering efficiently.
Next.js middleware manages authentication and route protection in the project:
-
Authentication Check: Verifies the presence of a token (
__token__
) in request cookies. -
Route Protection: Defines which routes (
publicRoutes
andprotectedRoutes
) require authentication. -
Redirect Logic:
- Authenticated: Redirects from public routes to the homepage (
/
); allows access to protected routes. - Not authenticated: Redirects from protected routes to the signin page (
/signin
).
- Authenticated: Redirects from public routes to the homepage (
-
Configuration:
- Uses a
matcher
to exclude specific routes (/api
,_next/static
,_next/image
,favicon.ico
).
- Uses a
Customize publicRoutes
and protectedRoutes
as needed for your application's routing requirements.
- Create Full Stack App with Next.js and Firebase
- Personal Movie Bookmark Application
- Image Upload Modal in React
- Next.js Documentation
- Redux Documentation
- Firebase Documentation
We welcome contributions to enhance the project. To contribute:
- Fork the repository.
- Create a new branch:
git checkout -b my-feature-branch
- Make your changes and commit them:
git commit -m 'Add some feature'
- Push to the branch:
git push origin my-feature-branch
- Open a pull request.
For any inquiries or support, please reach out to the project maintainer at [email protected].
Special thanks to Frontend Mentor for providing the challenge that inspired and guided this project. Their platform provides a great opportunity to practice frontend development skills and showcase projects.
Don't forget to give the project a star! ⭐️ Thanks again!