An open API service indexing awesome lists of open source software.

https://github.com/victorcmarinho/wongames


https://github.com/victorcmarinho/wongames

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

          

# Wongame

![Wongames](https://raw.githubusercontent.com/victorcmarinho/Wongames/main/image/preview.png)

Game store design using Strapi, NextJs, React and Typescript

E-commerce Game Store

Wongames

This project uses lot of stuff as:

- [TypeScript](https://www.typescriptlang.org/)
- [NextJS](https://nextjs.org/)
- [Styled Components](https://styled-components.com/)
- [Jest](https://jestjs.io/)
- [React Testing Library](https://testing-library.com/docs/react-testing-library/intro)
- [Storybook](https://storybook.js.org/)
- [Eslint](https://eslint.org/)
- [Prettier](https://prettier.io/)
- [Husky](https://github.com/typicode/husky)
- [Strapi](https://strapi.io/)

## Getting Started

First, run the development server front end Wongames:
in: ``cliente/``

```bash
npm run dev
# or
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.

## Commands

- `dev`: runs your application on `localhost:3000`
- `build`: creates the production build version
- `start`: starts a simple server with the build production code
- `lint`: runs the linter in all components and pages
- `test`: runs jest to test all components and pages
- `test:watch`: runs jest in watch mode
- `storybook`: runs storybook on `localhost:6006`
- `build-storybook`: create the build version of storybook

### Run the development CRM server:

in: ``api/``

```bash
yarn install
```

And run using:

```bash
yarn develop
```

The urls to access are:

- `http://localhost:1337/admin` - The Dashboard to create and populate data
- `http://localhost:1337/graphql` - GraphQL Playground to test your queries

The first time to access the Admin you'll need to create an user.

## Postgres DB

You need install Postgres DB for start Strapi API

Install Docker in yout machine

```bash
docker pull postgres

docker run --name postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres

docker exec -it [ID-Container] bash

psql -U postgres

CREATE USER wongames WITH ENCRYPTED PASSWORD 'wongames123';

CREATE DATABASE wongames OWNER wongames;

```

## Populate data

This project uses a `/games/populate` route in order to populate the data via GoG site.
In order to make it work, follow the steps:

- Go to Roles & Permissions > Public and make sure `game:populate` route is public available and the upload as well
- With Strapi running run the following comand in your console:

```bash
$ curl -X POST http://localhost:1337/games/populate

# you can pass query parameters like:
$ curl -X POST http://localhost:1337/games/populate?page=2
$ curl -X POST http://localhost:1337/games/populate?search=simcity
$ curl -X POST http://localhost:1337/games/populate?sort=rating&price=free
$ curl -X POST http://localhost:1337/games/populate?availability=coming&sort=popularity
```