GithubHelp home page GithubHelp logo

memo-game-example's Introduction

Memo test game

Introduction

Welcome to Memo test game! This is a full-stack web application built with Laravel for the backend and Next.js for the frontend. The application uses Docker Compose to simplify the development environment setup and utilizes a PostgreSQL database.

Prerequisites

Before you can run this application, please make sure you have the following software installed on your development machine:

Getting Started

To get started with Memo test game, follow these steps:

  1. Clone this repository to your local machine:

    git clone https://github.com/emiliogrv/memo-game-example.git
  2. Navigate to the project directory:

    cd memo-game-example
  3. Set up environment variables:

    Create a .env file in the backend directory for Laravel environment variables. You can use the .env.example file as a template.

    cp backend/.env.example backend/.env
    cp frontend/.env.example frontend/.env
  4. Install dependencies:

    cd backend && composer install && cd ..
    cd frontend && npm install && cd ..
  5. Generate Laravel key:

    cd backend/ && php artisan key:generate && cd ..
  6. Build and run the Docker containers: This command will start the Laravel backend, Next.js frontend, and PostgreSQL database containers.

    docker-compose up --build
  7. Running the Application

    Once the Docker containers are running and the dependencies are installed, you can access the application:

    - Laravel Backend: http://localhost
    // NOTE: there is a GraphQL UI available to try in http://localhost/graphiql
    
    - Next.js Frontend: http://localhost:3000
    
  8. Migrating database

    backend/vendor/bin/sail artisan migrate:fresh --seed
    // NOTE: you can use the sail alias if you configured it before. See point 5 below.

    or you can connect to the laravel container and run:

    php artisan migrate:fresh --seed
  9. Testing

  • Backend

    backend/vendor/bin/sail artisan test
    // NOTE: you can use the sail alias if you configured it before. See point 5 below.

    or you can connect to the laravel container and run:

    php artisan test

    Coverage can be done adding the flag --coverage at the end

    php artisan test --coverage
  • Frontend

    cd frontend && npm run test && cd ..

    Coverage test can be done using

    cd frontend && npm run test:ci && cd ..

Good to know

  1. I used the latest stable Next.js version. I used the experimental feature Server Actions which they'll start to recommend soon (check the well to know section).
  2. These Server Actions are good to keep the secrets keys away from the browser, but is still soon to get it to production and have some testing issues that was able to solved in my end. (more info in vercel/next.js#47448 and vercel/next.js#54757)
  3. Frontend tests where made thinking as a user and with a positive approach in most scenarios.
  4. Backend needs more testing.
  5. You can use Laravel Sail to control the backend if you want to.

memo-game-example's People

Contributors

emiliogrv avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.