Skip to content

Latest commit

 

History

History
118 lines (87 loc) · 3.08 KB

README.md

File metadata and controls

118 lines (87 loc) · 3.08 KB

Mind Reader Game

Description

Website that allows users to play a mind reader game.

The game is simple: one user is given a word, and the other person has to guess it using related words.

Technologies

  • AdonisJS
  • SSR with AdonisJS (InertiaJS - React)
  • UnoCSS
  • BiomeJS
  • Redis
  • PostgreSQL
  • Docker

Makefile Commands

The Makefile provides shortcuts for common tasks. Below is a list of available commands.

General Commands

  • make install - Install dependencies with pnpm.
  • make docker-dev - Run the development environment using Docker.
  • make docker-prod - Run the production environment using Docker.
  • make migrate - Run database migrations.
  • make seed - Seed the database with initial data.
  • make rollback - Rollback all migrations.
  • make test - Run tests.
  • make lint - Check code format and linting.
  • make lint-fix - Fix code format and linting issues.

Initialization Commands

  • make init-dev - Set up the development environment: installs dependencies, runs Docker, migrates and seeds the database, and starts the dev server.
  • make init-prod - Set up the production environment: installs dependencies, runs Docker, and migrates the database.
  • make reset-db - Rollback all migrations, rerun migrations, and seed the database.

Additional Commands

  • make jobs - Run background jobs with pnpm jobs:run.
  • make offline - Set BYPASS_LOGIN=1 in .env to enable offline mode.

Setup Instructions

Development Environment

  1. Clone the Repository

    git clone https://github.com/prisca-c/mind-reader.git
    cd mind-reader
  2. Copy Environment Variables Copy .env.example to .env and populate the required variables.

  3. Run make init-dev This command will:

    • Install dependencies
    • Set up Docker for development
    • Run migrations and seed the database
    • Once make is done, you can run make serve and make jobs in separate terminals.
  4. Access the App Open http://localhost:3333 in your browser.

Production Environment

  1. Clone the Repository

  2. Copy Environment Variables Copy .env.example to .env and fill in the variables.

  3. Run make init-prod This command will:

    • Install dependencies
    • Set up Docker for production
    • Run migrations

Offline Mode (Without Social Login)

To bypass social login, set BYPASS_LOGIN=1 in your .env file

This allows login with a default user:

await this.userRepository.findOrCreate('random@user.com', {
  username: 'RandomUser',
  avatarUrl: null,
  providerId: 1,
});

Database Commands

The following commands allow you to manage your database:

  • Run Migrations: make migrate
  • Seed the Database: make seed
  • Rollback Migrations: make rollback
  • Reset Database: make reset-db

Testing

To run tests, use:

make test

Linting and Formatting

To check code formatting and linting:

make lint

To automatically fix formatting and linting issues:

make lint-fix