You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. To install clone the following repo and install with `npm i`
6
9
`https://github.com/fac19/Cardley---backend.git`
7
10
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`
10
13
11
14
3. To run the tests locally you will need a 'testing' database as above.
12
15
13
16
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
19
22
20
23
PGUSER and PGPASSWORD can be ommited on some systems. TESTDATABASE is only needed if you would like to run the database tests.
21
24
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
-
24
25
5. Starting the server.
25
26
26
27
-`npm start` - No console logging
@@ -31,20 +32,20 @@ Cardley API
31
32
-`npm run test` - Tests that don't use the test database
32
33
-`npm run testdb` - Tests that DO use the test database
33
34
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
0 commit comments