Skip to content

Commit bb193f9

Browse files
committed
Added Next.js BE & FE
Added Next.js BE & FE Added Next.js BE & FE
1 parent b417253 commit bb193f9

21 files changed

+4889
-391
lines changed

README.md

+99-42
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@ This project shows the power of Next.js and serves as a practical demonstration
99
- [🌟 **Features**](#-features)
1010
- [🚀 **Live Deployment**](#-live-deployment)
1111
- [🖼️ **UI Preview**](#-ui-preview)
12-
- [**Landing Page**](#landing-page)
13-
- [**Light Mode**](#light-mode)
14-
- [**Dark Mode**](#dark-mode)
15-
- [**Login Page**](#login-page)
16-
- [**Light Mode**](#light-mode-1)
17-
- [**Dark Mode**](#dark-mode-1)
18-
- [**Register Page**](#register-page)
19-
- [**Light Mode**](#light-mode-2)
20-
- [**Dark Mode**](#dark-mode-2)
21-
- [**Homepage (To-Do List)**](#homepage-to-do-list)
22-
- [**Light Mode**](#light-mode-3)
23-
- [**Dark Mode**](#dark-mode-3)
2412
- [📂 **File Structure**](#-file-structure)
2513
- [📋 **API Endpoints**](#-api-endpoints)
2614
- [**1. Prerequisites**](#1-prerequisites)
@@ -30,6 +18,7 @@ This project shows the power of Next.js and serves as a practical demonstration
3018
- [**5. Run the Development Server**](#5-run-the-development-server)
3119
- [**6. Build for Production**](#6-build-for-production)
3220
- [🌐 **Using the App**](#-using-the-app)
21+
- [📝 **Swagger API Documentation**](#-swagger-api-documentation)
3322
- [💡 **Notes**](#-notes)
3423
- [🧪 **Testing**](#-testing)
3524
- [**Running Tests**](#running-tests)
@@ -44,6 +33,8 @@ This project shows the power of Next.js and serves as a practical demonstration
4433
- Dark and Light mode
4534
- User-specific to-do lists with different categories
4635
- CRUD operations for to-do items
36+
- MongoDB database for data storage
37+
- WebSockets for real-time updates to To-Do items
4738
- Responsive design
4839
- Add, edit, delete, and complete tasks
4940
- Persistent storage using SQLite and in-memory storage
@@ -57,6 +48,8 @@ This project shows the power of Next.js and serves as a practical demonstration
5748

5849
The application is deployed live on **Vercel**. You can access it at [https://todo-app-nextjs-stack.vercel.app/](https://todo-app-nextjs-stack.vercel.app/landing).
5950

51+
The app features a landing page, authentication (login, register, and forgot password), a to-do list, and a Swagger API documentation page, as well as real-time to-do updates using WebSockets.
52+
6053
## 🖼️ **UI Preview**
6154

6255
### **Landing Page**
@@ -115,6 +108,20 @@ The application is deployed live on **Vercel**. You can access it at [https://to
115108
<img src="images/home-dark.png" alt="Homepage in Dark Mode" width="100%" style="border-radius: 10px"/>
116109
</p>
117110

111+
### **Forgot Password Page**
112+
113+
#### **Light Mode**
114+
115+
<p align="center">
116+
<img src="images/forgot-password-bright.png" alt="Forgot Password Page" width="100%" style="border-radius: 10px"/>
117+
</p>
118+
119+
#### **Dark Mode**
120+
121+
<p align="center">
122+
<img src="images/forgot-password-dark.png" alt="Forgot Password Page in Dark Mode" width="100%" style="border-radius: 10px"/>
123+
</p>
124+
118125
## 📂 **File Structure**
119126

120127
Below is the comprehensive file structure for the project:
@@ -123,56 +130,94 @@ Below is the comprehensive file structure for the project:
123130
todo-app-fullstack-nextjs/
124131
125132
├── public/
133+
│ ├── sitemap.xml
134+
│ ├── robots.txt
135+
│ ├── manifest.json
126136
│ ├── favicon.ico
127-
│ └── images/ # Placeholder for UI images
137+
│ └── images/
128138
129139
├── src/
130140
│ ├── app/
131-
│ │ ├── api/ # Backend API endpoints
141+
│ │ ├── api/ # Backend API endpoints
142+
│ │ │ ├── swagger.ts # Swagger API documentation
143+
│ │ │ ├── auth/
144+
│ │ │ │ ├── login/
145+
│ │ │ │ │ └── route.ts # Login route
146+
│ │ │ │ ├── register/
147+
│ │ │ │ │ └── route.ts # Registration route
148+
│ │ │ │ ├── reset-password/
149+
│ │ │ │ │ └── route.ts # Reset password route
150+
│ │ │ │ └── verify-email/
151+
│ │ │ │ └── route.ts # Email verification route
132152
│ │ │ └── todos/
133-
│ │ │ ── route.ts # Full CRUD operations for todos
153+
│ │ │ ── route.ts # Full CRUD operations for todos
134154
│ │ │
135-
│ │ ├── auth/ # Authentication pages
155+
│ │ ├── auth/ # Authentication pages
156+
│ │ │ ├── reset-password/
157+
│ │ │ │ └── page.tsx # Reset password page
136158
│ │ │ ├── login/
137-
│ │ │ │ └── page.tsx # Login page
159+
│ │ │ │ └── page.tsx # Login page
138160
│ │ │ └── register/
139-
│ │ │ └── page.tsx # Registration page
161+
│ │ │ └── page.tsx # Registration page
140162
│ │ │
141163
│ │ ├── landing/
142-
│ │ │ └── page.tsx # Landing page
164+
│ │ │ └── page.tsx # Landing page
143165
│ │ │
144-
│ │ ├── layout.tsx # Layout for the entire app
145-
│ │ ├── page.tsx # Homepage with conditional redirect logic
146-
│ │ └── globals.css # Global CSS styles
147-
│ │
148-
│ ├── components/ # Reusable components
149-
│ │ ├── Navbar.tsx # Navbar component
150-
│ │ └── Footer.tsx # Footer component
166+
│ │ ├── swagger/
167+
│ │ │ └── page.tsx # Swagger API documentation page
168+
│ │ │
169+
│ │ ├── layout.tsx # Layout for the entire app
170+
│ │ ├── page.tsx # Homepage with conditional redirect logic
171+
│ │ ├── page.css # Homepage styles
172+
│ │ ├── page.module.css # Homepage module styles
173+
│ │ └── globals.css # Global CSS styles
151174
│ │
152-
│ ├── styles/ # Additional styles if needed
153-
│ │ └── page.css
175+
│ ├── fonts/ # Custom fonts
154176
│ │
155-
│ └── utils/ # Utility functions (e.g., authentication helpers)
156-
│ └── auth.ts
177+
│ └── types/ # TypeScript types
178+
│ └── swagger-ui-react.d.ts # Swagger UI types
179+
180+
├── nginx/ # Nginx configuration
181+
│ ├── default.conf # Default Nginx configuration
182+
│ └── nginx.conf # Nginx configuration
157183
158-
├── .env.local # Environment variables (if using)
159-
├── next.config.js # Next.js configuration
160-
├── package.json # Project dependencies and scripts
161-
└── README.md # This README file
184+
├── kubernetes/ # Kubernetes configuration
185+
│ ├── frontend-deployment.yaml # Frontend deployment configuration
186+
│ ├── frontend-service.yaml # Frontend service configuration
187+
│ ├── backend-deployment.yaml # Backend deployment configuration
188+
│ ├── backend-service.yaml # Backend service configuration
189+
│ └── configmap.yaml # ConfigMap for environment variables
190+
191+
├── .env.local # Environment variables (if using)
192+
├── next.config.js # Next.js configuration
193+
├── Dockerfile # Docker configuration
194+
├── next.config.js # Next.js configuration
195+
├── package-lock.json # Locked versions of dependencies
196+
├── package.json # Project dependencies and scripts
197+
├── tsconfig.json # TypeScript configuration
198+
├── Jenkinsfile # Jenkins CI/CD pipeline
199+
├── .gitignore # Files and directories to ignore
200+
├── .eslintrc.json # ESLint configuration
201+
├── manage_app.sh # Script to manage the app
202+
├── LICENSE # Project license
203+
└── README.md # This README file
162204
```
163205

164206
## 📋 **API Endpoints**
165207

166208
Here's a table listing all the API endpoints provided by this application:
167209

168-
| HTTP Method | Endpoint | Description |
169-
| ----------- | -------------------- | --------------------------------- |
170-
| `POST` | `/api/auth/login` | Log in with username and password |
171-
| `POST` | `/api/auth/register` | Register a new user |
172-
| `GET` | `/api/todos` | Fetch all todos for a user |
173-
| `POST` | `/api/todos` | Create a new to-do item |
174-
| `PUT` | `/api/todos` | Update a to-do item |
175-
| `DELETE` | `/api/todos` | Delete a to-do item |
210+
| HTTP Method | Endpoint | Description |
211+
| ----------- | -------------------------- | --------------------------------- |
212+
| `POST` | `/api/auth/login` | Log in with username and password |
213+
| `POST` | `/api/auth/register` | Register a new user |
214+
| `GET` | `/api/todos` | Fetch all todos for a user |
215+
| `POST` | `/api/todos` | Create a new to-do item |
216+
| `PUT` | `/api/todos` | Update a to-do item |
217+
| `DELETE` | `/api/todos` | Delete a to-do item |
218+
| `PATCH` | `/api/todos` | Mark a to-do item as completed |
219+
| `POST` | `/api/auth/reset-password` | Reset user password |
220+
| `POST` | `/api/auth/verify-email` | Verify user email |
176221

177222
## 🛠️ **Getting Started**
178223

@@ -264,6 +309,18 @@ The production build will be served at `http://localhost:3000`.
264309

265310
3. **Manage To-Dos**: Access the main to-do list page (`/`) where you can add, edit, and delete to-dos, as well as toggle dark mode.
266311

312+
Alternatively, you can directly access the deployed application at [https://todo-app-nextjs-stack.vercel.app/](https://todo-app-nextjs-stack.vercel.app/).
313+
314+
## 📝 **Swagger API Documentation**
315+
316+
The application includes a Swagger API documentation page that lists all the available API endpoints and their descriptions. You can access the Swagger documentation at `/swagger`.
317+
318+
Here is what it looks like:
319+
320+
<p align="center">
321+
<img src="images/swagger.png" alt="Swagger API Documentation" width="100%" style="border-radius: 10px"/>
322+
</p>
323+
267324
## 💡 **Notes**
268325

269326
- This application uses local storage to manage user data and to-do items. For a more robust application, consider integrating a real database (e.g., MongoDB, PostgreSQL).

images/forgot-password-bright.png

164 KB
Loading

images/forgot-password-dark.png

194 KB
Loading

images/login-bright.png

8.71 KB
Loading

images/login-dark.png

6.89 KB
Loading

images/swagger.png

295 KB
Loading

0 commit comments

Comments
 (0)