2019-07-26 23:53:02 +02:00
---
layout: default
title: Project Structure
permalink: /dev/structure
parent: Hacking
2020-01-21 22:14:46 +01:00
nav_order: 1
2019-07-26 23:53:02 +02:00
---
2019-08-06 01:12:05 +02:00
### Project structure
{: .no_toc }
1. TOC
{:toc}
2019-07-26 23:53:02 +02:00
### API / backend
2019-08-06 01:12:05 +02:00
Source code inside `server/api/` .
2019-07-26 23:53:02 +02:00
`index.js` is basically a routing table pointing each PATH with specified
HTTP VERB to a method of a controller.
jwt is used to authenticate api request.
2019-08-06 01:12:05 +02:00
[Express.js ](https://expressjs.com/ ) is based on middleware, passing each request to a chain of methods.
2019-07-26 23:53:02 +02:00
If you come from a PHP background, note that the main difference with
2019-08-06 01:12:05 +02:00
[Node.js ](https://en.wikipedia.org/wiki/Node.js ) is that the server process is always running and able to manage
2019-07-26 23:53:02 +02:00
multiple requests and tasks together (asyncronically) while each php
process is tied to a single request.
2019-08-31 22:14:37 +02:00
[Sequelize ](https://sequelize.org/ ) is used as ORM. Take a look in [`/server/api/models` ](https://framagit.org/les/gancio/tree/master/server/api/models ).
2019-07-26 23:53:02 +02:00
### Client / frontend
Nuxt.js is used here!
Nuxt is basically Vue plus SSR (Server Side Rendering).
Client routing in nuxt is automatic (if you don't need something special),
just put your page inside `pages` and that's it!
2019-08-06 01:12:05 +02:00
### Federation / ActivityPub
2019-08-31 22:14:37 +02:00
Code inside [`server/federation` ](https://framagit.org/les/gancio/tree/master/server/federation ).