Skip to content

Commit a9759df

Browse files
Update README.md
1 parent 9e8a6ca commit a9759df

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

README.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1+
# Cardley API server
2+
13
![build status](https://travis-ci.com/Ivo-Evans/Cardley---backend.svg?branch=master)
24

3-
Cardley API
5+
[![codecov](https://codecov.io/gh/fac19/Cardley---backend/branch/master/graph/badge.svg)](https://codecov.io/gh/fac19/Cardley---backend)
6+
47

58
1. To install clone the following repo and install with `npm i`
69
`https://github.com/fac19/Cardley---backend.git`
710

8-
2. To run locally you will need a postgres 'production' database and a user with full permissions
9-
Create these with you favourite db admin tool.
11+
2. To run locally you will need a postgres 'production' database and a user with full permissions. Create these with you favourite db admin tool.
12+
- The database schema can be installed by running `npm run initdb`
1013

1114
3. To run the tests locally you will need a 'testing' database as above.
1215

1316
4. You will need a .env file in the project root with these fields.
14-
PGDATABASE={ your local production database name }
15-
TESTDATABASE={ your local testing database name }
16-
PGUSER={ your database user name }
17-
PGPASSWORD={ your database password }
18-
SECRET=SECRETCODE
17+
- PGDATABASE={ your local production database name }
18+
- TESTDATABASE={ your local testing database name }
19+
- PGUSER={ your database user name }
20+
- PGPASSWORD={ your database password }
21+
- SECRET=SECRETCODE
1922

2023
PGUSER and PGPASSWORD can be ommited on some systems. TESTDATABASE is only needed if you would like to run the database tests.
2124

22-
You can change SECRET to whatever you like but it will break several of the tests and prevent loging from any of the example user accounts in test.sql or examples.sql
23-
2425
5. Starting the server.
2526

2627
- `npm start` - No console logging
@@ -31,20 +32,20 @@ Cardley API
3132
- `npm run test` - Tests that don't use the test database
3233
- `npm run testdb` - Tests that DO use the test database
3334

35+
7. Populating the database with demo users and example decks
36+
- `npm run initdemodb`
37+
- This will give you several example decks and 4 test users...
38+
- user: meg, email: meg@iscool.com, password: password
39+
- user: joe, email: joe@iscool.com, password: password
40+
- user: pat, email: pat@iscool.com, password: password
41+
- user: bob, email: bob@iscool.com, password: password
42+
- Note that at the time of writing creating decks isn't yet possible on the front end so you will probably want to do this.
43+
3444
---
3545

36-
Live list of API routes.
46+
Full API docs here...
3747

3848
https://hackmd.io/pm56shSXSHeQqLBeRZ2olw
39-
40-
Expect breaking changes!
41-
49+
(copy as of 29-May-2020)
50+
4251
---
43-
44-
Active routes...
45-
46-
/signup
47-
/login
48-
/public-decks
49-
/decks
50-
/decks/first/:id

0 commit comments

Comments
 (0)