structure.md 1.25 KB
Newer Older
les's avatar
les committed
1
2
3
4
5
---
layout: default
title: Project Structure
permalink: /dev/structure
parent: Hacking
les's avatar
les committed
6
nav_order: 1
les's avatar
les committed
7
8
---

les's avatar
les committed
9
10
11
12
### Project structure
{: .no_toc }
1. TOC
{:toc}
les's avatar
les committed
13
14
15
16


### API / backend

les's avatar
les committed
17
Source code inside `server/api/`.  
les's avatar
les committed
18
19
20
21
22
`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.

les's avatar
les committed
23
[Express.js](https://expressjs.com/) is based on middleware, passing each request to a chain of methods.
les's avatar
les committed
24
25

If you come from a PHP background, note that the main difference with
les's avatar
les committed
26
[Node.js](https://en.wikipedia.org/wiki/Node.js) is that the server process is always running and able to manage
les's avatar
les committed
27
28
29
multiple requests and tasks together (asyncronically) while each php
process is tied to a single request.

les's avatar
les committed
30
[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).
les's avatar
les committed
31
32
33
34
35
36
37
38
39


### 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!  


les's avatar
les committed
40
### Federation / ActivityPub
les's avatar
les committed
41
Code inside [`server/federation`](https://framagit.org/les/gancio/tree/master/server/federation).