Before you continue, ensure you have installed the following requirements:
The Cryptify project is setup using a monorepo, so a single repository, that contains all the different software services used in the project. This is done by using yarn workspaces and gives us the advantage of sharing code between our different services and using the same core infrastructure and configuration across all our services.
Note: On a Linux environment, run all docker and docker-compose commands as sudo
- Clone the repository
$ git clone git@github.com:SOEN-490-Capstone/Cryptify.git
- Install all dependencies
$ cd Cryptify $ yarn install
- Create the docker container and log output
$ docker-compose up -d api $ docker-compose logs -f api
- (Optional) Connect to the database on
localhost:5432
in pgAdmin
You can now access the server at http://localhost:3001
Ports:
By default, the client, server, database will be exposed on
localhost:3000
,localhost:3001
, andlocalhost:5432
, respectively. If you have a port conflict with either one, change their respective docker-compose entry ports as follows:
- Client from
3000:19006
to<new-port>:19006
- Server from
3001:80
to<new-port>:80
- Database from
5432:5432
to<new-port>:5432
.
- Setup
adb
and enable USB debugging on your device by following these steps - Setup the environment variables required for your client app to talk to the backend api
- Make a copy of the
.env.dev
file and rename it to.env
- Find the ip address of your local machine and enter it on the line for
API_URL=
- Make a copy of the
- Export the directory of your Android SDK and add it to your path, if your SDK is installed in the directory metro is expecting this step can be skipped
- Install all dependencies
$ cd Cryptify $ yarn install
- Start the server and database
$ docker-compose up -d api
- Start the app on your device in development mode, once the metro loader has appeared press 'a' to run the app in your emulator
$ `yarn run client:start:dev`
- Install all dependencies
$ cd Cryptify $ yarn install
- Start the client, this will also bring up the server and database
$ docker-compose up -d client
- (Optional) Log the output of the client
$ docker-compose logs -f client
You can now access the client at http://localhost:3000
- Start the api docker container
$ docker-compose up -d api
- Run all tests with the following command
$ docker-compose exec api yarn api:test:unit
- Start the api docker container
$ docker-compose up -d api
- Start the test db docker container
$ docker-compose up -d test-db
- Run all tests with the following command
$ docker-compose exec api yarn api:test:integration
Follow the steps to setup your device specific detox config
- Open your emulator
- Run the system test command for your setup without building
or run the system tests with a new build
$ ./system-test [android | ios]
$ ./system-test [android | ios] build
Follow the steps to install k6 for your operating system or with docker
- Build the tests files, inside the
performance-tests
package root$ yarn build
- Run the performance test
$ ./performance-tests [test-name]
A csv output of the test results can be found in the results folder with the file name of test-name.csv
Run linter and formatter with the following command in the root workspace Cryptify
directory
$ yarn run lint:fix
If you run into issues with the database or need to reset it for any reason follow the steps below
- Delete the
pgdata
folder, this will delete the persistent docker postgresql volume - Start up the server and database through docker
$ docker-compose up -d api
- Build the docker image with the production target
$ docker build --target production -t cryptify-api-prod -f ./packages/docker/api.Dockerfile .
- Create a container from the production image
$ docker run -p 3001:80 cryptify-api-prod
- Run script to push all containers to ECR, ask team member for URN if needed
./push-to-ecr <AWS URN>
- Run
cryptify-task
in AWS console under thecryptify-cluster
cluster. Make sure to use thecryptify-user
IAM role andCryptifyGroup
security group - Configure task to run on
.25 vCPU | .5 GB
and Fargate spot instance
The server for this project uses the TypeScript language and follows the style guide defined by Google: https://google.github.io/styleguide/tsguide.html
Name | StudentId | GitHub Username | |
---|---|---|---|
Jason Gerard | 40079266 | jason-gerard | jasongerard321@gmail.com |
Andre Ibrahim | 40132881 | Andre-Ibrahim | andre.khaled.ibrahim@gmail.com |
Domenic Seccareccia | 40063021 | domsec | dom_seccareccia@hotmail.com |
Alexandru Bara | 40132235 | alexbara2000 | alexandrubara2000@gmail.com |
Pola Farid | 40125357 | PolaFarid | polacris2@gmail.com |
Michael Warner | 40124302 | narroarrow | michael.gregory.warner@gmail.com |