Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Commit d4a044a

Browse files
authored
Initial Project Data Model (#2)
* update data model * remove package lock * use sqlite for local dev, pg for deployment * update scripts, cleanup * update .env example * update social links and proposal links type * update contrib to rich text * update env example for postgres
1 parent de34afd commit d4a044a

File tree

9 files changed

+1567
-1622
lines changed

9 files changed

+1567
-1622
lines changed

cms/.env.example

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
HOST=0.0.0.0
22
PORT=1337
3-
APP_KEYS=
3+
APP_KEYS=value_1,value_2,value_3
4+
API_TOKEN_SALT=
5+
ADMIN_JWT_SECRET=
6+
JWT_SECRET=
7+
8+
DATABASE_HOST=
9+
DATABASE_PORT=
10+
DATABASE_NAME=
11+
DATABASE_USERNAME=
12+
DATABASE_PASSWORD=

cms/config/database.js

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
1-
const path = require('path');
1+
const path = require("path");
22

3-
module.exports = ({ env }) => ({
4-
connection: {
5-
client: 'sqlite',
6-
connection: {
7-
filename: path.join(__dirname, '..', env('DATABASE_FILENAME', '.tmp/data.db')),
8-
},
9-
useNullAsDefault: true,
10-
},
11-
});
3+
module.exports = ({ env }) =>
4+
process.env.NODE_ENV === "development"
5+
? {
6+
connection: {
7+
client: "sqlite",
8+
connection: {
9+
filename: path.join(
10+
__dirname,
11+
"..",
12+
env("DATABASE_FILENAME", ".tmp/data.db")
13+
),
14+
},
15+
useNullAsDefault: true,
16+
},
17+
}
18+
: {
19+
connection: {
20+
client: "postgres",
21+
connection: {
22+
host: env("DATABASE_HOST"),
23+
port: env.int("DATABASE_PORT"),
24+
database: env("DATABASE_NAME"),
25+
user: env("DATABASE_USERNAME"),
26+
password: env("DATABASE_PASSWORD"),
27+
pool: 10,
28+
ssl: {
29+
rejectUnauthorized: env.bool("DATABASE_SSL_SELF", false),
30+
},
31+
},
32+
debug: false,
33+
},
34+
};

cms/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"description": "A Strapi application",
66
"scripts": {
77
"develop": "strapi develop",
8+
"develop-pg": "NODE_ENV=pg strapi develop",
89
"start": "strapi start",
910
"build": "strapi build",
1011
"strapi": "strapi"
@@ -14,7 +15,8 @@
1415
"@strapi/plugin-i18n": "4.2.2",
1516
"@strapi/plugin-users-permissions": "4.2.2",
1617
"@strapi/strapi": "4.2.2",
17-
"better-sqlite3": "7.4.6"
18+
"better-sqlite3": "7.4.6",
19+
"pg": "^8.7.3"
1820
},
1921
"author": {
2022
"name": "A Strapi developer"

cms/src/api/guild/content-types/guild/schema.json

Lines changed: 0 additions & 39 deletions
This file was deleted.

cms/src/api/guild/controllers/guild.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

cms/src/api/guild/routes/guild.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

cms/src/api/guild/services/guild.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

cms/src/api/project/content-types/project/schema.json

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,46 +23,68 @@
2323
}
2424
},
2525
"type": "string",
26-
"required": true,
27-
"maxLength": 128,
28-
"minLength": 5,
29-
"unique": false
26+
"required": true
3027
},
31-
"status": {
28+
"hero_image": {
3229
"pluginOptions": {
3330
"i18n": {
3431
"localized": true
3532
}
3633
},
37-
"type": "enumeration",
38-
"enum": [
39-
"Pending",
40-
"Active",
41-
"Complete"
42-
]
34+
"type": "string",
35+
"required": true
36+
},
37+
"description_short": {
38+
"pluginOptions": {
39+
"i18n": {
40+
"localized": true
41+
}
42+
},
43+
"type": "string",
44+
"required": true
45+
},
46+
"description_long": {
47+
"pluginOptions": {
48+
"i18n": {
49+
"localized": true
50+
}
51+
},
52+
"type": "richtext",
53+
"required": true
4354
},
44-
"notes": {
55+
"ens_name": {
56+
"pluginOptions": {
57+
"i18n": {
58+
"localized": true
59+
}
60+
},
61+
"type": "string",
62+
"required": true
63+
},
64+
"project_social_links": {
4565
"pluginOptions": {
4666
"i18n": {
4767
"localized": true
4868
}
4969
},
5070
"type": "richtext"
5171
},
52-
"guilds": {
53-
"type": "relation",
54-
"relation": "manyToMany",
55-
"target": "api::guild.guild",
56-
"inversedBy": "projects"
72+
"governance_proposal_links": {
73+
"pluginOptions": {
74+
"i18n": {
75+
"localized": true
76+
}
77+
},
78+
"type": "richtext",
79+
"required": false
5780
},
58-
"pinned": {
81+
"contributors": {
5982
"pluginOptions": {
6083
"i18n": {
6184
"localized": true
6285
}
6386
},
64-
"type": "boolean",
65-
"default": false
87+
"type": "richtext"
6688
}
6789
}
6890
}

0 commit comments

Comments
 (0)