Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated sample_data import script, docs updated, githhub action to test #3146

Merged
17 changes: 17 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,20 @@ jobs:
source venv/bin/activate
python .github/workflows/scripts/check_docstrings.py --directories .github


# Import-Sample-Data:
# name: Import Sample Data
# runs-on: ubuntu-latest
# steps:
# - name: Checkout this repository
# uses: actions/checkout@v4.2.2
# - name: Create .env file for talawa api testing environment
# run: cp ./envFiles/.env.ci ./.env
# - name: Build talawa api non production environment docker image
# run: docker compose build
# - name: Run import:sample-data
# uses: addnab/docker-run-action@v3
# with:
# image: talawa_api
# options: --env-file ./envFiles/.env.ci
# run: pnpm run import:sample-data
12 changes: 12 additions & 0 deletions docs/docs/docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,18 @@ devcontainer build --workspace-folder .
devcontainer up --workspace-folder .
```

#### Import Sample Data
gautam-divyanshu marked this conversation as resolved.
Show resolved Hide resolved

1. Once the server is running, open a new terminal session.
2. Open a bash session inside the running container:
```bash
docker exec -it talawa-api-1 /bin/bash
```
3. Inside the container, run the following command to import sample data into the database:
gautam-divyanshu marked this conversation as resolved.
Show resolved Hide resolved
```bash
pnpm run import:sample-data
```
gautam-divyanshu marked this conversation as resolved.
Show resolved Hide resolved

gautam-divyanshu marked this conversation as resolved.
Show resolved Hide resolved
### Setup: Using the VScode IDE

You can setup the app using the VScode IDE. Here are the steps to follow:
Expand Down
197 changes: 99 additions & 98 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,100 +1,101 @@
{
"author": "Palisadoes Foundation",
"bugs": {
"url": "https://github.com/PalisadoesFoundation/talawa-api/issues"
},
"dependencies": {
"@fastify/cors": "^10.0.2",
"@fastify/helmet": "^13.0.1",
"@fastify/jwt": "^9.0.3",
"@fastify/rate-limit": "^10.2.2",
"@fastify/type-provider-typebox": "^5.1.0",
"@node-rs/argon2": "^2.0.2",
"@pothos/core": "^4.3.0",
"@pothos/plugin-relay": "^4.3.0",
"@sinclair/typebox": "^0.34.15",
"ajv-formats": "^3.0.1",
"close-with-grace": "^2.2.0",
"drizzle-orm": "^0.39.1",
"drizzle-zod": "0.6.1",
"env-schema": "^6.0.1",
"fastify": "^5.2.1",
"fastify-plugin": "^5.0.1",
"graphql": "^16.10.0",
"graphql-scalars": "^1.24.0",
"graphql-upload-minimal": "^1.6.1",
"mercurius": "^16.0.1",
"mercurius-upload": "^8.0.0",
"minio": "^8.0.4",
"postgres": "^3.4.5",
"ulidx": "^2.4.1",
"uuid": "^11.0.5",
"uuidv7": "^1.0.2",
"zod": "^3.24.1"
},
"description": "talawa-api is a backend repository written using Node.js and graphql for generating APIs for the talawa flutter app.",
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@faker-js/faker": "^9.4.0",
"@swc/cli": "0.6.0",
"@swc/core": "^1.10.9",
"@types/node": "^22.10.7",
"@types/uuid": "^10.0.0",
"@vitest/coverage-v8": "^3.0.3",
"drizzle-kit": "^0.30.4",
"drizzle-seed": "^0.3.1",
"gql.tada": "^1.8.10",
"lefthook": "^1.10.10",
"mercurius-integration-testing": "^9.0.1",
"pino-pretty": "^13.0.0",
"tsx": "^4.19.2",
"typescript": "^5.7.3",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.0.3"
},
"engines": {
"node": "22.13.0"
},
"homepage": "https://github.com/PalisadoesFoundation/talawa-api#readme",
"keywords": [
"chats",
"community",
"events",
"organization"
],
"license": "GNU General Public License v3.0",
"main": "./dist/index.js",
"name": "talawa-api",
"packageManager": "pnpm@10.0.0",
"repository": {
"type": "git",
"url": "https://github.com/PalisadoesFoundation/talawa-api"
},
"scripts": {
"apply_drizzle_migrations": "drizzle-kit migrate",
"apply_drizzle_test_migrations": "drizzle-kit migrate --config=./test/drizzle.config.ts",
"build_production": "swc ./src/ --ignore \"**/*.spec.ts,**/*.test.ts\" --out-dir ./dist/ --strip-leading-paths",
"check_code_quality": "biome check --error-on-warnings",
"check_drizzle_migrations": "drizzle-kit check",
"check_gql_tada": "gql.tada doctor && gql.tada check --fail-on-warn",
"check_type_errors": "tsc",
"disable_git_hooks": "lefthook uninstall",
"drop_drizzle_migrations": "drizzle-kit drop",
"enable_git_hooks": "lefthook install",
"fix_code_quality": "biome check --error-on-warnings --write",
"generate_drizzle_migrations": "drizzle-kit generate",
"generate_graphql_sdl_file": "tsx ./scripts/generateGraphQLSDLFile.ts",
"generate_gql_tada": "gql.tada generate-output && gql.tada turbo --fail-on-warn",
"import:sample-data": "tsx ./src/utilities/loadSampleData.ts",
"push_drizzle_schema": "drizzle-kit push",
"push_drizzle_test_schema": "drizzle-kit push --config=./test/drizzle.config.ts",
"run_tests": "vitest --coverage",
"start_development_server": "tsx watch ./src/index.ts",
"start_development_server_with_debugger": "tsx watch --inspect=${API_DEBUGGER_HOST:-127.0.0.1}:${API_DEBUGGER_PORT:-9229} ./src/index.ts",
"start_production_server": "pnpm build_production && node ./dist/index.js",
"start_production_server_with_debugger": "pnpm build_production && node --inspect=${API_DEBUGGER_HOST:-127.0.0.1}:${API_DEBUGGER_PORT:-9229} ./dist/index.js",
"upgrade_drizzle_metadata": "drizzle-kit up"
},
"type": "module",
"version": "1.0.0"
"author": "Palisadoes Foundation",
"bugs": {
"url": "https://github.com/PalisadoesFoundation/talawa-api/issues"
},
"dependencies": {
"@fastify/cors": "^10.0.2",
"@fastify/helmet": "^13.0.1",
"@fastify/jwt": "^9.0.3",
"@fastify/rate-limit": "^10.2.2",
"@fastify/type-provider-typebox": "^5.1.0",
"@node-rs/argon2": "^2.0.2",
"@pothos/core": "^4.3.0",
"@pothos/plugin-relay": "^4.3.0",
"@sinclair/typebox": "^0.34.15",
"ajv-formats": "^3.0.1",
"close-with-grace": "^2.2.0",
"drizzle-orm": "^0.39.1",
"drizzle-zod": "0.6.1",
"dotenv": "^16.0.3",
"env-schema": "^6.0.1",
"fastify": "^5.2.1",
"fastify-plugin": "^5.0.1",
"graphql": "^16.10.0",
"graphql-scalars": "^1.24.0",
"graphql-upload-minimal": "^1.6.1",
"mercurius": "^16.0.1",
"mercurius-upload": "^8.0.0",
"minio": "^8.0.4",
"postgres": "^3.4.5",
"ulidx": "^2.4.1",
"uuid": "^11.0.5",
"uuidv7": "^1.0.2",
"zod": "^3.24.1"
},
"description": "talawa-api is a backend repository written using Node.js and graphql for generating APIs for the talawa flutter app.",
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@faker-js/faker": "^9.4.0",
"@swc/cli": "0.6.0",
"@swc/core": "^1.10.9",
"@types/node": "^22.10.7",
"@types/uuid": "^10.0.0",
"@vitest/coverage-v8": "^3.0.3",
"drizzle-kit": "^0.30.4",
"drizzle-seed": "^0.3.1",
"gql.tada": "^1.8.10",
"lefthook": "^1.10.10",
"mercurius-integration-testing": "^9.0.1",
"pino-pretty": "^13.0.0",
"tsx": "^4.19.2",
"typescript": "^5.7.3",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.0.3"
},
"engines": {
"node": "22.13.0"
},
"homepage": "https://github.com/PalisadoesFoundation/talawa-api#readme",
"keywords": [
"chats",
"community",
"events",
"organization"
],
"license": "GNU General Public License v3.0",
"main": "./dist/index.js",
"name": "talawa-api",
"packageManager": "pnpm@10.0.0",
"repository": {
"type": "git",
"url": "https://github.com/PalisadoesFoundation/talawa-api"
},
"scripts": {
"apply_drizzle_migrations": "drizzle-kit migrate",
"apply_drizzle_test_migrations": "drizzle-kit migrate --config=./test/drizzle.config.ts",
"build_production": "swc ./src/ --ignore \"**/*.spec.ts,**/*.test.ts\" --out-dir ./dist/ --strip-leading-paths",
"check_code_quality": "biome check --error-on-warnings",
"check_drizzle_migrations": "drizzle-kit check",
"check_gql_tada": "gql.tada doctor && gql.tada check --fail-on-warn",
"check_type_errors": "tsc",
"disable_git_hooks": "lefthook uninstall",
"drop_drizzle_migrations": "drizzle-kit drop",
"enable_git_hooks": "lefthook install",
"fix_code_quality": "biome check --error-on-warnings --write",
"generate_drizzle_migrations": "drizzle-kit generate",
"generate_graphql_sdl_file": "tsx ./scripts/generateGraphQLSDLFile.ts",
"generate_gql_tada": "gql.tada generate-output && gql.tada turbo --fail-on-warn",
"import:sample-data": "tsx ./src/utilities/loadSampleData.ts",
"push_drizzle_schema": "drizzle-kit push",
"push_drizzle_test_schema": "drizzle-kit push --config=./test/drizzle.config.ts",
"run_tests": "vitest --coverage",
"start_development_server": "tsx watch ./src/index.ts",
"start_development_server_with_debugger": "tsx watch --inspect=${API_DEBUGGER_HOST:-127.0.0.1}:${API_DEBUGGER_PORT:-9229} ./src/index.ts",
"start_production_server": "pnpm build_production && node ./dist/index.js",
"start_production_server_with_debugger": "pnpm build_production && node --inspect=${API_DEBUGGER_HOST:-127.0.0.1}:${API_DEBUGGER_PORT:-9229} ./dist/index.js",
"upgrade_drizzle_metadata": "drizzle-kit up"
},
"type": "module",
"version": "1.0.0"
}
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading