https://github.com/sirwanafifi/alg_promo
https://github.com/sirwanafifi/alg_promo
nestjs nextjs typeorm typescript useswr
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sirwanafifi/alg_promo
- Owner: SirwanAfifi
- Created: 2021-06-16T14:12:21.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-20T15:08:01.000Z (almost 4 years ago)
- Last Synced: 2025-01-03T12:43:24.680Z (6 months ago)
- Topics: nestjs, nextjs, typeorm, typescript, useswr
- Language: TypeScript
- Homepage:
- Size: 158 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API
- Install the dependencies `yarn`
- Add `.env` file in the root of API project:```js
POSTGRES_HOST=
POSTGRES_PORT=5432
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_DB=promo_db
PGADMIN_DEFAULT_EMAIL=
PGADMIN_DEFAULT_PASSWORD=
PGADMIN_CONFIG_SERVER_MODE=False
PORT=5000
PRIVATE_KEY=
TYPEORM_SEEDING_FACTORIES=src/factories/**/*{.ts,.js}
TYPEORM_SEEDING_SEEDS=src/seeds/**/*{.ts,.js}
```- `yarn init:db`
- The last step might take some time, Once you seed the following message you should exit the process using `Ctrl + C`:```js
Done with Seeding
```- Start the API: `yarn start:dev`
- You can then login into the DB container to get some promo codes:
```bash
docker exec -it api_db_1 psql -U admin promo_dbSELECT s.title, p.code
FROM promo_code AS p
JOIN service AS s ON s.id = p."serviceId";
```# Web
- `yarn`
- `yarn start`# Tests
- `yarn test`