Skip to content

Latest commit

 

History

History
88 lines (61 loc) · 1.95 KB

README.md

File metadata and controls

88 lines (61 loc) · 1.95 KB

Socialko Logo

Backend for Socialko, an open source social media app.

Other repositories

Other repositories regarding Socialko, can be found here.

Installation

pnpm install

Environment variables

DATABASE_URL="postgres://username:password@URL"

JWT_SECRET=""
EMAIL_CONFIRM_SECRET=""
FORGOT_PASSWORD_SECRET=""

MAIL_HOST="mail.aerio.cloud"
MAIL_USER="[email protected]"
MAIL_PASSWORD=""
MAIL_FROM="[email protected]"

MAIL_CONFIRM_URL=""
MAIL_FORGOT_PASSWORD_URL=""

S3_BUCKET=
S3_REGION=eu-central-1
S3_ACCESS_KEY=
S3_SECRET_KEY=
S3_ENDPOINT=s3.eu-central-1.wasabisys.com

SWAGGER_TITLE="Socialko API"

SWAGGER_CONTACT_NAME="Aiken Tine Ahac"
SWAGGER_CONTACT_WEBSITE="https://aikenahac.com"
SWAGGER_CONTACT_EMAIL="[email protected]"

SWAGGER_DESCRIPTION="Socialko API Documentation"
SWAGGER_API_VERSION="0.0.1"
SWAGGER_TAG="socialko"

API Documentation

API documentation is available on the /api endpoint.

Setting up the database

  1. Copy docker-compose.yaml.example to docker-compose.yaml 1.1. Configure username, password and/or database name 1.2. Comment out services other than db
  2. Run with docker-compose up -d
  3. Create database tables with npx prisma migrate dev --name init

Running the app

# development
$ pnpm start

# development mode
$ pnpm start:dev

Test

# unit tests
$ pnpm test

# e2e tests
$ pnpm test:e2e

# test coverage
$ pnpm test:cov

Deployment

To deploy the app on production with my build, copy the docker-compose.yaml.example (if you used it for the database) to the server as docker-compose.yaml and modify the environment variables. Once on the server, run docker compose up -d in a folder with the compose file.