1.0.0 • Published 12 months ago

spacelab v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
12 months ago

Spacelab

Spacelab - server and client code built using NextJs

Folder structure

 | spacelab
 |-- client         # All client components, dont write server side code here
 |   |-- components # React components
 |   |-- elements   # Reusable React dump components eg: button, link..
 |   |-- lib        # Reusable functions for client components
 |-- constants      # Define in `uppercase`
 |   |-- URIs       # Use proper prefix & suffix to distinquish the modules and URIs
 |   |   |-- app-pages.js       # all NextJs routes
 |   |   |-- chili-apis.js      # all Chili publish integrations apis
 |   |   |-- dalim-apis.js      # all dalim integration apis
 |   |   |-- op-apis.js         # all open project integration apis
 |   |   |-- spacelab-apis.js   # all spacelab apis which uses multiple api integrations or define module   specifc apis
 |   |-- ...
 |-- layouts    # all server side layouts
 |-- lib        # all resuable modules and functions
 |   |-- business-objects       # modules to reuse in api and server side components
 |    |    |-- chili-publish    # all chili publish biz functions
 |    |    |-- dalim            # all dalim functions
 |    |    |-- op               # all open project functions
 |    |--  API.js               # Reusable class to attach GET, POST, PATCH requests
 |   |-- ..
 |-- pages 
 |   |-- api                    # all apis
 |   |   |-- op                 # open project apis and hooks
 |   |   |   |-- hooks
 |   |   |-- dalim              # dalim apis and hooks
 |   |   |   |-- hooks
 |   |   |-- spacelab           # spacelab apis and hooks
 |   |   |   |-- hooks
 |   |   |-- chili-publisher    # chili publisher apis and hooks
 |   |       |-- hooks
 |   |-- auth                   # login and logout pages
 |   |-- private                # all server side pages/components
 |   |-- index.js               # main file
 |   |-- ..
 |-- public
 |-- styles
 |-- ...

Coding standard

Constants

Define in CAPITAL letters Define all URIs with suffix URI and use appropriate prefix eg: for spacelab, use SPACELAB

APIs

Use Next.js' dynamic routing for all params Use all parent ids in URI. eg: /spacelab/campaigns//jobs// Define the apis at appropriate folder op/dalim/chili-publisher/spacelab For any other new integration, use new folders

Naming convention & terms

Dalim - customer, project template, project/job OpenProject - Project, Project template Spacelab - client/customer, campaign template group, campaign template, campaign, phases, jobs, tasks