Giter Club home page Giter Club logo

symmetrical-potato's Introduction

Symmetrical Potato

Payday 3 inspired project to plan your heists in New York City.

Remix + API Platform + GraphQL.

Content

Installation

  1. Clone the repository
  2. Add the required hosts to your /etc/hosts file (see #hosts)
  3. (Optional) Add .env.local files to override the various default environment variables
  4. (Optional) Add compose.override.yml to override the default compose configuration
  5. Run make start
  6. Go to http://symmetrical-potato.com to access the Remix app

After the first run, you can use make stop & make up to quickly stop and start the containers. All the available commands are listed in the Makefile.

Hosts

Add the following to your /etc/hosts file:

127.0.0.1 symmetrical-potato.com
127.0.0.1 api.symmetrical-potato.com
127.0.0.1 pma.symmetrical-potato.com
127.0.0.1 mailcatcher.symmetrical-potato.com
127.0.0.1 rabbitmq.symmetrical-potato.com

Which will allow you to access the different services for the project.

Service URL
Remix app (front) symmetrical-potato.com
API Platform (back) api.symmetrical-potato.com
phpMyAdmin pma.symmetrical-potato.com
MailCatcher mailcatcher.symmetrical-potato.com
RabbitMQ rabbitmq.symmetrical-potato.com

Services

All the services used by the project.

Note

Some services are only available in dev. They will never by used in production or even test environments.

Service name Host Aliases Ports Description
caddy sp-caddy, api 80, 443 Caddy is used as the proxy entry to any of the running services. It also services static files from the API.
front symmetrical-potato.com sp-front The Remix app.
php api.symmetrical-potato.com, api:9000 (within the Docker network) sp-php Symfony API with API Platform.
mariadb sp-mariadb The database used by the API.
phpmyadmin pma.symmetrical-potato.com sp-phpmyadmin Used to manage MariaDB easily. Only available in dev.
mailcatcher mailcatcher.symmetrical-potato.com sp-mailcatcher Catches all mails sent by the API. Only available in dev.
rabbitmq rabbitmq.symmetrical-potato.com sp-rabbitmq Queue system for the API (such as mails).

Generating TypeScript types from the API

Use the make generate-types command to generate the TypeScript types from the API. The types will be generated in the front/app/lib/api/types/index.ts file.

Note

For convenience, this folder is automatically fixed by ESLint & Prettier when generating the types.

Authentication

We use simple username/password for development purposes.

Service Username Password
phpmyadmin, mariadb root root
rabbitmq guest guest

Structure

Note

The API uses the classic Symfony structure. This will only describe the Remix app structure.

The Remix app uses the app/routes folder for routing, along with the following structure :

Path Alias Description
app/ ~/ The base app folder where all the files for the app are contained.
app/styles/ ~styles/ The styles folder which contains all SCSS/CSS style for the app.
app/lib/ ~lib/ The lib folder which contains all reusable code (such as utils, API calls, etc...).
app/lib/api/ ~api/ The lib/api folder which contains calls to the API (for reusability) and the generated types.
app/lib/components ~components/ The lib/components folder which contains all the reusable components.
app/lib/utils/ ~utils/ The lib/utils folder containing all the reusable utils.

E2E Testing

To run tests, cd into the E2E folder and run make e2e to run the Playwright tests.

You can launch the UI by running make e2e-ui instead.

Note

If this is your first time running the tests, you will need to run make e2e-install to install the dependencies. If you are not using Bun, you can check the Makefile and replace the bun/bunx commands with npm/npx, but do not commit another lockfile.

symmetrical-potato's People

Contributors

leobruant avatar spacelocust avatar yummyume avatar

Stargazers

 avatar

Watchers

 avatar

symmetrical-potato's Issues

[FEATURE] Admin back-office

Type of feature

Something new

The name of the feature

Admin back-office.

Feature description

This page should only be available to admins.

  • CRUD for users (includes profiles).
  • Accept registration demand from new users.
  • Accept demand to be contractor.
  • CRUD for global assets.
  • CRUD for heists.
  • CRUD for establishments.
  • CRUD for crew members/employees/contractors.
  • CRUD for employees (maybe ?)

Additional information

Create reusable components for the CRUD operations.

Linked to #53.

[FEATURE] Account page

Type of feature

Something new

The name of the feature

Account page

Feature description

The account page will contain different tabs to allow the user to interact with their own data.

Tab 1

  • Change password + preferred locale form

Tab 2

  • Planning

Tab 3

  • Time-off form (only for employee)

Additional information

Linked to #54.

[FEATURE] User rating

Type of feature

Something new

The name of the feature

User rating

Feature description

Users (heisters) should have a rating based on all their CrewMember ratings.

  • Calculate the rating depending on the cop kills, civilian casualties and objectives completed.
  • Make a global rating in the user entity for it (only for heisters).
  • This rating should be displayed on the user's profile (along with their heist history ?).

Additional information

No response

[FEATURE] Heist edition page (contractor)

Type of feature

Something new

The name of the feature

Heist page for contractor.

Feature description

This page is only available to contractors and allows them to create or update a heist.

  • The page should contain a place that was previously selected on the map.
  • You should be able to add/edit all information about the heist.
  • You should be able to handle assets from this page.
  • This page can be a modal.

Additional information

No response

[FEATURE] Employee management page (contractor)

Type of feature

Something new

The name of the feature

Employee management page

Feature description

This page should only be available to contractor.

  • CRUD for users (employee)
  • Get/filter employees by establishment

Additional information

No response

[FEATURE] Dashboard contractor

Type of feature

Something new

The name of the feature

Fancy dashboard for contractors

Feature description

With stats n stuff

Additional information

No response

[FEATURE] Profile GraphQL mutations

Type of feature

Something new

The name of the feature

Profile GraphQL mutations

Feature description

  • Create a mutation to edit the description

Additional information

Linked to #60

[FEATURE] Planning calendar

Type of feature

Something new

The name of the feature

Planning (back)

Feature description

Planning :

  • add a doctrine extension to get planning depending on the role (contractor any planning and employee only his own)

Additional information

Linked with #40.

[FEATURE] Admin Dashboard

Type of feature

Something new

The name of the feature

Fancy Admin Dashboard

Feature description

With stats n stuff

Additional information

No response

[FEATURE] Join or leave a heist

Type of feature

Something new

The name of the feature

Join or leave a heist as a heister

Feature description

A heister should be able to join or leave a heist.

  • When selecting a location and viewing all the available heists, the user can choose one that is available.
  • When joining a heist, they must not already have a heist that overlaps with the heist's timespan, and they must select an available employee to help them (if none was already selected).
  • Only the first person chooses the employee for the heist.
  • Once in the heist, they can view it and buy assets (if they have enough money).
  • The user is able to leave the heist as long as it hasn't started (show a warning saying they will lose their assets).

Additional information

Linked to #91

[FEATURE] Add a review mutation

Type of feature

Something new

The name of the feature

Reviews mutation

Feature description

You should be able to leave a review on a place or an establishment.

  • A heister or an employee can leave a review on a place if they already had a heist there.
  • A heister can leave a review for an establishment they already worked for.
  • An employee can leave a review for an establishment they work(ed) for.
  • Add tests.

Additional information

No response

[CD] Add Ansible cache

Type of feature

Something new

The name of the feature

Add Ansible cache

Feature description

  • Add a cache layer for Ansible to reduce time and improve performance for the deployment phase Deploy VPS

Additional information

No response

[BUG] Fix CI Launch master

Browser

Chrome

Bug description

CI publishing not started on master branch

Operating system

No response

Current output

The Publish API and Front Workflow do not start

Expected output

The Publish API and Front workflow start

Steps to reproduce

No response

Relevant log output

No response

[FEATURE] Account GraphQL query

Type of feature

Something new

The name of the feature

Account backend queries/mutations

Feature description

  • Create a query to change the password
  • Create a query to get the planning
  • Create a query to add a time-off (can only add a time off on workdays)
  • Create a query to delete a time-off (A user can only delete their time off one week before the date)

Additional information

Linked to #52.

[FEATURE] Finished heist handling

Type of feature

Something new

The name of the feature

Finished heist handling

Feature description

We need to create two commands to handle users' balance and status after a heist :

  • This command should check for ended heists that have not been processed yet (status is not ended, but end date is inferior to the current date).
  • For each of these heists, determinate a status (win, failure, etc...) and set the amount won between the min and max offered.
  • For each crew member, employee, establishment and contractor, split the money between them.
  • #70

Additional information

No response

[FEATURE] Upgrade account to contractor (request)

Type of feature

Something new

The name of the feature

Request to be a contractor

Feature description

A user (employee or heister) can ask to be a contractor.

  • Create a page where a heister or an employee can create a request to become a contractor.
  • The request must be approved by an administrator.
  • Show a warning to the user that they will not be able to revert their account and will lose every ongoing heist and automatically leave their establishment.

Additional information

Linked to #63.

[FEATURE] Email styling

Type of feature

An improvement to something that already exists

The name of the feature

Email styling

Feature description

Complete the layout for emails and use it for every email currently sent.

Additional information

Emails are already working, they only need styling.

[FEATURE] Registration page

Type of feature

Something new

The name of the feature

Registration

Feature description

The registration page, with no layout (like the login page).

  • Registration should work.
  • Notify the user that their email is only used to send mails and isn't public.
  • Notify the user that the "Preferred language" setting is only used for things like emails.
  • Notify the user that their username will represent their account and cannot be changed.
  • When registration is successful, it should show a toast saying "Thank you. Your registration request has been sent to the symmetrical potato staff.".
  • This page should have very good SEO.

Additional information

Linked with #45.

[FEATURE] Process reviews

Type of feature

Something new

The name of the feature

Process reviews

Feature description

  • Process reviews for establishments and locations
  • Add a cron job to review them (e.g. every 15 minutes)

Additional information

No response

[TESTS] Add tests for entities

Type of feature

Something new

The name of the feature

Tests for entities

Feature description

Entities should be validated with tests to ensure we cannot add wrong data to them (like a password with only 2 characters).

  • Write tests for User.
  • Write tests for Review.
  • Write tests for Profile.
  • Write tests for Location.
  • Write tests for HeistAsset.
  • Write tests for Heist.
  • Write tests for Establishment.
  • Write tests for EmployeeTimeOff.
  • Write tests for Employee.
  • Write tests for CrewMember.
  • Write tests for ContractorRequest.
  • Write tests for Asset.

Additional information

No response

[FEATURE] GraphQL admin security

Type of feature

Something new

The name of the feature

Security for admin queries/mutations

Feature description

Entities should have protection so that only admin users can retrieve certain properties.

For example, only an admin can see a user's email (other than the user themselves).

  • Check groups for the User entity.
  • Check groups for the Asset entity.
  • Check groups for the Establishments entity.
  • Check groups for the CrewMember entity.
  • Check groups for the Employee entity.
  • Check groups for the ContractorRequest entity.
  • For all these entities, if no basic query exists, create it. Same for mutations.

Additional information

Linked to #42.

[FEATURE] Join or leave a heist

Type of feature

Something new

The name of the feature

Join or leave a heist as a heister

Feature description

A heister should be able to join or leave a heist.

  • When selecting a location and viewing all the available heists, the user can choose one that is available.
  • When joining a heist, they must not already have a heist that overlaps with the heist's timespan.
  • The user is able to leave the heist as long as it hasn't started.

Additional information

Linked to #66

[FEATURE] Authentication page

Type of feature

Something new

The name of the feature

Authentication page

Feature description

The authentication page to allow the user to log in to the heist platform.

  • Login should work.
  • This page should have good SEO and be accessible, but not hint at a heist platform.
  • The page should have almost no layout and only contain the login form (see the Figma).

Additional information

Linked to #46.

[FEATURE] Establishment management

Type of feature

Something new

The name of the feature

Establishment management

Feature description

For contractors

  • Add an establishment
  • Edit an establishment
  • See an establishment
  • Delete an establishment

Additional information

No response

[IMPROVEMENT] Authentication GraphQL mutation

Type of feature

An improvement to something that already exists

The name of the feature

Improve the authentication endpoint

Feature description

Authentication should be done from a non-mapped resource called Token.

  • Create a non-mapped resource called Token.
  • Move the mutation for login to this new resource.
  • Migrate the token and tokenTtl properties from the User to this new resource.
  • Login should now be called request (for requestToken).

Additional information

Linked to #37.

[FEATURE] Heists GraphQL query

Type of feature

Something new

The name of the feature

Heists backend

Feature description

  • Create an enum for heists about its visibility : Public or Draft.
  • Update the heist fixtures if necessary.
  • Create a query for heists that everyone can query as long as they have not ended and are not in a draft state.
  • If ended or in a draft state, only the people directly implied in the heist should be able to see it (contractor, employees and heisters).
  • Create a query to only retrieve a person's heists.
  • A contractor should be able to see all the heists they created.
  • An employee should be able to see all the heists they are assigned to.
  • A heister should be able to see all the heists they are a member of.
  • Write tests for these queries.

Additional information

Linked to #38.

[FEATURE] Add a location

Type of feature

Something new

The name of the feature

Adding a location

Feature description

Locations are not directly added with mutations, but rather when anything related to that location is created.

For example, if I create a heist on a location (that is not in the DB), it needs to be added to the DB.

However, we need to check beforehand if the location exists and is valid (from the Google Maps API).

  • Add a validator to check that the location does exist and is located in New York City.
  • Don't enable direct mutations.
  • Add tests for validating the location.
  • A location should be represented by its latitude and longitude properties (API identifier).

Additional information

No response

[FEATURE] Landing pages

Type of feature

Something new

The name of the feature

Landing pages

Feature description

Landing pages for :

  • Establishments
  • Establishments
  • Heists (drawer)

Additional information

No response

[FEATURE] Manage establishments GraphQL

Type of feature

Something new

The name of the feature

Establishments GraphQL

Feature description

  • Contractors can manage their establishments (create, update & delete)
  • They can have up to 10 establishments
  • Write tests

Additional information

No response

[FEATURE] Calendar component

Type of feature

Something new

The name of the feature

Calendar component

Feature description

Calendar component to schedule appointments and see someone's work week

Additional information

No response

[BUG] Fix progress bar

Browser

Chrome

Bug description

The progress bar currently goes from 100 to 20 after its first appearance, rather than 0 to 20.

Maybe the whole bar should be redone at this point, or make a fix if not too complicated.

Operating system

No response

Current output

The progress bar goes from 100 to 20

Expected output

The progress bar should always reset to 0

Steps to reproduce

Navigate anywhere more than once.

Relevant log output

No response

[FEATURE] Forgotten password

Type of feature

Something new

The name of the feature

Forgotten password

Feature description

A user can request a reset of their password if they forgot it.

Front

  • The user must provide their email.
  • If valid, an email with a unique link (using a one time token) is sent.
  • They can use this page to reset their password.

Mutation

  • The user should have a token field (with an expiry date field).
  • If the token is not expired, allow the user to change their password once.

Additional information

No response

[FEATURE] Registration GraphQL mutation

Type of feature

Something new

The name of the feature

Registration (back)

Feature description

The GraphQL endpoint should expose a mutation to register.

Register mutation :

  • username should be unique and 100 characters max.
  • email should be unique and a valid email.
  • plainPassword should be at least 8 characters with 1 uppercase, 1 lowercase and 1 special character. Should be 100 characters max and required.
  • locale should be either 'fr' or 'en' (see UserLocaleEnum). This locale is only used for off request treatment (like sending emails).
  • reason the reason as to why they want to create an account. Should be 2000 characters max and required.
  • Send an email whenever an account is created.
  • Create tests for this mutation.

Validate account mutation :

  • An admin can approve the registration request of a user.
  • An admin should receive an email when a registration account is sent.
  • When the account is validated, send a mail to the user. When it is not, do nothing (?).
  • Create a test for this mutation.

Additional information

Linked with #44.

[FEATURE] Create a heist

Type of feature

Something new

The name of the feature

Create a heist as contractor

Feature description

  • Form to create/update a heist
  • Query to create a heist
  • Query to update a heist
  • Validations

Additional information

No response

[FEATURE] Contractor upgrade request + approve mutation

Type of feature

Something new

The name of the feature

Contractor request mutation

Feature description

A heister or an employee can make a request to become a contractor.

Request mutation

  • This is basically the ContractorRequest entity.
  • The request must be met with a reason.
  • #85
  • Write tests.

Accept or refuse the request mutation

  • Mutation to accept or refuse the request (with an optional reason, add a field for that).
  • The user will receive an email to inform them.
  • If they have been refused, they can make a request again (and will see the reason for their previous rejection).
  • Accepted users become contractors (with the role).
  • Write tests.

Additional information

Linked to #62.

[FEATURE] Few more mails

Type of feature

An improvement to something that already exists

The name of the feature

Few more mails

Feature description

  • When a heister joins a heist
  • When a heister leaves a heist
  • When an employee is selected in a heist

Additional information

No response

[FEATURE] Heist landing page

Type of feature

Something new

The name of the feature

Heist landing page.

Feature description

This is the main page. When people log in to the platform, they are redirected to this page. This page allows them to join a heist thanks to the mini-map depending on their role.

  • This page should not be indexed by search engines.
  • This page should contain a map with only New York available on it.
  • The URL should probably be /dashboard.
  • The mini-map should display all the available heists.
  • The page (/dashboard) should have a list of the 5 next heists and 5 last heists for the current person logged in.

Additional information

Linked to #50.

[FEATURE] Use Google Map to select a heist

Type of feature

Something new

The name of the feature

Use Google Map to select a heist

Feature description

Implement feature to select heist targets using Google Maps, enhancing planning with street data.

  • The map should only allow to see the New York area.
  • You should be able to select a place and show its details.
  • You should be able to see the place's reviews.
  • You should be able to see the different heists available for that place (and the establishment that created each heist).

Additional information

Needs #39 to add a review.

[FEATURE] Landing page symmetrical potato

Type of feature

Something new

The name of the feature

Landing page symmetrical potato

Feature description

This is the fake landing page. It hides our Heist website.

  • This page should not be accessible if you are logged in (redirect to /dashboard).
  • The page should feature fake advertisement about how we develop symmetrical potatoes.
  • The page is 100% static with good SEO.

Additional information

No response

[FEATURE] Profile page

Type of feature

Something new

The name of the feature

Profile page

Feature description

The profile page of the current user

Additional information

Linked to #61.

[FEATURE] Query a location

Type of feature

Something new

The name of the feature

Query a place in New York City

Feature description

Anyone should be able to query a place.

  • If the place doesn't exist, it's fine, it will be created if it doesn't exist on a mutation.
  • A place should also contain its heists/reviews.

Additional information

Implement #59 if it doesn't already exist.

[FEATURE] Reviews

Type of feature

An improvement to something that already exists

The name of the feature

Ability to review establishments and locations

Feature description

A popover to add a review will do.

Additional information

No response

[FEATURE] Employee management

Type of feature

Something new

The name of the feature

Employee management

Feature description

A contractor can see employees :

  • Globally (a new tab)
  • On an establishment's page (like anyone else)

They can click on the employee to modify/delete them

Additional information

No response

[FEATURE] Employee management GraqhQL query

Type of feature

Something new

The name of the feature

Employee management backend queries/mutations

Feature description

  • Create a query to get employees (add a filter for getting them by establishment or all)
  • Create the rest of the CRUD operations
  • Add tests

Additional information

Linked to #55.

[FEATURE] Create the planning calendar

Type of feature

Something new

The name of the feature

Create the planning calendar.

Feature description

Create the scheduling information component as a calendar.

  • The calendar should contain the heists a heister subscribed to.
  • The calendar should contain the heists a contractor created.
  • The calendar should contain the heists an employee is assigned to.

Additional information

Linked with #47 .

[FEATURE] Filters

Type of feature

Something new

The name of the feature

Filters

Feature description

Add missing filters in front :

  • Map
  • Admin (?)

Additional information

No response

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.