Default Compas template
This project is created using the with-auth template via create-compas.
# Via NPM npx create-compas@latest --template with-auth # Or with Yarn yarn create compas --template with-auth
- Start up the development Postgres and Minio instances
compas docker up
- Apply the Postgres migrations
- Regenerate router, validators, types, sql, etc.
compas generate application
- Run the tests
compas test --serial
Structure and features
This project is structured according to the default Compas template.
compas lintfor running ESLint and Prettier
- Has code generation based on
@compas/code-gen, with the definitions stored in
gen/*and a custom command in
- Contains 'global' services via ES Module live bindings in
- Entrypoint for both starting the api via
compas run api/
node ./scripts/api.jsand a background queue via
compas run queue/
- Tests running on a temporary Postgres database, temporary S3 bucket and validating responses.
This project is created with support for sessions provided by @compas/store. It is a minimal setup where someone can register with email and password, is able to login, logout and get information about when they have registered. The
userHandlers.me implementation uses
userResolveSession which you can use in your own routes. The other provided routes use the session-store and session-transport functions from Compas to manage session creation, extension and removal.
There is no logic included for email validation, password reset flows or removing the user.