Skip to content

Latest commit

 

History

History
123 lines (84 loc) · 3.94 KB

CONTRIBUTING.md

File metadata and controls

123 lines (84 loc) · 3.94 KB

Contributing guidelines

Thanks for considering contribution to this project!

🚀 Getting Started

Pre-requisites:

  • node <= 18 and npm
  • mysql, sqlite or postgres

Run from source

Run the codebase with Docker

For more, see Getting Started for standard instructions.

🧦 Linting

make fix will run ESLint to fix style issues.

⚙️ Tools and Tech

This project dogfoods @curveball packages built from modern web and HTTP standards.

A non-exhaustive overview of core tools:

Tool Rationale
TypeScript Type safety
Node.js Runtime
Knex Database migrations and query building
Handlebars Lightweight view templating
ESLint Linting
jose JSON Object encryption and signing
bcrypt Password hashing
nodemailer Email dispatch

👀 Whats Inside

Everything prepended with _ is either a hidden file or a build artifact.

.github                   CI workflows
├── .gitignore
├── .env.defaults         default environment variables
├── Dockerfile
├── LICENSE
├── Makefile              The most comprehensive source of truth for build commands
├── README.md
├── assets                static files for running in browser (css, js)
├── bin                   scripts for generating JSON schemas and running db migrations
├── changelog.md
├── _dist                 built output of type definitions
├── docs
├── eslint.config.mjs
├── _node_modules
├── package-lock.json
├── package.json
├── schemas
├── src                   All source code including endpoint controllers and types
├── templates             HTML view templates created with Handlebars
├── test                  unit/integration tests
└── tsconfig.json

🔄 Database Migrations

Database migrations scripts are in src/migrations and run in chronological order when the server starts.

Filename format:

  • Old files are prefixed with numbers
  • Newer files are <year><timestamp>.ts

See Knex migrations

If you are running MySQL, you can update the Knex types with:

node ./bin/generate-db-types.mjs

This will generate a src/db-types.ts file that will be used by Knex to type the database tables.

Type Conventions

This project uses:

  • snake_case for database properties and web standards.
  • camelCase for API responses – convention chosen because the clients consuming the API would be in JavaScript/Typescript.

Ways to Contribute

Pick an issue 🏷️

Check out the tagged Issues list and labels.

The issues require different skill levels, so for your first issue, pick something you're comfortable with.

Contribute an integration for your favorite framework

This project could use sandboxes and examples of integrating a12n-server with different front end frameworks!

Check out a12n-server x Next.js: @curveball/next-a12n

See Integration with a browser client for context on basic usage.

👩‍💻 Development Resources

🚀 Getting started

🛠️ Configure the server

🔍 Manage users with our APIs

✉️ Testing email