platelet icon indicating copy to clipboard operation
platelet copied to clipboard

Asking for help to start contributing

Open MomoRazor opened this issue 5 months ago • 10 comments

Hi guys,

Firstly, I want to let you guys know how cool this project is. I've been looking around for open source projects I can contribute too, and this one seems like a really great tool thats done some real good in the world. I'm eager to help you guys maintain it, if its still being maintained and you're still open to new contributors.

I've taken the liberty of forking and following the CONTRIBUTING.md, in order to start familiarizing myself with the repo, before targeting a specific issue, but I've run into some issues and I'd be glad for the help.

First, I tried to simply turn on the system through docker-compose. I ran docker-compose up in the root directory, and it seems to be failing the moment it tries to run the installation packages command in line 5.

=> ERROR [2/8] RUN apt-get update && apt-get install -y build-essential libcairo2-dev libpango1.0-dev libj  0.5s
------                                                                                                            
 > [2/8] RUN apt-get update && apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev:                                                                                                
0.256 Ign:1 http://deb.debian.org/debian buster InRelease                                                         
0.283 Ign:2 http://deb.debian.org/debian-security buster/updates InRelease                                        
0.343 Ign:3 http://deb.debian.org/debian buster-updates InRelease
0.400 Err:4 http://deb.debian.org/debian buster Release
0.400   404  Not Found [IP: 199.232.26.132 80]
0.426 Err:5 http://deb.debian.org/debian-security buster/updates Release
0.426   404  Not Found [IP: 199.232.26.132 80]
0.448 Err:6 http://deb.debian.org/debian buster-updates Release
0.448   404  Not Found [IP: 199.232.26.132 80]
0.452 Reading package lists...
0.460 E: The repository 'http://deb.debian.org/debian buster Release' does not have a Release file.
0.460 E: The repository 'http://deb.debian.org/debian-security buster/updates Release' does not have a Release file.
0.460 E: The repository 'http://deb.debian.org/debian buster-updates Release' does not have a Release file.
------

Following this, I bumped the Node version in the Dockerfile to v18 and tried again. This time, the run got much further, failing only in the last instruction, which is the starting of the system.

Recreating platelet_web_1 ... 

ERROR: for platelet_web_1  'ContainerConfig'

ERROR: for web  'ContainerConfig'
Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 33, in <module>
    sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 81, in main
    command_func()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 203, in perform_command
    handler(command, command_options)
  File "/usr/lib/python3/dist-packages/compose/metrics/decorator.py", line 18, in wrapper
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1186, in up
    to_attach = up(False)
                ^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1166, in up
    return self.project.up(
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/project.py", line 697, in up
    results, errors = parallel.parallel_execute(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 108, in parallel_execute
    raise error_to_reraise
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 206, in producer
    result = func(obj)
             ^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/project.py", line 679, in do
    return service.execute_convergence_plan(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/service.py", line 579, in execute_convergence_plan
    return self._execute_convergence_recreate(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/service.py", line 499, in _execute_convergence_recreate
    containers, errors = parallel_execute(
                         ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 108, in parallel_execute
    raise error_to_reraise
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 206, in producer
    result = func(obj)
             ^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/service.py", line 494, in recreate
    return self.recreate_container(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/service.py", line 612, in recreate_container
    new_container = self.create_container(
                    ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/service.py", line 330, in create_container
    container_options = self._get_container_create_options(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/service.py", line 921, in _get_container_create_options
    container_options, override_options = self._build_container_volume_options(
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/service.py", line 960, in _build_container_volume_options
    binds, affinity = merge_volume_bindings(
                      ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/service.py", line 1548, in merge_volume_bindings
    old_volumes, old_mounts = get_container_data_volumes(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/compose/service.py", line 1579, in get_container_data_volumes
    container.image_config['ContainerConfig'].get('Volumes') or {}
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'ContainerConfig'

Retrying the above with Node version 20 and 22 gave similar results.

With that failing, I skipped on to trying to setup the system for development. I ran npm i, which worked well, but when I followed that with running npm start, i got a couple of warnings referencing a 'aws-exports' file which some typescript files (namely TenantListProvider.tsx and uploadProfilePicture.ts) could not find. This does mean that the system worked, but all I could see was the following:

Image

Just for completedness sake, I tried the setup steps with Node versions 16/18/20 and 22, all of which returned with the same behaviour.

I'm not sure what to try further now in order to start getting to grips with the system, so I'm hoping I can get some assistance to get started. Apologies in advance if I've missed something fairly obvious, or some pertinent documentation.

Thank you!

MomoRazor avatar Jul 16 '25 19:07 MomoRazor

Hi @MomoRazor

Thanks for your interest!

There are a few options to get started.

provision a backend on AWS Amplify.

  • set up an AWS profile and run amplify push
  • open the cognito pool in the AWS console for that amplify app
  • add a user to the pool and add it to the "SUPER" group
  • back in the terminal run amplify api console
  • log in with the user you created and run the mutation registerTenant with relevant details (tenantName can be anything)
  • once all of that is done you'll receive a registration email to the email address you provided and can log in

Amplify push should create aws-exports and on starting the server with npm start it should present you with a login screen.

This way is the most hands on and gives you a full backend to tinker with.

use a tenant API

This requires a lot more set up and is closest to production, but I could provide details for a testing environment if you wanted.

start in demo mode

This is the easiest and quickest way to get something to work on as it doesn't require any backend.

Add this to a .env file in the root directory:

REACT_APP_OFFLINE_ONLY=true
REACT_APP_POPULATE_FAKE_DATA=true
REACT_APP_DEMO_MODE=true
REACT_APP_DEMO_PROFILE_PICTURES_BUCKET_NAME=platelet-demo-profilepics
REACT_APP_DEMO_PROFILE_PICTURES_BUCKET_REGION=eu-west-1
REACT_APP_GOOGLE_MAPS_API_KEY=<optional>

The maps API key needs to be provisioned on Google cloud, but it isn't essential to functionality. It just shows a map on a task overview.

If you're most interested in checking out the front end, I'd go with demo mode to start with.

Let me know if you have any more questions.

duckbytes avatar Jul 17 '25 16:07 duckbytes

Hi @duckbytes

Thanks for the prompt reply! I managed to get demo mode working, so I'll probably do some frontend work to start off easy with the project. I'll probably target a specific issue and ask on it directly if its still valid and such before starting to work, but if there is any priority system somewhere, just let me know so I can follow it.

Apart from that, I'm not sure if you think it would be helpful to update the contribution guide to have the information you've given me here included. If so, I'll gladly do a separate PR on this issue specifically before it gets closed.

Thank you again :)

MomoRazor avatar Jul 17 '25 21:07 MomoRazor

Yes the document is a bit sparse, so that would be helpful, thank you.

duckbytes avatar Jul 18 '25 07:07 duckbytes

Hey @MomoRazor just in case this is or isn't obvious, but any new work should be done in typescript.

duckbytes avatar Jul 19 '25 08:07 duckbytes

Of course, I'll likely never elect to write javascript ever again since changing over, unless I really have to heh :). I will add it to the documentation as a contributing note. I'll probably have time to submit something later today

MomoRazor avatar Jul 19 '25 13:07 MomoRazor

I've written the majority of the new contribution page documentation, as can be seen here, althought as someone who has never used AWS before, I have not managed to setup the AWS amplify approach with the instructions you have given me so far. I've managed to up deploying an app, but could not get to the cognito pool that is connected specifically with my newly created app. I would love some further help so I can set myself up, as well as make sure the documentation is accurate.

Thank you!

MomoRazor avatar Jul 20 '25 22:07 MomoRazor

hey @MomoRazor

After deploying with amplify push you can run in the same terminal amplify console. It should open up a URL in your browser. From there you can click the Authentication tab. Take a note of the name of the pool and click View in Cognito. Then select it from the list.

duckbytes avatar Jul 21 '25 11:07 duckbytes

Hi @duckbytes,

Thanks for responding, and sorry for the delay, was a bit overly busy these last few days. I've continued to make progress at this, and managed to get further into setting up the 2nd approach to contributing, while in parallel writing the documentation for it. I do feel that I've had to add quite a few more steps simply because I was setting up AWS's development environment for the first time as well.

That said, I did find some roadblocks on the way to where I've gotten so far, and would like to check with you on if I've solved them properly.

  • I'm aware that running amplify init did a number of changes to the codebase that are to be checked in. I commited these changes in a separate commit as I'm not sure if this is right and if they should be committed at all. Let me know so I can know if they should make it to any PR that I might push at the end of this.
  • During amplify push I ran into an issue were the project was citing a PeerDependency issue with @types/react-dom. I checked the version and it was v18 while everything else react related was on v17. So I bumped down that version and tried re-installing stuff again from scratch (cleared the node-modules and removing the package-lock.json). This then led me to a couple of failures during npm i that I traced down to canvas. I needed me to install certain dependencies on my system (I referenced these in my documentation as well). Fixing this got me to a place were npm i was simply hanging forever for some reason. I removed some duplicate packages from the package.json with no affect, so then I decided to try yarn which somehow worked managed to install everything.
  • After running amplify push it made more progress, but unfortunately it then timed out when trying to install sharp, which is not a package that is reference in the main package.json, but rather in one of the package.jsons within the amplify directory. I then proceeded to update the sharp to its latest version and clear up the package-lock of that specific installation and that seemed to have fixed the previous issue of the hanging npm i and also fixed the amplify push. I've committed the changes mentioned in these 2 points in their own commit, so you can decide for yourself if they are any good (the yarn changes were reverted)
  • amplify push also made a lot of changes to the code base, which I committed separately for just in case.

My final issue is with registerTenant as it is returning 401. I'm pretty sure its because I haven't logged in with the right user, but even though I have managed to create a user in Cognito and also giving it the Super group, I'm unable to login with it to API Console that I'm navigated to when running amplify api console

Thanks in advance for any advice. Thank you!

MomoRazor avatar Jul 29 '25 17:07 MomoRazor

Hey @MomoRazor

It shouldn't be necessary to take these extra steps.

amplify init is only for new projects.

What operating system are you using and which node version? I normally use node 18.

My guess is that either your initial amplify init command messed some things up or there's some difference between the system you're developing on.

You can log in on the console with the key icon:

Image

and then select any client ID.

duckbytes avatar Aug 04 '25 18:08 duckbytes

Hi there, sorry for the delay in working on this, last few weeks where extra busy.

I'm using ubuntu 24 and node 22.

I'll start from scratch again, and see if how much further I'll get by changing to node 18 using nvm.

MomoRazor avatar Aug 22 '25 17:08 MomoRazor