Skip to content

christiecamp/stroking-luck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

License: mit Node.js Badge MySql Badge Express.js Badge Sequelize Badge

Dotenv Badge Nodemon Badge Insomnia Badge Heroku Badge Canva Badge

View Badge

table-of-contents

overview

STROKE OF LUCK is an interactive Choose Your Own Adventure (CYOA) game where adventurers partake on a journey, guided by chance. The app follows the MVC paradigm in its architectural structure, using Handlebars.js as the templating language,Sequelize as the ORM, the express-session npm package for authentication, and Heroku, the platform hosting the application.

The express-session package stores the session data on the client in a cookie - when an adventurer is idle on STROKE OF LUCK for more than a set time, the cookie will expire and the adventurer will be required to log in again to start a new session.

user-story

luck-list

team

christiecamp       seeyouthursday       greenstone83

installation

The application is invoked using the following commands:

Clone the repository in your local development enviornment.
git clone https://github.com/christiecamp/stroking-luck.git
Create a .env with your information
Navigate to the command line and input:
npm i :: express, mysql2, dotenv --save, sequelize, nodemon --save-dev, handlebars, express-session, express-handlebars, bcypt, connect-session-sequelize
mysql -u root -p
SOURCE db/schema.sql;
quit
npm run seed
nodemon server

usage

INSTRUCTIONS:

  1. Open the Integrated Terminal and follow the installation guidelines

  2. Interact with STROKE OF LUCK's back end with Insomnia by testing the below:

    • GET all users, stories
    • GET user, story by id
    • CREATE user, story
    • UPDATE user, story,
    • DELETE story
  3. Open the application deployed on Heroku

  4. Signup by creating a username/password

  5. Create, update, and delete stories through your dashboard

  6. View all stories via the dashboard

  7. Logout to leave the application

screenshot

screenshot demonstrates STROKE OF LUCK's back end, testing all routes with Insomnia, and the functional application deployed on Heroku

demo

coming soon!

testing

TESTING WITH INSOMNIA:

There are different tools available that can test reading/writing operations in a web browser - in this application we use Insomnia, a REST client that makes it easy to send HTTP requests to an API and view response details.

  1. After installing Insomnia, open a new document.

  2. Interact with STROKE OF LUCK'S back end by testing the below commands:

GET all users & stories
http://localhost:3013/api/user
http://localhost:3013/api/story
GET user by id
http://localhost:3013/api/user/1
CREATE story
http://localhost:3013/api/story/
{
	"title": "",
	"content": ""
}
UPDATE story
http://localhost:3013/api/post/1
{
  "title": "",
  "content": ""
}
DELETE story
http://localhost:3013/api/story/

sources

Here's a list of technologies used:

  1. Node.js - is an open-source, cross-platform JavaScript runtime environment.

  2. Express.js - a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.

  3. Handlebars.js - a JavaScript templating library used in web development to create dynamic web pages and generate HTML content based on data.

  4. MySQL2 - MySQL is a relational database management system based on SQL – Structured Query Language.

  5. Sequelize - a Node.js based Object Relational Mapper that makes it easy to work with MySQL databases. An Object Relational Mapper performs functions like handling database records by representing the data as objects.

  6. express-handlebars - a Handlebars view engine for Express which doesn't suck.

  7. express-session - a Node.js module that offers simple session middleware for Express.

  8. connect-session-sequelize - a SQL session store using Sequelize.js.

  9. Bcyrpt - a Node.js library to help hash passwords.

  10. Dotenv - a zero-dependency module that loads environment variables from a .env file into process.env.

  11. Nodemon - a Node.js tool that helps develop applications by automatically restarting the node application when file changes in the directory are detected.

  12. js-confetti - Node.js library to add a little bit of spice to your buttons.

  13. Insomnia - an open source desktop application that assists in designing, debugging, and testing APIs (specifically in this instance, HTTP-based RESTful APIs).

  14. Heroku - used to deploy, manage, and scale the application.

license

links

connect

Github Badge

About

STROKE OF LUCK 🌟 is an interactive Choose Your Own Adventure (CYOA) game πŸ‰ where adventurers βš”οΈ partake on a journey 🏞 , guided by chance.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published