A little api to manage construction site materials
Once you've got your server up and running, click the link above for demo and client use docs.
postgresql
for data persistencePrisma
for DB Migrations, Seeding, and queryingexpress
for Routing and Servingdotenv
for environment settingsava
for testing
- clone this repo:
$ gh repo clone ada-lovecraft/dirt-nap
- Install dependencies:
$ npm install
- run postgres docker:
$ docker run --name dirt-nap-postgres -p 5432:5432 -e POSTGRES_PASSWORD=password postgres:latest
- Update
.env
file with proper database url if you had to change anything - Migrate & seed database with most recent schema:
$ npx prisma migrate reset
- Start the server:
$ npm start
- Check Usage Docs
To run this project, you will need to add the following environment variables to your .env file
DATABASE_URL
- the db connection string to your postgres instance
To run tests, run the following command
npm run test
pr with a watcher
npm run test:dev
The database schema at /prisma/schema.prisma
.
Once you've editted it, you can push it to your local db by $ npx prisma db push
If you're happy with the change, $ npx prisma migrate dev
to create a new migration step
The database is automatically seeded when you $ npx prisma migrate deploy
. The seed scripts are located at prisma/seed.js
Why did I call this project dirt-nap
?
It's a REST
api dealing with construction site materials, a lot of which are created from the earth
itself.