/Inkling

Inkling, one player draws a word or phrase while others race against the clock to guess what it is.

Primary LanguageTypeScript

App is currently in construction.

Inkling

Inkling, one player draws a word or phrase while others race against the clock to guess what it is.


Contents

Tech Stack

  • Vite + Typescript + React.js
  • ShadcnUI
  • Tailwind CSS
  • Zod
  • Node.js + Express.js
  • MongoDB + Mongoose
  • Redis Cloud
  • Knip
  • Socket.io
  • Husky
  • Docker (optional)

Architecture

β”œβ”€β”€ πŸ“.husky                   # Git hooks for pre-commit checks  
β”œβ”€β”€ πŸ“backend                  # Backend logic with API, models, services, and configurations  
β”‚   β”œβ”€β”€ πŸ“src                  # Source code for the backend  
β”‚   |   β”œβ”€β”€ πŸ“config               # Configuration for MongoDB, Redis, and Socket.IO  
β”‚   |   β”œβ”€β”€ πŸ“models               # MongoDB models for User and Game  
β”‚   |   β”œβ”€β”€ πŸ“routes               # API routes (Auth) with controllers
β”‚   |   β”œβ”€β”€ πŸ“utils                # Utility functions like JWT and hashing 
β”‚   |   β”œβ”€β”€ πŸ“services             # Service logic (e.g., game services) 
β”‚   |   β”œβ”€β”€ server.js          # Server entry point  
β”‚   |   └── app.js             # Creating an express instance
β”‚   β”œβ”€β”€ Dockerfile             # Docker configuration
β”‚   β”œβ”€β”€ knip.config.js         # Knip configurations
β”‚   └── docker-compose.yml     # Multi-container Docker setup  
β”œβ”€β”€ πŸ“frontend                 # Frontend code using Vite + React + Typescript with Tailwind CSS  
β”‚   β”œβ”€β”€ πŸ“@                    # ShadcnUI components and utility libraries  
β”‚   β”œβ”€β”€ πŸ“public               # Public assets  
β”‚   β”œβ”€β”€ πŸ“src                  # Source code for frontend app  
β”‚   |   β”œβ”€β”€ πŸ“context              # React contexts (Auth, Canvas, Game)  
β”‚   |   β”œβ”€β”€ πŸ“hooks                # Custom hooks for API requests and sockets  
β”‚   |   β”œβ”€β”€ πŸ“pages                # Application pages like Account and Game  
β”‚   |   └── πŸ“utils                # Helper functions (e.g., date and drawing utilities)
β”‚   β”œβ”€β”€ tailwind.config.js     # Tailwind CSS configuration  
β”‚   β”œβ”€β”€ tsconfig.json          # TypeScript configuration  
β”‚   └── vite.config.ts         # Vite configuration  
└── .gitignore                 # Files to be ignored by Git  

Installation

  1. Clone the repo
git clone
  1. Move to Inkling
cd Inkling
  1. Install dependencies
npm install
  • Frontend

    1. Move to frontend
    cd frontend
    1. Install dependencies
    npm install
    1. Create a .env file
    touch .env
    1. Add server url
    VITE_SERVER_URL=http://localhost:3000
    1. Run the development server
    npm run dev
  • Backend (with docker)

    1. Move to backend
    cd backend
    1. Pull the docker container
    docker pull immortalnova/inkling
    1. Create a .env file
    touch .env
    1. Add the below to .env file
    NODE_ENV=development
    1. Create a MongoDB database and add your Mongo URL to .env file
    MONGO_URL=mongodb+srv://.....
    1. Generate a random secret key for digital signing (run in terminal) :
    openssl rand -base64 32
    1. Add your secret key used to hash JWT tokens
    JWT_SECRET=secret_key.....
    1. Create a Redis Cloud account and add your Redis details to .env file
    REDIS_PASSWORD=password.....
    REDIS_HOST=redis-something.....redis-cloud.com
    REDIS_PORT=xxxxx
    1. Add client url
    CLIENT_URL=http://localhost:5173
    1. Run an image locally (with env variables):
    docker run --env-file ./.env -p 3000:3000 immortalnova/inkling
  • Backend (without docker)

    1. Move to backend
    cd backend
    1. Install dependencies
    npm install
    1. Create a .env file
    touch .env
    1. Add the below to .env file
    NODE_ENV=development
    1. Create a MongoDB database and add your Mongo URL to .env file
    MONGO_URL=mongodb+srv://.....
    1. Generate a random secret key for digital signing (run in terminal) :
    openssl rand -base64 32
    1. Add your secret key used to hash JWT tokens
    JWT_SECRET=secret_key.....
    1. Create a Redis Cloud account and add your Redis details to .env file
    REDIS_PASSWORD=password.....
    REDIS_HOST=redis-something.....redis-cloud.com
    REDIS_PORT=xxxxx
    1. Add client url
    CLIENT_URL=http://localhost:5173
    1. Run development server:
    npm run dev

Frontend Deployment to Vercel

Backend Deployment to Render

Deploy with Vercel