crowd.rocks is a server/client version of a peer-to-peer research project.
Differences:
- No data is stored on the client. crowd.rocks is a normal server/client app that uses GraphQL.
- No ORM.
- No graph schema. We are using normal relational schema tables.
- 100% Ionic components. This will be deployed on both app stores so we won't use MUI.
Commands are run from each project folder (env
, api
, frontend
, infra
).
docker-compose --env-file .env up -d
docker logs -f env_postgres_1_1
Note:
If you don't see SQL statementes being logged, most likely your postgres docker image was built earlier. So you should rebuild and start container again:
-change directory to env (containing docker-compose.yml): cd ../env
-rebuild docker-compose build
and start containers: docker-compose --env-file .env up -d
use postgres tools or pgadmin or any other tool to execute command:
CREATE EXTENSION pldbgapi
Check current postgers config file:
SHOW config_file;
it shoud be '/etc/postgresql.conf'. If not - something gone wrong with posgtres image build. Try to rebuild them:
docker-compose build
Now you can use pgadmin to debug plpgsql procedures/functions.
- open API folder in new vscode window
- add env vars: run the env var exports in the API readme file
- install dependencies:
yarn set version berry
thenyarn
- setup vscode to find dependencies:
yarn dlx @yarnpkg/sdks vscode
- run API:
yarn run start --watch
- GraphQL playground:
http://localhost:3000/graphql
Frontend is Ionic React
- install ionic globally:
npm install -g @ionic/cli
- install dependencies:
npm i
- run:
ionic serve
ornpm run dev
There may be times when capacitor builds at a different api level than what Android Studio uses. At least right now, it's building Android apps at the SDK version 33, when the Android Studio is at 34. Just for now you can change the following in variables.gradle if you have capacitor generate android app:
// generated was 33
compileSdkVersion = 34
targetSdkVersion = 34
- Setup your docker environment and get the API and frontend projects running.
- Create database schema in
./api/src/core/sql/schema/v1.schema.sql
. - Update the
core/database-version.control.service.ts
file as needed when adding new DB functions. - Cretea a module folder in the API
components
folder as needed. - Add a GraphQL types file and create your resolvers as needed.
- With the API running, run
npm run codegen
on the frontend to generate the new types within the frontend project. - Create the Ionic React components necessary on the frontend.
There some imports in the API and Frontend which rely on utils/dist folder. So, if anything in the utils lib was changed, utils should be rebuilt to allow these changes be imported by API and Frontend:
$ cd utils
$ npm run build
Its also a good idea to run npm run codegen
on the frontend if you have messed around
with GraphQL types anywhere