Tabify's NestJS API and TypeORM database.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Install and configure the following:
- Docker
- nvm
- Node (install Node using nvm and ensure that the version matches what is in the
.node-version
file) - avn
- Postman
- MySQL database client of choice (DataGrip is recommended)
Follow these steps to get a local dev environment set up.
- Populate .env with the necessary keys and secrets. Note that all .env files are git-ignored to avoid checking in sensitive keys and passwords.
cp .env.example .env
// Fill in the key-value pairs in .env
- Initialize a local MySQL database using Docker Compose.
docker-compose up
- Verify that the container was started successfuly and that its state is
Up
.
docker-compose ps
- Install the dependencies.
npm install
- Run the development server.
npm start
- Make a test GET request by opening your browser to http://localhost:3000, using a tool like Postman, or simply using Curl.
curl localhost:3000
If you see a Hello World message, you've successfully started the dev server! 🎉
- Open the Tabify mobile web app and sign in/up.
- On your browser's inspector, navigate to the Network panel.
- Clear the panel of any requests.
- On the app, click on the "Pay Tab" button.
- This will send an authenticated request to the server. Copy the token from the authorization header that was generated with the
GET
request to the/locations
endpoint.
Follow these steps to synchronize your local database with the demo location(s) in Omnivore.
- Open Postman.
- Create a
POST
request tohttp://localhost:3000/locations/sync
. - Add an
authorization
header and paste the auth token that you copied in the section above. - Send the request.
A 201
response indicates that the request was successful. Verify by hitting the "Pay Tab" button on your local Tabify app instance. If you see a "Virtual POS" entry in the "Find Location" page, you've successfully synchronized your local database with the location data in Omnivore.
In order for the Fullstack compount debugger specified in .vscode/launch.json to work, you must have the Tabify frontend (tabify) repo in your vscode workspace as well. This debugger is the same as the Fullstack debugger found in the frontend. The Backend debugger can run independently of any other repos.
WIP Explain how to run the automated tests for this system here
Explain what these tests test and why
Give an example
Explain what these tests test and why
Give an example
WIP Add additional notes about how to deploy this on a live system