Skip to content

saving-satoshi/saving-satoshi-backend

Repository files navigation

Saving Satoshi Backend

Back-end code repository for the Saving Satoshi platform. You can find our front-end code repository here.

Contributing

TBD

Local development setup

This guide will help you set up this project for local development.

Prerequisites

Ensure you have the following installed on your machine:

Before setting up the project, you should have the base image for the REPL which includes all the dependencies for each programming language.

 cd src/base_images
  • choose any of the language you want to build for, for example,

to build base image for c++, cd into cpp in the base_images directory and run the following command

docker build -t cpp-base .

To build base image for javascript, cd into javascript in the base_images directory and run the following command

docker build -t js-base .

To build base image for python, cd into python in the base_images directory and run the following command

docker build -t py-base .

Initial setup

  1. Clone the code from this repository.
  2. Copy the .env.example file to .env.
  3. Build the project by running yarn build
  4. Run make init to setup the database, run migration, copy necessary files and run the project for the first time.
  5. Run make run to start the server.
  6. To stop the server, run ctlr C, then run make stop-deps to stop the database.

Running the Project after initial setup

  1. Run make start-deps to start the database.
  2. Run make run to start the project.
  3. You can now access the project at http://localhost:8000.

Accessing the Database

You can access the database using the DATABASE_URL credentials in the .env file for local development. You can use any DB client of your choice.

Realeasing a New Chapter

After pushing lesson content to master a chapter will remain disabled until a new feature flag is pushed. To unlock a new chapter you must push a feature flag request to the api with the chapter number specified. Here is the necessary scaffold to unlock the next chapter.

curl --location --request PUT '${backend.api}/v1/features/' \
--header 'Origin: http://localhost:3000/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ${token}' \
--data '{
  "feature_name": "chapter_#_enabled",
  "feature_value": 1
}'

Postman

You can find our Postman workspace here.

Roadmap

TBD

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published