A Progressive Web App for tracking plot events and characters in your ongoing story. Built with React, Next.js, Material-UI, and PostgreSQL.
- Character Management: Create and manage story characters with descriptions
- Event Tracking: Create chronological plot events and assign characters with specific roles
- Character Timelines: View all events related to a specific character in chronological order
- Relationship Timelines: View shared events between two characters to track their relationship
- Progressive Web App: Install on mobile devices and use offline
- Beautiful UI: Modern, responsive design with Material-UI components
- Frontend: React, Next.js 14, Material-UI (MUI), TypeScript
- Backend: Next.js API Routes
- Database: PostgreSQL
- PWA: next-pwa for offline functionality
- Date Handling: Day.js with Material-UI date pickers
- Node.js 18+
- PostgreSQL database
- npm or yarn
-
Clone the repository
git clone <repository-url> cd story-plotter
-
Install dependencies
npm install
-
Set up PostgreSQL database
- Create a PostgreSQL database named
story_plotter - Update database credentials in environment variables
- Create a PostgreSQL database named
-
Configure environment variables Create a
.env.localfile in the root directory:DB_HOST=localhost DB_PORT=5432 DB_NAME=story_plotter DB_USER=postgres DB_PASSWORD=your_password -
Set up database tables
npm run db:setup
-
Start the development server
npm run dev
-
Access the application Open http://localhost:3000 in your browser
id(Primary Key)name(Unique)descriptioncreated_atupdated_at
id(Primary Key)titledescriptionevent_datecreated_atupdated_at
id(Primary Key)character_id(Foreign Key)event_id(Foreign Key)role(Character's role in the event)created_at
- Navigate to the Characters page
- Click the floating action button (+)
- Enter character name and optional description
- Click "Create"
- Navigate to the Events page
- Click the floating action button (+)
- Enter event title, date/time, and optional description
- Select characters involved in the event
- Click "Create Event"
- Navigate to the Timelines page
- For single character timeline:
- Select "Single Character"
- Choose a character from the dropdown
- Click "View Timeline"
- For relationship timeline:
- Select "Relationship"
- Choose two characters
- Click "View Relationship"
The app can be installed as a Progressive Web App:
- Click the install button in your browser
- Add to home screen on mobile devices
- Works offline for viewing previously loaded data
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run db:setup- Set up database tables
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ ├── characters/ # Characters pages
│ ├── events/ # Events pages
│ ├── timelines/ # Timelines pages
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Home page
│ └── theme.ts # Material-UI theme
├── lib/ # Utilities
│ └── db.ts # Database connection and types
├── public/ # Static assets
├── scripts/ # Database setup scripts
└── README.md
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.