Skip to content

A Next.js 15 app for browsing characters from the public Rick & Morty GraphQL API. The app requires a quick profile registration before accessing content, stores user info in a cookie, and supports both full-page and modal character detail views.

Notifications You must be signed in to change notification settings

harimaurya/RickAndMorty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rick and Morty Universe

A Next.js 15 app that browses characters from the public Rick & Morty GraphQL API. Visitors complete a quick profile registration that persists to a cookie before exploring the character catalogue, with both page and modal detail experiences.

Table of contents

Tech stack

Key features

  • Root route redirects to the paginated /information catalogue via Home.
  • Character grid with both dedicated page and modal detail routes.
  • Cookie-backed profile registration gate enforced by middleware.
  • Reusable form, card, dialog, and pagination components for consistent UI.

Project layout

Area Description
app/(main) Authenticated layouts, information catalogue, and profile pages.
app/(auth) Registration flow shown until the profile cookie is present.
components Shared UI primitives, layout chrome, and feature components.
lib Apollo client configuration plus utilities (e.g., pagination helpers).
types TypeScript definitions for characters and profile data.
public Static assets, including the Rick & Morty logo.

Architecture overview

Routing

Data fetching

Profile & cookies

  • /api/register POST/GET (route) persists { username, jobTitle } into the user cookie.
  • middleware requires the cookie before allowing /, /information, and /profile.
  • Forms reuse ProfileForm, pulling the initial value from UserContext.

UI components

Styling

Environment variables

Set in .env.local or .env.production:

  • GQL_ENDPOINT – GraphQL API endpoint (defaults to the official API).
  • CHALLENGE_VERSION – Rendered by SiteFooter.

Getting started

  1. Install dependencies:
    npm install
  2. Start the dev server:
    npm run dev
  3. Visit http://localhost:3000 — unauthenticated users are redirected to /register until the user cookie is set.
  4. Build and run production:
    npm run build
    npm start

Available scripts

  • npm run dev – Launch the Turbopack dev server.
  • npm run build – Produce an optimized production build.
  • npm start – Serve the production build.
  • npm run lint – Run ESLint with eslint.config.mjs.

About

A Next.js 15 app for browsing characters from the public Rick & Morty GraphQL API. The app requires a quick profile registration before accessing content, stores user info in a cookie, and supports both full-page and modal character detail views.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published