pnpm install
Next, copy the .env.example to .env and fill the env variables.
pnpm dev
| Layer | Technology / Library | Purpose |
|---|---|---|
| Framework | Next.js | SSR, routing, API routes, SEO |
| Backend API | Next.js API Routes | BFF layer to control and optimize data |
| Data Fetching | Native fetch | Server-side HTTP calls to SWAPI |
| Styling | CSS Modules / Tailwind CSS | Component styling |
| Testing | Vitest | Unit and Integration testing |
This project uses Vitest as the testing framework to ensure code quality, correctness, and reliability of the Star Wars Next.js application.
This project involves building a web application that fetches data from a Star Wars API. It supports fetching single elements and allows searching within the data. The application follows the Backend-For-Frontend (BFF) pattern, enabling the frontend to receive only the required data fields, optimizing performance and reducing complexity.
Next.js was selected as the framework for this project rather than a standard Single Page Application (SPA) using React. The reasons include:
getServerSideProps or getStaticProps to fetch and pass required data to pages during rendering./character/[id] or /search.In summary, Next.js was chosen to provide an SEO-friendly, performant, and maintainable solution for data application that leverages server-side rendering and a clean BFF architecture.
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.