AI generated storybook images for k-12 students. Children can write a story, and write captions underneath where the picture will go. The website will draw illustrations of their caption.
MSI is written in React and NodeJS, supported by SQL. Images are generated using Stable Diffusion.
All server code is in the Server directory. Open that directory and run npm install to install dependencies.
index.js is the main entry point of the app.
Before running the app, create the file 'Server/.env' and ensure it contains the correct values for HOST, DB_USER, PASSWORD, DB, and DIALECT to connect to your own database.
To run the app use the command:
npm run start OR
npm run start-dev (This will start a server that refreshes when you make code changes)
Look at the scripts section of package.json to see available scripts.
The server runs on port 3000 locally. This is where you can access it.
There are a few subfolders, routes, controllers, and models. Routes are used to decide which path was requested and direct to the appropriate controller. Controllers contain the logic. Models are templates of database tables.
When you open the app, runnpm install
Start the app with npm start (make sure you are in the Client/my-story-illustrator-client directory).
| type | path |
|---|---|
| POST | /signup |
| POST | /login |
| type | path |
|---|---|
| POST | /saveBook |
| GET | /getBook |
| POST | /getAllBooks |
| DELETE | /deleteBook |
| POST | /generateImage |
| PUT | /updateBook |
{ "username": "marcel1", "password": "password", "confirmPassword": "password" }
{ "message": "User Created.", "id": 4 }
{ "username": "marcel1", "password": "password" }
{ "message": "Login successful. Token valid for the next 168 hours.", "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjQsImlhdCI6MTY2ODQ1NDAwOSwiZXhwIjoxNjY4NDU0MDA5fQ.c7jmmKMF9Uqfm3WD6VEXHTjr8LhJT8lMD1kpmLJMRs8" }
{ "userId": 4, "title": "test", "author": "Marcel" }
{ "message": "Book created.", "id": 28 }
{ "bookId": 28 }
{ "Book": { "Id": 28, "Title": "test", "Author": "Marcel", "UserId": 4, "createdAt": "2022-11-14T19:38:12.225Z", "updatedAt": "2022-11-14T19:38:12.225Z" } }
{ "userId": 1 }
{ "books": [ { "id": 1, "title": "test1", "author": "Marcel", "createdAt": "2022-11-16T19:29:59.697Z", "updatedAt": "2022-11-16T19:29:59.697Z" }, { "id": 2, "title": "test2", "author": "Marcel", "createdAt": "2022-11-16T19:30:32.316Z", "updatedAt": "2022-11-16T19:30:32.316Z" } ] }
{ "bookId": 28 }
{ "message": "Book deleted." }
{ "username": "marcel1", "prompt": "pinapple under the sea", "style": "dr seuss" }
{ "imageUrl": "http://weylin.ddns.net/marcel1/4c9b7e50645511ed88319f2af8e165c6.png" }
{ "bookId": 29, "title": "Pineapple under the sea", "author": "Change author name", "pages": [ { "PageNumber": 1, "ImageURL": "http://weylin.ddns.net/marcel1/4c9b7e50645511ed88319f2af8e165c6.png", "Text": "Text", "Caption": "Caption" } ] }
{ "message": "Book updated", "book": { "id": 29, "title": "Pineapple under the sea", "author": "Change author name", "userId": 4, "pages": [ { "PageId": 20, "PageNumber": null, "ImageURL": "", "Text": "", "Caption": "", "BookId": 29, "updatedAt": "2022-11-14T20:02:45.535Z", "createdAt": "2022-11-14T20:02:45.535Z" } ] } }