Skip to content

Latest commit

 

History

History
105 lines (67 loc) · 2.54 KB

README.md

File metadata and controls

105 lines (67 loc) · 2.54 KB

Dansdata API

Open API for retrieving information about social dances in Sweden.

Getting Started

The project makes use of VSCode's devcontainer feature to create a basic, common development environment. The following instructions assume you are using this environment. If you do not want to use a devcontainer, necessary steps to configure your local environment can be deduced from files in the .devcontainer directory.

To initialize/update your development database to match your current state:

$ npm run dev:db:push

To run the API locally

$ npm run dev

To create a new database migration:

$ npm run dev:db:migrate -- dev -- --name my_migration_name

To use prisma studio

$ npm run dev:db:studio

Environment Variables

This project uses environment variables for database connections and more.

Certain variables, such as cloudflare credentials, need to be configured manually for some features to work.

Please see src/env/index.ts for more details.

Testing

Unit tests can be run using

$ npm run test:unit

Integration tests can be run using

$ npm run test:integration

To run all tests, simply use

$ npm run test:all

The group a test is in is determined by an initial documentation comment, e.g.:

/**
 * @group unit
 */

See also jest-runner-groups.

Resetting the development database

Ususally npm run dev:db:push should be enough to apply your prisma changes to the database. However, sometimes it is necessary to perform a deeper clean.

To do this, connect to the database (the devcontainer comes with the SQLTools extension preconfigured for such a connection - use the database icon in the left bar of vscode) and run

DROP SCHEMA auth CASCADE;
DROP SCHEMA events CASCADE;
DROP SCHEMA portal CASCADE;
DROP SCHEMA profiles CASCADE;
DROP SCHEMA public CASCADE;
DROP SCHEMA storage CASCADE;
DROP SCHEMA logs CASCADE;

Then use npm run dev:db:push to re-initialize your development database.

Contributing

Dansdata is a project by dancers, for dancers. Contributions are welcome!

Please see CONTRIBUTING.md for guidelines.

About Dansdata.se

Dansdata (lit. "dance data") is an open API for information relating to social dancing in Sweden.

Felix Zedén Yverås is the project's current maintainer.

License

MIT