Welcome to the Movie-Manage, a full-stack, lightweight, and simple movie application built using Next.js with both backend and frontend integrated seamlessly.
This project shows the power of Next.js and serves as a practical demonstration of using Next.js as a complete full-stack framework, incorporating authentication, dark mode, and local storage for data persistence.
- π Features
- π Live Deployment
- π File Structure
- π API Endpoints
- π Using the App
- π Swagger API Documentation
- π‘ Notes
- π§ͺ Testing
- π License
- π§ Contact
- Full-stack application with Next.js for both frontend and backend
- Full authentication system (Register and Login)
- User-specific Movie lists with graceful design
- CRUD operations for movie items
- Mysql database for data storage
- Responsive design
- Add, edit, delete movies
- State management using Zustand
- Localization with i18n(En, Fr)
- Form Validation with zod (email, password, movie title, pusblishing year)
- Simple pagination with no library
- API documentation using swagger
- A clean, modern, and responsive UI
- Basic testing for API endpoints and utility functions
- Easy-to-understand file structure and codebase
- Customizable with additional features and improvements
The application is deployed live on Vercel. You can access it at http://ec2-54-153-82-108.us-west-1.compute.amazonaws.com:3000/.
The app features a landing page, authentication (login, register), a movie list, and a Swagger API documentation page.
Below is the comprehensive file structure for the project:
movie-manage/
ββ app/ # Backend API endpoints
β ββ api/
β β ββ auth/
β β β ββ register/
β β β β ββ route.ts # Registration route
β β β ββ [...nextauth]/
β β β ββ route.ts # Login route
β β ββ movies/ # Full CRUD operations for movies
β β β ββ [id]/
β β β β ββ route.ts
β β β ββ route.ts
β β ββ upload/ # File Upload route
β β ββ route.ts
β ββ docs/ # Swagger documentation page
β β ββ layout.tsx
β β ββ page.tsx
β ββ [locale]/ # Page localization
β β ββ auth/ # Authentication pages
β β β ββ login/
β β β β ββ page.tsx # Login page
β β β ββ register/
β β β ββ page.tsx # Register page
β β ββ movies/ # Movie management pages
β β β ββ add/
β β β β ββ page.tsx
β β β ββ edit/
β β β β ββ [id]/
β β β β ββ page.tsx
β β β ββ empty/
β β β β ββ page.tsx
β β β ββ page.tsx
β β ββ layout.tsx # Root Layout Component
β ββ favicon.ico
β ββ globals.css
β ββ providers.tsx
ββ components/ # UI components
β ββ Moives/
β β ββ LanguageSwitcher.tsx # Language Switch bar
β ββ ui/
β β ββ CustomizedCheckbox.tsx
β β ββ fileupload.tsx
β β ββ ImageCard.tsx
β ββ Footer.tsx
ββ hooks/
β ββ useWindowResize.ts # Hook windows size event
ββ i18n/
β ββ request.ts
β ββ routing.ts
ββ lib/ # User defined library
β ββ prisma.ts # Prisma config
β ββ swagger.ts # Swagger config
β ββ zod.ts # Zod validation config
ββ messages/ # Messages for localization
β ββ en.json
β ββ fr.json
ββ prisma/ # Prisma configuration dir
β ββ migrations/
β ββ schema.prisma
ββ public/
β ββ uploads/
β ββ Vector1.svg
β ββ Vector2.svg
ββ store/ # zustand stores
β ββ authStore.ts # Authentication state store
β ββ movieStore.ts # Moive management store
β ββ useStore.ts # Mobile state store
ββ eslint.config.mjs # ESLint configuration
ββ middleware.tsx # API middleware
ββ next.config.ts # Next.js configuration
ββ package-lock.json # Locked versions of dependencies
ββ package.json # Project dependencies and scripts
ββ postcss.config.js # Postcss configuration
ββ README.md # This README file
ββ tailwind.config.ts # Tailwind CSS configuration
ββ tsconfig.json # TypeScript configuration
Here's a table listing all the API endpoints provided by this application:
HTTP Method | Endpoint | Description |
---|---|---|
POST |
/api/auth/login |
Log in with email and password |
POST |
/api/auth/register |
Register a new user |
GET |
/api/movies |
Fetch all movies for a user |
POST |
/api/movies |
Create a new movie item |
PUT |
/api/movies/{id} |
Update a movie item |
DELETE |
/api/movies/{id} |
Delete a movie item |
POST |
/api/upload |
Upload image file |
Follow this step-by-step guide to set up the project locally.
Ensure you have the following installed:
git clone https://github.com/monster0318/movie-manage.git
cd movie-manage
If you're using npm:
npm install --legacy-peer-deps # because swagger-jsdoc latest version is compatible with only react 18 not 19
Or, if you're using Yarn:
yarn install
Create a .env.local
file in the root directory if any environment variables are required. (Currently, the project doesn't use any external services that require environment variables).
Start the development server:
npm run dev
Or, if using Yarn:
yarn dev
The application should now be running at http://localhost:3000
.
To build the project for production, run:
npm run build
Or, if using Yarn:
yarn build
To start the production server:
npm run start
Or:
yarn start
The production build will be served at http://localhost:3000
.
- Visit the Landing Page (
/
): Introduces the app with the option to log in or register. - Authentication:
- Register: Create a new account via the
/auth/register
page. - Login: Access your account through the
/auth/login
page.
- Manage movies: Access the main movie list page (
/
) where you can add, edit, and delete movies
Alternatively, you can directly access the deployed application at http://ec2-54-153-82-108.us-west-1.compute.amazonaws.com:3000/.
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 /docs
.
For example: http://ec2-54-153-82-108.us-west-1.compute.amazonaws.com:3000/docs
- This application uses local storage to manage user data and movie items. For a more robust application, consider integrating a real database (e.g., Mysql, PostgreSQL).
This project includes a few basic tests for the API endpoints and utility functions. To run the tests, use the following command:
npm run test
Or, if using Yarn:
yarn test
The tests will run and display the results in the terminal.
This project is licensed under the MIT License. See the LICENSE file for more information.
For any inquiries or feedback, feel free to reach out to the author at loyalman318@gmail.com
.
Enjoy using the Movie-Manage! π
Happy coding! π