Skip to content

Oo-ly/ooly-api

Repository files navigation

Ooly API

Build Status Coverage Status

Requirements

  • Docker
  • Node.js v12.0 or above - https://nodejs.org/
  • Nodemon package installed globally npm i -g nodemon

Setup

The project is based on a Docker container holding the MariaDB database, another for PHPMyAdmin. The core of the project is running on NodeJS using Express framework (https://expressjs.com/).

Workflow

Schema

Commands

Command Description
npm run api Regenerate the documentation
npm run docker:build Build the Docker containers
npm run docker:start Create & start the Docker containers
npm run docker:stop Stop & remove the Docker containers
npm run start Start the NodeJS server
npm run migrate Migrate pending migrations under /migrations
npm run seed Run seeds under /seeders
npm run migrate:seed Run migrations & seeds
npm run migrate:reset Revert all migrations
npm run test Run all tests under /tests

URLs

Once Docker containers & the NodeJS server are running, these URLs become available:

URL Description
http://localhost:1234 PHPMyAdmin
http://localhost:3000 NodeJS Server
http://localhost:3000/docs API Documentation

Coding guidelines

Git

We use Gitflow as our Git workflow. More explanation here.

Code style & format

Styles

  • We use Prettier (https://prettier.io/) as code formatting tool. The configuration is written in .prettierrc at the root of the project. You must NOT edit this file.
  • We use 2 (two) spaces for indentation.

Naming

  • We use camelCase for variables, properties, functions and methods.
  • We use PascalCase for classes.

Comments

Rules

Before pushing code, please make sure to :

  • Include unit tests to test every function you've added.
  • Add comments, and regenerate the documentation : npm run api.
  • Clean and refactor code.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published