Skip to content

sophiabrandt/supertokens-example-nodejs

Repository files navigation

Contributors Issues Apache 2.0 License


Logo

Supertokens.io backend Node.js server with Docker


Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgements

About The Project

This is an example authentication backend using the Supertokens.io Node.js SDK with Docker.
The code is basically a TypeScript port of the official Supertokens.io Quickstart, but with a self-hosted Postgres database. Check the docker-compose.yml if you're interested.

The project is only used for development and needs to be adjusted for production. For Docker, see:

Built With

Getting Started

To get a local copy up and running follow these steps.

Prerequisites

You'll need:

Installation

  1. Clone the repo

    git clone https://github.com/sophiabrandt/supertokens-example-nodejs.git

Usage

Start all docker containers via Makefile:

make run

Alternatively, copy the necessary commands from the Makefile.

Example Signup with curlie:

curlie post -H "Accept: application/json" -d '{"formFields": [{"id": "email", "value": "test@test.com"}, {"id": "password", "value": "AbcDef678990"}]}' http://localhost:7000/auth/signup

Example json for logging in:

{
  "formFields": [
    {
      "id ": "email",
      "value ": "test@test.com "
    },
    {
      "id ": "password ",
      "value ": "12334AbCd"
    }
  ]
}

The Node.js server implements the EmailPassword recipe and Session recipe from Supertokens.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

Please update tests if necessary.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the Apache 2.0 License. See LICENSE for more information.

Contact

Sophia Brandt - @hisophiabrandt

Project Link: https://github.com/sophiabrandt/supertokens-example-nodejs

Acknowledgements

About

authentication/user service via Supertokens.io Node SDK & Docker

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published