Site Tools


Hotfix release available: 2025-05-14b "Librarian". upgrade now! [56.2] (what's this?)
Hotfix release available: 2025-05-14a "Librarian". upgrade now! [56.1] (what's this?)
New release available: 2025-05-14 "Librarian". upgrade now! [56] (what's this?)
Hotfix release available: 2024-02-06b "Kaos". upgrade now! [55.2] (what's this?)
Hotfix release available: 2024-02-06a "Kaos". upgrade now! [55.1] (what's this?)
New release available: 2024-02-06 "Kaos". upgrade now! [55] (what's this?)
Hotfix release available: 2023-04-04b "Jack Jackrum". upgrade now! [54.2] (what's this?)
Hotfix release available: 2023-04-04a "Jack Jackrum". upgrade now! [54.1] (what's this?)
New release available: 2023-04-04 "Jack Jackrum". upgrade now! [54] (what's this?)
Hotfix release available: 2022-07-31b "Igor". upgrade now! [53.1] (what's this?)
Hotfix release available: 2022-07-31a "Igor". upgrade now! [53] (what's this?)
New release available: 2022-07-31 "Igor". upgrade now! [52.2] (what's this?)
New release candidate 2 available: rc2022-06-26 "Igor". upgrade now! [52.1] (what's this?)
New release candidate available: 2022-06-26 "Igor". upgrade now! [52] (what's this?)
Hotfix release available: 2020-07-29a "Hogfather". upgrade now! [51.4] (what's this?)
2.0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
2.0 [2025/10/29 11:43]
20.171.207.2 old revision restored (2025/10/29 11:21)
2.0 [2025/10/30 07:52] (current)
216.73.216.23 old revision restored (2025/10/29 11:45)
Line 13: Line 13:
 ==== App Structure Overview ==== ==== App Structure Overview ====
  
-The frontend (The visuals you see in your internet browser) is made in React, which is programmed in Typescript; Typescript is a type safe, and more structured varient of the javascript lanugage (ES6/ES12-ES2021).+Both the frontend and backend are programmed in [[https://www.typescriptlang.org/docs/handbook/intro.html |Typescript]] which is executed by the [[https://www.npmjs.com/package/ts-node |ts-node]] package; Typescript is a type safe, and more structured superset of the [[https://www.freecodecamp.org/news/the-complete-javascript-handbook-f26b2c71719c/ |Javascript]] lanugage (ES6/ES12-ES2021). We use [[https://classic.yarnpkg.com/lang/en/docs/ |Yarn]] on the frontend and backend also, to install packages (like ts-node) and run a local development server.
  
-The backend is also programmed in Typescript, and runs on a Node.JS server. The backend is responsible for calculations and data processing, in order to provide the frontend with data it can use immediately. A GraphQL server is used in the backend, to provide structured and secure access to the data in our Database. 
  
-Our database is implemented in Postgreswhich is a relational database that uses SQL.+An [[https://www.apollographql.com/ |Apollo GraphQL]] server is used in the backendto provide structured and secure interface to interact with the database. [[https://github.com/typeorm/typeorm/blob/master/docs/active-record-data-mapper.md#what-is-the-data-mapper-pattern |TypeORM]] is the database adapter which connects to the database allowing us to manipulate the tables and data within it; graphql uses the TypeORM adapter in order to access the data. We've not currently chosen a server to serve the backend code to the client, therefore, the project only works locally from development enviroments.
  
-===Frontend===+Our database is implemented in [[https://www.postgresql.org/ |Postgres]], which is a relational database that uses SQL. [[https://www.pgadmin.org/download/ |PGAdmin4]] is a decent tool for exploring the database.
  
-===Backend===+==== Packages ====
  
-== GraphQL (Apollo Odyssey) ==+=== ts-node === 
 + 
 +[[https://www.npmjs.com/package/ts-node |ts-node]] is a typescript execution engine that allows us to write this project as typescript instead of javascript. ts-node is essentially a `source-to-source compiler` / `transpiler`, as it  turns one language into another, i.e. typescript into javascript. 
 + 
 +=== GraphQL (Apollo) ===
  
 We use [[https://www.apollographql.com/ |Apollo GraphQL]] as our implementation of GraphQL. We use [[https://www.apollographql.com/ |Apollo GraphQL]] as our implementation of GraphQL.
 ([[https://odyssey.apollographql.com/ |Tutorial here]]) ([[https://odyssey.apollographql.com/ |Tutorial here]])
  
-===Database===+=== cross-env ===
  
 +[[https://www.npmjs.com/package/cross-env |cross-env]] is used for setting the environment mode the project is run in, in a OS independant way. It is used in the package.json file.
  
-===== Project setup and Build =====+=== blipp === 
 + 
 +[[https://www.npmjs.com/package/blipp |blipp]] is a simple hapi plugin to display the routes table to console at startup. 
 + 
 +====Database==== 
 + 
 +We're Using a postgress database 
 + 
 +=== ERD cardinality key ===
  
 TBA TBA
 +
 +=== Database ERD ===
 +
 +TBA
 +
 +===== Project setup and Build =====
 +
 +==== Run the project locally ====
 +
 +Using the [[https://docs.npmjs.com/cli/v8/using-npm/scripts |scripts]] in the package.json file in the backend directory, use Yarn to run the 'dev' script, e.g. 
 +<code>yarn run dev</code>
 +which is the same as running:
 +<code>yarn run cross-env NODE_ENV=development ts-node-dev --files -- ./src/index.ts</code>
 +  * 'Yarn' is our package manager, but also its acting as our server as this is a command for local development
 +  * 'run' tells yarn to execute something
 +  * 'cross-env' is a package used to set the programmign enviroment variables in a OS independant way
 +  * 'NODE_ENV=development' is a cross-env option to set the enviroment to development
 +  * 'ts-node-dev' is our typescript execution engine as we want our typescript files to be executed with a typescript engine
 +  * '- -files' is a ts-node option, to tell ts-node to load files specified in the `tsconfig.json` file. We do this as the `blipp` package doesn't import correctly unless this happens, as ts-node can't see the blipp file in `backend/type/blipp.d.ts`
 +  * '- -' is used to stop options being passed to ts-node (i.e. we passed ts-node '- -files', we don't want to pass anything else)
 +  * './src/index.ts' is the first file we are running as it's the root
 +
  
 === Potential build issues, and their fixes === === Potential build issues, and their fixes ===
2.0.1761734639.txt.gz · Last modified: 2025/10/29 11:43 by 20.171.207.2