-
Notifications
You must be signed in to change notification settings - Fork 63
Getting Started
Prerequisites: Visual Studio Code, or some other IDE of your choice if running locally.
Codespaces is the simplest way to get up and running, and there are multiple ways to use Codespaces, depending on your wants and needs.
From the green Code <>
tab on the main repository page, click Codespaces
then the +
button. Once a codespace appears, you can chose to Open in your local editor.
Once your editor opens, you should see something similar to this:
From this shell, you can check out or create a branch, or use the commands in package.json
to get the app started. You can also inspect ports tab to see where the app or the development instance of PostgreSQL can be accessed.
This setup will work if don't want to install an editor as well. Just click open in browser
and you will be directed to an instance of VsCode's web-based IDE, which will work mostly the same, but may be limited in some functionality.
You can use a container engine like Docker (which is what Codespaces is doing) to run Amplify on your local machine. This is a good option for long-term or frequent contributors because Codespaces will get rid of your environment after a while and you could lose work in progress. Running in containers will also free you from installing NodeJs or Postgres on your machine since those will be packages in the container image.
You'll need Docker cli and docker-compose
. The easiest way to install the cli is to use Docker Desktop or Rancher Desktop. Both are free for this scale of development. Docker Desktop has a better gui if you like that sort of workflow.
- Docker Desktop
- Rancher Desktop
- Lima Wildcard choice if you don't want a gui at all
No matter which you choose, you will most likely have to install docker-compose
separately.
Once docker
and docker-compose
are installed, you should be able to run the app and postgres by using:
./script/start.sh
Before running that command, you may have to make the script executable, depending on your environment.
- On Ubuntu:
chmod a+x ./script/start.sh ./script/stop.sh
Once you've run start.sh
and the containers are finished being built, you should see your terminal prompt change to something like
/src/amplify #
If you see this, you've successfully entered the container and can navigate the app like it's on your local machine. To exit, type
exit
At first start-up, you will have to create a database and run migrations. Postgresql is already running in a separate container, so setting up the database will be as easy as running
npm run db:create
There is some seed data that will be added to the database to get you up and running. Database data will persist in a volume between container restarts.
Finally, to start the app, try either
npm run dev
- OR -
npm run dev:backend
When you change code in the repository on your local machine, it will automatically get copied and trigger hot reloading inside the container.
- Home
- App Logic
- App Structure
- Getting Started
- Local Environment Setup
- Interacting with the Development Database
- User Background
- Features
- Data Structures
- API Quick Reference
- Single Campaign Mode (Beta)
- Front-end
- Components
- Pages
- State Management
- Amplify API reference (Database)
- Lob Mailing API integration
- Auth0 API Integration
- Stripe API integration
- Cicero API Integration
- Twilio API Integration