Note: Project is not being worked on, at the moment. This repository now serves as an example for what I've been working on in my free time.
Create your .env file
.env file in the project root, containing:
NODE_ENV=development DATABASE_URL=postgres://coinaly:coinaly@postgres:5432/coinaly REDIS_URL=redis://redis:6379 ENCODE_SECRET=your-super-secret POSTGRES_PASSWORD=coinaly POSTGRES_USER=coinaly POSTGRES_DB=coinaly
Run the project locally
- Make sure you have set up Docker correctly
docker-compose up. When that's done, Docker runs in the background.
- Open the Postgres database in a client
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
- Run migrations:
npm run dev:migrate
- Project is available at: http://localhost:5000
Redis will run at port
6379. Postgres wil run at port
Dockerfile is used for production.
docker-compose.yml is used for local development. It leverages
Dockerfile, but uses different environment variables and a different run command to start.
docker-compose up --build -dto build the container locally and then run it.
- After a succesful run port 5000 is exposed.
Changed Dockerfile or docker-compose file?
- Make a new image build:
- Make sure you got the right dependencies, see
- Install dependencies with
- Run local development with
yarn run dev
- Run for production with
knex migrate:make tablename, like:
knex migrate:make users
/database/migrationsfor example files
- After setting the schema, run:
knex seed:make seedname, like:
knex seed:make users
/database/seedsfor example files
- After setting up the seed, run