Complete setup guide for the Comic Generator project.
- Node.js >= 18.0.0
- npm >= 9.0.0
- MySQL (local or cloud instance)
# Install root dependencies
npm install
# Install all dependencies (frontend + backend)
npm run install:allcd backend
cp .env.example .envEdit backend/.env:
PORT=3000
NODE_ENV=development
DATABASE_URL=
JWT_SECRET=your_super_secret_jwt_key_here
JWT_EXPIRES_IN=7d
FRONTEND_URL=http://localhost:5173
MAX_FILE_SIZE=10485760
UPLOAD_DIR=./uploadscd frontend
cp .env.example .envEdit frontend/.env:
VITE_API_URL=http://localhost:3000Make sure database is running locally or update the DATABASE_URL in backend/.env to point to your cloud instance or database.
From the root directory:
# Run both frontend and backend concurrently
npm run devOr run them separately:
# Terminal 1 - Backend
npm run dev:backend
# Terminal 2 - Frontend
npm run dev:frontendThe application will be available at:
- Frontend: http://localhost:5173
- Backend: http://localhost:3000
Visit http://localhost:3000/health to check if the backend is running.
# Backend tests
cd backend
npm test
# Frontend tests
cd frontend
npm test# Build frontend
npm run build:frontendnpm startcomic-generator/
├── frontend/ # React application
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── services/
│ │ └── ...
│ └── package.json
├── backend/ # Node.js API
│ ├── src/
│ │ ├── controllers/
│ │ ├── models/
│ │ ├── routes/
│ │ └── ...
│ └── package.json
└── package.json # Root workspace config
If ports 3000 or 5173 are already in use, update the port numbers in:
- Backend:
backend/.env(PORT) - Frontend:
frontend/vite.config.js(server.port)
# Clean install
rm -rf node_modules frontend/node_modules backend/node_modules
npm run install:all- React 18
- Vite
- React Router
- Axios
- TailwindCSS
- Node.js
- Express
- JavaScript (ES6+ Modules)
- MySQL
MIT
- Implement authentication endpoints in the backend
- Add comic creation functionality
- Integrate image generation/upload features
- Add user authentication in the frontend
- Implement state management with Zustand
- Add more pages and features