diff --git a/.github/workflows/run-express-tests.yml b/.github/workflows/run-express-tests.yml index b180844..36457cc 100644 --- a/.github/workflows/run-express-tests.yml +++ b/.github/workflows/run-express-tests.yml @@ -5,12 +5,12 @@ on: branches: - development paths: - - 'server/express/**' + - 'server/js-express/**' push: branches: - development paths: - - 'server/express/**' + - 'server/js-express/**' jobs: test: @@ -21,7 +21,7 @@ jobs: defaults: run: - working-directory: server/express + working-directory: server/js-express steps: - name: Checkout code @@ -55,9 +55,9 @@ jobs: with: name: test-results path: | - server/express/coverage/ - server/express/test-results-unit.json - server/express/test-results-integration.json + server/js-express/coverage/ + server/js-express/test-results-unit.json + server/js-express/test-results-integration.json retention-days: 30 - name: Generate Test Summary @@ -66,5 +66,5 @@ jobs: run: | chmod +x .github/scripts/generate-test-summary-jest.sh .github/scripts/generate-test-summary-jest.sh \ - server/express/test-results-unit.json \ - server/express/test-results-integration.json + server/js-express/test-results-unit.json \ + server/js-express/test-results-integration.json diff --git a/client/.env.example b/mflix/client/.env.example similarity index 100% rename from client/.env.example rename to mflix/client/.env.example diff --git a/client/.gitignore b/mflix/client/.gitignore similarity index 100% rename from client/.gitignore rename to mflix/client/.gitignore diff --git a/mflix/client/README.md b/mflix/client/README.md new file mode 100644 index 0000000..811c099 --- /dev/null +++ b/mflix/client/README.md @@ -0,0 +1,159 @@ +# MongoDB Sample MFlix Frontend + +This is a [Next.js](https://nextjs.org) frontend application that demonstrates MongoDB operations by connecting to an Express.js backend. The application showcases Server Side Rendering (SSR) and displays movie data from the sample_mflix database. + +## Features + +- **Movies Page** (`/movies`): Displays a paginated grid of movies with Server Side Rendering +- **Pagination**: Navigate through movies with previous/next controls and adjustable page sizes +- **Movie Details Page** (`/movie/[id]`): Shows comprehensive movie information including plot, cast, ratings, and more +- **Movie Cards**: Shows movie title, poster, year, rating, and genres with navigation to details +- **Navigation**: Sticky navigation bar with links to home and movies pages +- **Responsive Design**: Works on desktop and mobile devices +- **Error Handling**: Graceful fallbacks for missing posters, API errors, and not-found movies +- **Loading States**: Professional loading indicators and skeleton screens during data fetching +- **SEO Optimized**: Dynamic metadata generation for movie pages and pagination + +## Prerequisites + +1. **Express Backend**: The Express server must be running on `http://localhost:3001` +2. **MongoDB Database**: The backend must be connected to a MongoDB instance with the sample_mflix dataset +3. **Node.js**: Version 18 or higher + +## Getting Started + +### 1. Environment Configuration + +Copy the environment example file and configure your API URL: + +```bash +cp .env.example .env.local +``` + +Edit `.env.local` and update the API_URL if needed: +```bash +API_URL=http://localhost:3001 +``` + +### 2. Install Dependencies + +```bash +npm install +``` + +### 3. Start the Development Server + +```bash +npm run dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the application. + +### 4. View the Movies + +Navigate to [http://localhost:3000/movies](http://localhost:3000/movies) to see the movies grid with data from the MongoDB sample_mflix database. + +**Pagination Features:** +- Use the **Previous/Next** buttons to navigate between pages +- Change the **page size** (10, 20, or 50 movies per page) using the dropdown selector +- URL parameters support direct linking: `?page=2&limit=10` +- Click the "Get Details" button on any movie card to view comprehensive movie information + +## API Integration + +The application connects to the Express backend using Server Side Rendering: + +- **Movies API**: `GET /api/movies` - Fetches movie data with pagination support (`limit` and `skip` parameters) +- **Movie Details API**: `GET /api/movies/:id` - Fetches detailed information for a specific movie +- **Pagination**: Smart pagination that detects available pages by requesting `limit + 1` movies +- **Error Handling**: Graceful fallbacks when the API is unavailable +- **Type Safety**: TypeScript interfaces matching the backend data structure + +## Available Scripts + +- `npm run dev` - Starts the development server with Turbopack +- `npm run build` - Builds the application for production +- `npm run start` - Starts the production server +- `npm run lint` - Runs ESLint for code quality + +## Project Structure + +``` +client/ +├── app/ +│ ├── movie/ +│ │ └── [id]/ +│ │ ├── page.tsx # Movie details page with SSR +│ │ ├── loading.tsx # Loading skeleton for details +│ │ ├── error.tsx # Error boundary for details +│ │ └── not-found.tsx # 404 page for invalid movies +│ ├── movies/ +│ │ ├── page.tsx # Movies page with SSR +│ │ └── loading.tsx # Loading component +│ ├── components/ +│ │ └── MovieCard/ # Reusable movie card component +│ ├── lib/ +│ │ ├── api.ts # API functions +│ │ └── constants.ts # App constants and routes +│ ├── types/ +│ │ └── movie.ts # TypeScript type definitions +│ ├── layout.tsx # Root layout with navigation +│ └── page.tsx # Home page +├── .env.example # Environment variables template +└── .env.local # Local environment configuration +``` + +## Development Notes + +### Server Side Rendering + +The movies page uses Next.js Server Side Rendering (SSR) to fetch data on the server before sending the page to the client. This provides: + +- **Better SEO**: Search engines can index the movie content +- **Faster Initial Load**: Users see content immediately +- **Fresh Data**: Movie data is fetched on each page request + +### Type Safety + +The application uses TypeScript interfaces that match the backend MongoDB document structure: + +```typescript +interface Movie { + _id: string; + title: string; + year?: number; + poster?: string; + genres?: string[]; + imdb?: { + rating?: number; + }; +} +``` + +### Error Handling + +- **API Errors**: Shows fallback message when the backend is unavailable +- **Missing Posters**: Displays placeholder for movies without poster images +- **Network Issues**: Graceful degradation with empty state + +## Learn More + +To learn more about the technologies used: + +- [Next.js Documentation](https://nextjs.org/docs) - Learn about Next.js features and API +- [MongoDB Node.js Driver](https://mongodb.github.io/node-mongodb-native/) - Backend database integration +- [TypeScript](https://www.typescriptlang.org/) - Type safety and development experience + +## Deployment + +### Development +The application is configured to work with a local Express backend on port 3001. + +### Production +For production deployment: + +1. Update `API_URL` in your environment configuration +2. Build the application: `npm run build` +3. Start the production server: `npm start` + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. diff --git a/client/app/aggregations/aggregations.module.css b/mflix/client/app/aggregations/aggregations.module.css similarity index 100% rename from client/app/aggregations/aggregations.module.css rename to mflix/client/app/aggregations/aggregations.module.css diff --git a/client/app/aggregations/page.tsx b/mflix/client/app/aggregations/page.tsx similarity index 100% rename from client/app/aggregations/page.tsx rename to mflix/client/app/aggregations/page.tsx diff --git a/client/app/components/ActionButtons/ActionButtons.module.css b/mflix/client/app/components/ActionButtons/ActionButtons.module.css similarity index 100% rename from client/app/components/ActionButtons/ActionButtons.module.css rename to mflix/client/app/components/ActionButtons/ActionButtons.module.css diff --git a/client/app/components/ActionButtons/ActionButtons.tsx b/mflix/client/app/components/ActionButtons/ActionButtons.tsx similarity index 100% rename from client/app/components/ActionButtons/ActionButtons.tsx rename to mflix/client/app/components/ActionButtons/ActionButtons.tsx diff --git a/client/app/components/ActionButtons/index.ts b/mflix/client/app/components/ActionButtons/index.ts similarity index 100% rename from client/app/components/ActionButtons/index.ts rename to mflix/client/app/components/ActionButtons/index.ts diff --git a/client/app/components/AddMovieForm/AddMovieForm.tsx b/mflix/client/app/components/AddMovieForm/AddMovieForm.tsx similarity index 100% rename from client/app/components/AddMovieForm/AddMovieForm.tsx rename to mflix/client/app/components/AddMovieForm/AddMovieForm.tsx diff --git a/client/app/components/AddMovieForm/index.ts b/mflix/client/app/components/AddMovieForm/index.ts similarity index 100% rename from client/app/components/AddMovieForm/index.ts rename to mflix/client/app/components/AddMovieForm/index.ts diff --git a/client/app/components/BatchEditMovieForm/BatchEditMovieForm.tsx b/mflix/client/app/components/BatchEditMovieForm/BatchEditMovieForm.tsx similarity index 100% rename from client/app/components/BatchEditMovieForm/BatchEditMovieForm.tsx rename to mflix/client/app/components/BatchEditMovieForm/BatchEditMovieForm.tsx diff --git a/client/app/components/BatchEditMovieForm/index.ts b/mflix/client/app/components/BatchEditMovieForm/index.ts similarity index 100% rename from client/app/components/BatchEditMovieForm/index.ts rename to mflix/client/app/components/BatchEditMovieForm/index.ts diff --git a/client/app/components/EditMovieForm/EditMovieForm.module.css b/mflix/client/app/components/EditMovieForm/EditMovieForm.module.css similarity index 100% rename from client/app/components/EditMovieForm/EditMovieForm.module.css rename to mflix/client/app/components/EditMovieForm/EditMovieForm.module.css diff --git a/client/app/components/EditMovieForm/EditMovieForm.tsx b/mflix/client/app/components/EditMovieForm/EditMovieForm.tsx similarity index 100% rename from client/app/components/EditMovieForm/EditMovieForm.tsx rename to mflix/client/app/components/EditMovieForm/EditMovieForm.tsx diff --git a/client/app/components/EditMovieForm/index.ts b/mflix/client/app/components/EditMovieForm/index.ts similarity index 100% rename from client/app/components/EditMovieForm/index.ts rename to mflix/client/app/components/EditMovieForm/index.ts diff --git a/client/app/components/LoadingSkeleton/LoadingSkeleton.module.css b/mflix/client/app/components/LoadingSkeleton/LoadingSkeleton.module.css similarity index 100% rename from client/app/components/LoadingSkeleton/LoadingSkeleton.module.css rename to mflix/client/app/components/LoadingSkeleton/LoadingSkeleton.module.css diff --git a/client/app/components/LoadingSkeleton/LoadingSkeleton.tsx b/mflix/client/app/components/LoadingSkeleton/LoadingSkeleton.tsx similarity index 100% rename from client/app/components/LoadingSkeleton/LoadingSkeleton.tsx rename to mflix/client/app/components/LoadingSkeleton/LoadingSkeleton.tsx diff --git a/client/app/components/LoadingSkeleton/index.ts b/mflix/client/app/components/LoadingSkeleton/index.ts similarity index 100% rename from client/app/components/LoadingSkeleton/index.ts rename to mflix/client/app/components/LoadingSkeleton/index.ts diff --git a/client/app/components/MovieCard/MovieCard.module.css b/mflix/client/app/components/MovieCard/MovieCard.module.css similarity index 100% rename from client/app/components/MovieCard/MovieCard.module.css rename to mflix/client/app/components/MovieCard/MovieCard.module.css diff --git a/client/app/components/MovieCard/MovieCard.tsx b/mflix/client/app/components/MovieCard/MovieCard.tsx similarity index 100% rename from client/app/components/MovieCard/MovieCard.tsx rename to mflix/client/app/components/MovieCard/MovieCard.tsx diff --git a/client/app/components/MovieCard/index.ts b/mflix/client/app/components/MovieCard/index.ts similarity index 100% rename from client/app/components/MovieCard/index.ts rename to mflix/client/app/components/MovieCard/index.ts diff --git a/client/app/components/PageSizeSelector/PageSizeSelector.module.css b/mflix/client/app/components/PageSizeSelector/PageSizeSelector.module.css similarity index 100% rename from client/app/components/PageSizeSelector/PageSizeSelector.module.css rename to mflix/client/app/components/PageSizeSelector/PageSizeSelector.module.css diff --git a/client/app/components/PageSizeSelector/PageSizeSelector.tsx b/mflix/client/app/components/PageSizeSelector/PageSizeSelector.tsx similarity index 100% rename from client/app/components/PageSizeSelector/PageSizeSelector.tsx rename to mflix/client/app/components/PageSizeSelector/PageSizeSelector.tsx diff --git a/client/app/components/PageSizeSelector/index.ts b/mflix/client/app/components/PageSizeSelector/index.ts similarity index 100% rename from client/app/components/PageSizeSelector/index.ts rename to mflix/client/app/components/PageSizeSelector/index.ts diff --git a/client/app/components/Pagination/Pagination.module.css b/mflix/client/app/components/Pagination/Pagination.module.css similarity index 100% rename from client/app/components/Pagination/Pagination.module.css rename to mflix/client/app/components/Pagination/Pagination.module.css diff --git a/client/app/components/Pagination/Pagination.tsx b/mflix/client/app/components/Pagination/Pagination.tsx similarity index 100% rename from client/app/components/Pagination/Pagination.tsx rename to mflix/client/app/components/Pagination/Pagination.tsx diff --git a/client/app/components/Pagination/index.ts b/mflix/client/app/components/Pagination/index.ts similarity index 100% rename from client/app/components/Pagination/index.ts rename to mflix/client/app/components/Pagination/index.ts diff --git a/client/app/components/SearchMovieModal/SearchMovieModal.module.css b/mflix/client/app/components/SearchMovieModal/SearchMovieModal.module.css similarity index 100% rename from client/app/components/SearchMovieModal/SearchMovieModal.module.css rename to mflix/client/app/components/SearchMovieModal/SearchMovieModal.module.css diff --git a/client/app/components/SearchMovieModal/SearchMovieModal.tsx b/mflix/client/app/components/SearchMovieModal/SearchMovieModal.tsx similarity index 100% rename from client/app/components/SearchMovieModal/SearchMovieModal.tsx rename to mflix/client/app/components/SearchMovieModal/SearchMovieModal.tsx diff --git a/client/app/components/SearchMovieModal/index.ts b/mflix/client/app/components/SearchMovieModal/index.ts similarity index 100% rename from client/app/components/SearchMovieModal/index.ts rename to mflix/client/app/components/SearchMovieModal/index.ts diff --git a/client/app/components/index.ts b/mflix/client/app/components/index.ts similarity index 100% rename from client/app/components/index.ts rename to mflix/client/app/components/index.ts diff --git a/client/app/components/ui/ErrorDisplay.tsx b/mflix/client/app/components/ui/ErrorDisplay.tsx similarity index 100% rename from client/app/components/ui/ErrorDisplay.tsx rename to mflix/client/app/components/ui/ErrorDisplay.tsx diff --git a/client/app/components/ui/LoadingSpinner.tsx b/mflix/client/app/components/ui/LoadingSpinner.tsx similarity index 100% rename from client/app/components/ui/LoadingSpinner.tsx rename to mflix/client/app/components/ui/LoadingSpinner.tsx diff --git a/client/app/components/ui/index.ts b/mflix/client/app/components/ui/index.ts similarity index 100% rename from client/app/components/ui/index.ts rename to mflix/client/app/components/ui/index.ts diff --git a/client/app/globals.css b/mflix/client/app/globals.css similarity index 100% rename from client/app/globals.css rename to mflix/client/app/globals.css diff --git a/client/app/home.module.css b/mflix/client/app/home.module.css similarity index 100% rename from client/app/home.module.css rename to mflix/client/app/home.module.css diff --git a/client/app/layout.module.css b/mflix/client/app/layout.module.css similarity index 100% rename from client/app/layout.module.css rename to mflix/client/app/layout.module.css diff --git a/client/app/layout.tsx b/mflix/client/app/layout.tsx similarity index 100% rename from client/app/layout.tsx rename to mflix/client/app/layout.tsx diff --git a/client/app/lib/api.ts b/mflix/client/app/lib/api.ts similarity index 100% rename from client/app/lib/api.ts rename to mflix/client/app/lib/api.ts diff --git a/client/app/lib/constants.ts b/mflix/client/app/lib/constants.ts similarity index 100% rename from client/app/lib/constants.ts rename to mflix/client/app/lib/constants.ts diff --git a/client/app/lib/utils.ts b/mflix/client/app/lib/utils.ts similarity index 100% rename from client/app/lib/utils.ts rename to mflix/client/app/lib/utils.ts diff --git a/client/app/movie/[id]/error.module.css b/mflix/client/app/movie/[id]/error.module.css similarity index 100% rename from client/app/movie/[id]/error.module.css rename to mflix/client/app/movie/[id]/error.module.css diff --git a/client/app/movie/[id]/error.tsx b/mflix/client/app/movie/[id]/error.tsx similarity index 100% rename from client/app/movie/[id]/error.tsx rename to mflix/client/app/movie/[id]/error.tsx diff --git a/client/app/movie/[id]/loading.tsx b/mflix/client/app/movie/[id]/loading.tsx similarity index 100% rename from client/app/movie/[id]/loading.tsx rename to mflix/client/app/movie/[id]/loading.tsx diff --git a/client/app/movie/[id]/not-found.module.css b/mflix/client/app/movie/[id]/not-found.module.css similarity index 100% rename from client/app/movie/[id]/not-found.module.css rename to mflix/client/app/movie/[id]/not-found.module.css diff --git a/client/app/movie/[id]/not-found.tsx b/mflix/client/app/movie/[id]/not-found.tsx similarity index 100% rename from client/app/movie/[id]/not-found.tsx rename to mflix/client/app/movie/[id]/not-found.tsx diff --git a/client/app/movie/[id]/page.module.css b/mflix/client/app/movie/[id]/page.module.css similarity index 100% rename from client/app/movie/[id]/page.module.css rename to mflix/client/app/movie/[id]/page.module.css diff --git a/client/app/movie/[id]/page.tsx b/mflix/client/app/movie/[id]/page.tsx similarity index 100% rename from client/app/movie/[id]/page.tsx rename to mflix/client/app/movie/[id]/page.tsx diff --git a/client/app/movies/error.tsx b/mflix/client/app/movies/error.tsx similarity index 100% rename from client/app/movies/error.tsx rename to mflix/client/app/movies/error.tsx diff --git a/client/app/movies/loading.tsx b/mflix/client/app/movies/loading.tsx similarity index 100% rename from client/app/movies/loading.tsx rename to mflix/client/app/movies/loading.tsx diff --git a/client/app/movies/movies.module.css b/mflix/client/app/movies/movies.module.css similarity index 100% rename from client/app/movies/movies.module.css rename to mflix/client/app/movies/movies.module.css diff --git a/client/app/movies/page.module.css b/mflix/client/app/movies/page.module.css similarity index 100% rename from client/app/movies/page.module.css rename to mflix/client/app/movies/page.module.css diff --git a/client/app/movies/page.tsx b/mflix/client/app/movies/page.tsx similarity index 100% rename from client/app/movies/page.tsx rename to mflix/client/app/movies/page.tsx diff --git a/client/app/page.tsx b/mflix/client/app/page.tsx similarity index 100% rename from client/app/page.tsx rename to mflix/client/app/page.tsx diff --git a/client/app/types/aggregations.ts b/mflix/client/app/types/aggregations.ts similarity index 100% rename from client/app/types/aggregations.ts rename to mflix/client/app/types/aggregations.ts diff --git a/client/app/types/movie.ts b/mflix/client/app/types/movie.ts similarity index 100% rename from client/app/types/movie.ts rename to mflix/client/app/types/movie.ts diff --git a/client/eslint.config.mjs b/mflix/client/eslint.config.mjs similarity index 100% rename from client/eslint.config.mjs rename to mflix/client/eslint.config.mjs diff --git a/client/next.config.ts b/mflix/client/next.config.ts similarity index 100% rename from client/next.config.ts rename to mflix/client/next.config.ts diff --git a/client/package.json b/mflix/client/package.json similarity index 100% rename from client/package.json rename to mflix/client/package.json diff --git a/client/tsconfig.json b/mflix/client/tsconfig.json similarity index 96% rename from client/tsconfig.json rename to mflix/client/tsconfig.json index b0209d7..ddba9b4 100644 --- a/client/tsconfig.json +++ b/mflix/client/tsconfig.json @@ -15,7 +15,7 @@ "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve", + "jsx": "react-jsx", "incremental": true, "plugins": [ { diff --git a/server/express/.env.example b/mflix/server/js-express/.env.example similarity index 100% rename from server/express/.env.example rename to mflix/server/js-express/.env.example diff --git a/server/express/.gitignore b/mflix/server/js-express/.gitignore similarity index 100% rename from server/express/.gitignore rename to mflix/server/js-express/.gitignore diff --git a/server/express/jest.config.json b/mflix/server/js-express/jest.config.json similarity index 100% rename from server/express/jest.config.json rename to mflix/server/js-express/jest.config.json diff --git a/server/express/jest.integration.config.json b/mflix/server/js-express/jest.integration.config.json similarity index 100% rename from server/express/jest.integration.config.json rename to mflix/server/js-express/jest.integration.config.json diff --git a/server/express/package.json b/mflix/server/js-express/package.json similarity index 100% rename from server/express/package.json rename to mflix/server/js-express/package.json diff --git a/server/express/src/app.ts b/mflix/server/js-express/src/app.ts similarity index 100% rename from server/express/src/app.ts rename to mflix/server/js-express/src/app.ts diff --git a/server/express/src/config/database.ts b/mflix/server/js-express/src/config/database.ts similarity index 100% rename from server/express/src/config/database.ts rename to mflix/server/js-express/src/config/database.ts diff --git a/server/express/src/config/swagger.ts b/mflix/server/js-express/src/config/swagger.ts similarity index 100% rename from server/express/src/config/swagger.ts rename to mflix/server/js-express/src/config/swagger.ts diff --git a/server/express/src/controllers/movieController.ts b/mflix/server/js-express/src/controllers/movieController.ts similarity index 100% rename from server/express/src/controllers/movieController.ts rename to mflix/server/js-express/src/controllers/movieController.ts diff --git a/server/express/src/routes/movies.ts b/mflix/server/js-express/src/routes/movies.ts similarity index 100% rename from server/express/src/routes/movies.ts rename to mflix/server/js-express/src/routes/movies.ts diff --git a/server/express/src/types/index.ts b/mflix/server/js-express/src/types/index.ts similarity index 100% rename from server/express/src/types/index.ts rename to mflix/server/js-express/src/types/index.ts diff --git a/server/express/src/utils/errorHandler.ts b/mflix/server/js-express/src/utils/errorHandler.ts similarity index 100% rename from server/express/src/utils/errorHandler.ts rename to mflix/server/js-express/src/utils/errorHandler.ts diff --git a/server/express/tests/controllers/movieController.test.ts b/mflix/server/js-express/tests/controllers/movieController.test.ts similarity index 100% rename from server/express/tests/controllers/movieController.test.ts rename to mflix/server/js-express/tests/controllers/movieController.test.ts diff --git a/server/express/tests/integration/README.md b/mflix/server/js-express/tests/integration/README.md similarity index 99% rename from server/express/tests/integration/README.md rename to mflix/server/js-express/tests/integration/README.md index 8fbd90f..c251312 100644 --- a/server/express/tests/integration/README.md +++ b/mflix/server/js-express/tests/integration/README.md @@ -87,7 +87,7 @@ npx jest --config jest.integration.config.json tests/integration/advancedEndpoin #### Using .env file -Create a `.env` file in the `server/express` directory: +Create a `.env` file in the `server/js-express` directory: ```env MONGODB_URI=mongodb://localhost:27017/sample_mflix diff --git a/server/express/tests/integration/advancedEndpoints.integration.test.ts b/mflix/server/js-express/tests/integration/advancedEndpoints.integration.test.ts similarity index 100% rename from server/express/tests/integration/advancedEndpoints.integration.test.ts rename to mflix/server/js-express/tests/integration/advancedEndpoints.integration.test.ts diff --git a/server/express/tests/integration/mongodbSearch.integration.test.ts b/mflix/server/js-express/tests/integration/mongodbSearch.integration.test.ts similarity index 100% rename from server/express/tests/integration/mongodbSearch.integration.test.ts rename to mflix/server/js-express/tests/integration/mongodbSearch.integration.test.ts diff --git a/server/express/tests/integration/movie.integration.test.ts b/mflix/server/js-express/tests/integration/movie.integration.test.ts similarity index 100% rename from server/express/tests/integration/movie.integration.test.ts rename to mflix/server/js-express/tests/integration/movie.integration.test.ts diff --git a/server/express/tests/integration/setup.ts b/mflix/server/js-express/tests/integration/setup.ts similarity index 100% rename from server/express/tests/integration/setup.ts rename to mflix/server/js-express/tests/integration/setup.ts diff --git a/server/express/tests/setup.ts b/mflix/server/js-express/tests/setup.ts similarity index 100% rename from server/express/tests/setup.ts rename to mflix/server/js-express/tests/setup.ts diff --git a/server/express/tests/utils/testHelpers.ts b/mflix/server/js-express/tests/utils/testHelpers.ts similarity index 100% rename from server/express/tests/utils/testHelpers.ts rename to mflix/server/js-express/tests/utils/testHelpers.ts diff --git a/server/express/tsconfig.json b/mflix/server/js-express/tsconfig.json similarity index 100% rename from server/express/tsconfig.json rename to mflix/server/js-express/tsconfig.json diff --git a/mflix/server/python-fastapi/tests/README.md b/mflix/server/python-fastapi/tests/README.md index f8bf9f9..6a151d4 100644 --- a/mflix/server/python-fastapi/tests/README.md +++ b/mflix/server/python-fastapi/tests/README.md @@ -41,7 +41,7 @@ The test suite is organized into three categories: 1. **For all tests:** ```bash - cd server/python + cd server/python-fastapi source .venv/bin/activate # or `.venv\Scripts\activate` on Windows ``` @@ -170,7 +170,7 @@ The `test_batch_create_movies` test is currently skipped due to a known bug in t **Solution**: - Ensure virtual environment is activated - Install dependencies: `pip install -r requirements.txt` -- Run from `server/python` directory +- Run from `server/python-fastapi` directory ## Contributing diff --git a/mflix/server/python-fastapi/tests/integration/conftest.py b/mflix/server/python-fastapi/tests/integration/conftest.py index 329cbdc..6fb4e2d 100644 --- a/mflix/server/python-fastapi/tests/integration/conftest.py +++ b/mflix/server/python-fastapi/tests/integration/conftest.py @@ -48,8 +48,8 @@ def server(): if is_port_in_use(test_port): pytest.skip(f"Port {test_port} is already in use. Cannot start test server.") - # Get the absolute path to the server/python directory - # Tests are in server/python/tests/integration, so go up two levels + # Get the absolute path to the server/python-fastapi directory + # Tests are in server/python-fastapi/tests/integration, so go up two levels test_dir = os.path.dirname(os.path.abspath(__file__)) server_python_dir = os.path.abspath(os.path.join(test_dir, "..", ".."))