Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/transferwise/wwc-apac-2024
https://github.com/transferwise/wwc-apac-2024
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/transferwise/wwc-apac-2024
- Owner: transferwise
- Created: 2024-02-26T14:45:13.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-06-18T21:11:21.000Z (7 months ago)
- Last Synced: 2024-11-06T17:35:26.970Z (2 months ago)
- Language: JavaScript
- Size: 516 KB
- Stars: 0
- Watchers: 38
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wwc-apac-2024
Workshop for Wise Woman Code APAC 2024## Tasks for the workshop
See [Tasks](tasks.md)
## Getting Started
### First, run the development server:
```bash
npm run dev
```### Then start the docker containers for DB, backend and frontend.
Nextjs development mode by default will already have hot-reloading for frontend pages.
The development docker will use nodemon to ensure hot-reloading for the api routes too.
```bash
npm run docker:dev
```
### Once the DB is up, the following command will run the db migrations and see the database.
```bash
npm run setup:dev
```# Run all tests
```bash
npm run test
```Running of frontend tests:
```bash
npm run test -- "frontend"
```
Running of backend tests:
```bash
npm run test -- "api"
```
# Run a specific test
For example,
Running the tests in the "/api/transfers" folder:```bash
npm run test -- "api/transfers"
npm run test -- "api/transfers/route.test.js"
```Any of the above will work because jest does a regex search of the tests.
# Connecting to the database
DBeaver is one of the options you could use to connect to the database.
Host: localhost
Port: 5432
Databse: wise
Username: wwc-apac
Password: STRONGpass# Note about Environment Variables
The `.env.local` and `.env.migrate` are included in this project because there are no real secrets in them - the local database user and password is not really a secret because they are already in the Dockerfile. If we were really to make a production-ready project, it should read the database env variables from somewhere safer like a secrets vault in AWS.
Nextjs will automatically load `.env.local` as `process.env` variables, but for knex commands we use `dotenv-cli` to load the env variables.