Thanks to visit codestin.com
Credit goes to github.com

Skip to content

pdrzxzz/cruzy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cruzy - Online Crossword Puzzles

Cruzy Logo

Available at: https://mint-ample-dodo.ngrok-free.app/

Use artificial intelligence to develop your own crosswords and explore a wide range of customizable options for you.

πŸ“‹ Index

About the Project

Cruzy is a web platform for playing online crossword puzzles with AI-customized themes. This project was developed with Node.js and offers an interactive experience for word game lovers. With artificial intelligence, it's possible to play at various difficulty levels and diverse themes, making the game fun and educational.

Development Team

  • Emanuel Pedroza @pdrzxzz (Team Leader)
  • Bianca Paes @bianca-bpas
  • JoΓ£o Pontes @pontesjpp
  • LetΓ­cia Andrade @andrxmedy
  • Luma Rios @lumarf
  • Vitor Lacerda

Technologies Used

  • Node.js
  • Express.js
  • Passport.js
  • HTML5
  • CSS3
  • JavaScript
  • Pug.js
  • Bootstrap
  • Fabric.js
  • Mongoose
  • MongoDB
  • OpenAI API
  • Jest
  • Render

Features

  • User registration and login
  • Interactive crossword puzzles
  • AI-customized themes
  • SinglePlayer Game Mode with room history
  • Responsive interface for desktop and mobile devices

How to Run the Project Locally

  1. Make sure you have Node.js installed on your computer

    node --version
  2. Clone the project repository

    git clone https://github.com/pdrzxzz/Projeto-Cruzy.git
  3. Access the project directory

    cd Projeto-Cruzy
  4. Install all required dependencies

    npm install
  5. Install Nodemon globally (for development)

    npm install nodemon -g
  6. Request the necessary environment variables (as per the .env.example file) from the project creators.

  7. Create a .env file in the root directory and fill it with the received information.

  8. Run the script.

    npm run start

    If it doesn't work, you can try:

    nodemon app.js
  9. After starting the server, access the application in your browser: http://localhost:33322

Project Structure

Projeto-Cruzy/
β”œβ”€β”€ config/
β”œβ”€β”€ controllers/         # Application controllers
β”œβ”€β”€ models/              # Data models (MongoDB)
β”œβ”€β”€ public/              # Static files
β”‚   β”œβ”€β”€ css/             # CSS styles
β”‚   β”œβ”€β”€ js/              # Client-side JavaScript scripts
β”‚   └── images/          # Images and media
β”œβ”€β”€ routes/              # Application routes
β”œβ”€β”€ views/               # Pug templates
β”‚   β”œβ”€β”€ layouts/         # Base layouts
β”‚   β”œβ”€β”€ partials/        # Partial components
β”‚   β”œβ”€β”€ rooms/           # Room-related views
β”‚   └── users/           # User-related views
β”œβ”€β”€ middleware.js        # Middleware functions
β”œβ”€β”€ app.js               # Main application file
β”œβ”€β”€ package.json         # Configurations and dependencies
└── README.md            # Project documentation

Code Architecture

Backend

MVC Structure

The project follows a Model-View-Controller (MVC) architecture:

  • Models: Defines data schemas and models using Mongoose for MongoDB
  • Views: Renders interfaces using Pug templates
  • Controllers: Contains business logic and data handling

Main Components

  1. app.js: Application entry point

    • Configures middleware, routes, and MongoDB connection
    • Initializes authentication mechanism using Passport.js
  2. models/

    • user.js: Defines the user model and manages authentication
    • room.js: Manages game rooms with schema for theme, words, and settings
  3. controllers/

    • users.js: Manages login, registration, and authentication
    • rooms.js: Handles creation, deletion, and access to rooms
    • index.js: Controls main routes
  4. routes/

    • Defines and organizes API endpoints and application routes

Frontend

  1. public/js/

    • Game.js: Main class that manages game logic
    • createCrossword.js: Algorithm for creating the crossword puzzle board
    • displayGame.js: Renders the game using Fabric.js for interactive canvas
  2. views/

    • Pug templates organized by functionality
    • Layout system and partials for code reuse

AI Integration

  • controllers/rooms.js: Integrates with the OpenAI API to generate crossword puzzles with customized themes
  • The system sends specific prompts to the API and processes responses to create games

Authentication System

  • Implemented using Passport.js with local strategy
  • Session management via MongoDB for persistence

Data Flow

  1. User authenticates β†’ passport-local validates
  2. User creates a room β†’ OpenAI generates words and clues
  3. System generates the board β†’ crossword algorithm optimizes layout
  4. User plays β†’ interaction via Fabric.js and real-time validation

Documentation

For more details, see our Official Documentation.

License

This project is under the MIT license.

About

An AI-powered web platform for creating and playing customizable crossword puzzles online.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •